Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
wangxiaolu-sfa-module-gen
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
sfa
wangxiaolu-sfa-module-gen
Commits
462d6cbd
提交
462d6cbd
authored
11月 25, 2024
作者:
李秋林
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码创建bug修改
上级
360aa2ed
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
23 行增加
和
193 行删除
+23
-193
GenTableColumn.java
src/main/java/com/sfa/gen/domain/GenTableColumn.java
+11
-192
GenTableColumnMapper.java
src/main/java/com/sfa/gen/mapper/GenTableColumnMapper.java
+3
-1
GenTableServiceImpl.java
src/main/java/com/sfa/gen/service/GenTableServiceImpl.java
+5
-0
GenTableColumnMapper.xml
src/main/resources/mapper/generator/GenTableColumnMapper.xml
+2
-0
GenTableMapper.xml
src/main/resources/mapper/generator/GenTableMapper.xml
+2
-0
没有找到文件。
src/main/java/com/sfa/gen/domain/GenTableColumn.java
浏览文件 @
462d6cbd
package
com
.
sfa
.
gen
.
domain
;
package
com
.
sfa
.
gen
.
domain
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.sfa.common.core.utils.StringUtils
;
import
com.sfa.common.core.utils.StringUtils
;
import
com.sfa.common.core.web.domain.BaseDo
;
import
com.sfa.common.core.web.domain.BaseEntity
;
import
com.sfa.common.core.web.domain.BaseEntity
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
/**
* 代码生成业务字段表 gen_table_column
* 代码生成业务字段表 gen_table_column
*
*
* @author ruoyi
* @author ruoyi
*/
*/
public
class
GenTableColumn
extends
BaseEntity
@NoArgsConstructor
@AllArgsConstructor
@Data
@TableName
(
value
=
"gen_table_column"
)
public
class
GenTableColumn
extends
BaseDo
{
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
@@ -68,91 +78,6 @@ public class GenTableColumn extends BaseEntity
...
@@ -68,91 +78,6 @@ public class GenTableColumn extends BaseEntity
/** 排序 */
/** 排序 */
private
Integer
sort
;
private
Integer
sort
;
public
void
setColumnId
(
Long
columnId
)
{
this
.
columnId
=
columnId
;
}
public
Long
getColumnId
()
{
return
columnId
;
}
public
void
setTableId
(
Long
tableId
)
{
this
.
tableId
=
tableId
;
}
public
Long
getTableId
()
{
return
tableId
;
}
public
void
setColumnName
(
String
columnName
)
{
this
.
columnName
=
columnName
;
}
public
String
getColumnName
()
{
return
columnName
;
}
public
void
setColumnComment
(
String
columnComment
)
{
this
.
columnComment
=
columnComment
;
}
public
String
getColumnComment
()
{
return
columnComment
;
}
public
void
setColumnType
(
String
columnType
)
{
this
.
columnType
=
columnType
;
}
public
String
getColumnType
()
{
return
columnType
;
}
public
void
setJavaType
(
String
javaType
)
{
this
.
javaType
=
javaType
;
}
public
String
getJavaType
()
{
return
javaType
;
}
public
void
setJavaField
(
String
javaField
)
{
this
.
javaField
=
javaField
;
}
public
String
getJavaField
()
{
return
javaField
;
}
public
String
getCapJavaField
()
{
return
StringUtils
.
capitalize
(
javaField
);
}
public
void
setIsPk
(
String
isPk
)
{
this
.
isPk
=
isPk
;
}
public
String
getIsPk
()
{
return
isPk
;
}
public
boolean
isPk
()
public
boolean
isPk
()
{
{
return
isPk
(
this
.
isPk
);
return
isPk
(
this
.
isPk
);
...
@@ -163,16 +88,6 @@ public class GenTableColumn extends BaseEntity
...
@@ -163,16 +88,6 @@ public class GenTableColumn extends BaseEntity
return
isPk
!=
null
&&
StringUtils
.
equals
(
"1"
,
isPk
);
return
isPk
!=
null
&&
StringUtils
.
equals
(
"1"
,
isPk
);
}
}
public
String
getIsIncrement
()
{
return
isIncrement
;
}
public
void
setIsIncrement
(
String
isIncrement
)
{
this
.
isIncrement
=
isIncrement
;
}
public
boolean
isIncrement
()
public
boolean
isIncrement
()
{
{
return
isIncrement
(
this
.
isIncrement
);
return
isIncrement
(
this
.
isIncrement
);
...
@@ -183,36 +98,11 @@ public class GenTableColumn extends BaseEntity
...
@@ -183,36 +98,11 @@ public class GenTableColumn extends BaseEntity
return
isIncrement
!=
null
&&
StringUtils
.
equals
(
"1"
,
isIncrement
);
return
isIncrement
!=
null
&&
StringUtils
.
equals
(
"1"
,
isIncrement
);
}
}
public
void
setIsRequired
(
String
isRequired
)
{
this
.
isRequired
=
isRequired
;
}
public
String
getIsRequired
()
{
return
isRequired
;
}
public
boolean
isRequired
()
{
return
isRequired
(
this
.
isRequired
);
}
public
boolean
isRequired
(
String
isRequired
)
public
boolean
isRequired
(
String
isRequired
)
{
{
return
isRequired
!=
null
&&
StringUtils
.
equals
(
"1"
,
isRequired
);
return
isRequired
!=
null
&&
StringUtils
.
equals
(
"1"
,
isRequired
);
}
}
public
void
setIsInsert
(
String
isInsert
)
{
this
.
isInsert
=
isInsert
;
}
public
String
getIsInsert
()
{
return
isInsert
;
}
public
boolean
isInsert
()
public
boolean
isInsert
()
{
{
return
isInsert
(
this
.
isInsert
);
return
isInsert
(
this
.
isInsert
);
...
@@ -223,16 +113,6 @@ public class GenTableColumn extends BaseEntity
...
@@ -223,16 +113,6 @@ public class GenTableColumn extends BaseEntity
return
isInsert
!=
null
&&
StringUtils
.
equals
(
"1"
,
isInsert
);
return
isInsert
!=
null
&&
StringUtils
.
equals
(
"1"
,
isInsert
);
}
}
public
void
setIsEdit
(
String
isEdit
)
{
this
.
isEdit
=
isEdit
;
}
public
String
getIsEdit
()
{
return
isEdit
;
}
public
boolean
isEdit
()
public
boolean
isEdit
()
{
{
return
isInsert
(
this
.
isEdit
);
return
isInsert
(
this
.
isEdit
);
...
@@ -242,17 +122,6 @@ public class GenTableColumn extends BaseEntity
...
@@ -242,17 +122,6 @@ public class GenTableColumn extends BaseEntity
{
{
return
isEdit
!=
null
&&
StringUtils
.
equals
(
"1"
,
isEdit
);
return
isEdit
!=
null
&&
StringUtils
.
equals
(
"1"
,
isEdit
);
}
}
public
void
setIsList
(
String
isList
)
{
this
.
isList
=
isList
;
}
public
String
getIsList
()
{
return
isList
;
}
public
boolean
isList
()
public
boolean
isList
()
{
{
return
isList
(
this
.
isList
);
return
isList
(
this
.
isList
);
...
@@ -263,16 +132,6 @@ public class GenTableColumn extends BaseEntity
...
@@ -263,16 +132,6 @@ public class GenTableColumn extends BaseEntity
return
isList
!=
null
&&
StringUtils
.
equals
(
"1"
,
isList
);
return
isList
!=
null
&&
StringUtils
.
equals
(
"1"
,
isList
);
}
}
public
void
setIsQuery
(
String
isQuery
)
{
this
.
isQuery
=
isQuery
;
}
public
String
getIsQuery
()
{
return
isQuery
;
}
public
boolean
isQuery
()
public
boolean
isQuery
()
{
{
return
isQuery
(
this
.
isQuery
);
return
isQuery
(
this
.
isQuery
);
...
@@ -283,46 +142,6 @@ public class GenTableColumn extends BaseEntity
...
@@ -283,46 +142,6 @@ public class GenTableColumn extends BaseEntity
return
isQuery
!=
null
&&
StringUtils
.
equals
(
"1"
,
isQuery
);
return
isQuery
!=
null
&&
StringUtils
.
equals
(
"1"
,
isQuery
);
}
}
public
void
setQueryType
(
String
queryType
)
{
this
.
queryType
=
queryType
;
}
public
String
getQueryType
()
{
return
queryType
;
}
public
String
getHtmlType
()
{
return
htmlType
;
}
public
void
setHtmlType
(
String
htmlType
)
{
this
.
htmlType
=
htmlType
;
}
public
void
setDictType
(
String
dictType
)
{
this
.
dictType
=
dictType
;
}
public
String
getDictType
()
{
return
dictType
;
}
public
void
setSort
(
Integer
sort
)
{
this
.
sort
=
sort
;
}
public
Integer
getSort
()
{
return
sort
;
}
public
boolean
isSuperColumn
()
public
boolean
isSuperColumn
()
{
{
return
isSuperColumn
(
this
.
javaField
);
return
isSuperColumn
(
this
.
javaField
);
...
...
src/main/java/com/sfa/gen/mapper/GenTableColumnMapper.java
浏览文件 @
462d6cbd
package
com
.
sfa
.
gen
.
mapper
;
package
com
.
sfa
.
gen
.
mapper
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.sfa.gen.domain.GenTableColumn
;
import
com.sfa.gen.domain.GenTableColumn
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -12,7 +14,7 @@ import org.springframework.stereotype.Repository;
...
@@ -12,7 +14,7 @@ import org.springframework.stereotype.Repository;
*/
*/
@Repository
@Repository
@Mapper
@Mapper
public
interface
GenTableColumnMapper
public
interface
GenTableColumnMapper
extends
BaseMapper
<
GenTableColumn
>
{
{
/**
/**
* 根据表名称查询列信息
* 根据表名称查询列信息
...
...
src/main/java/com/sfa/gen/service/GenTableServiceImpl.java
浏览文件 @
462d6cbd
...
@@ -197,12 +197,15 @@ public class GenTableServiceImpl implements IGenTableService
...
@@ -197,12 +197,15 @@ public class GenTableServiceImpl implements IGenTableService
public
void
importGenTable
(
List
<
GenTable
>
tableList
)
public
void
importGenTable
(
List
<
GenTable
>
tableList
)
{
{
String
operName
=
SecurityUtils
.
getUsername
();
String
operName
=
SecurityUtils
.
getUsername
();
Long
userId
=
SecurityUtils
.
getUserId
();
try
try
{
{
for
(
GenTable
table
:
tableList
)
for
(
GenTable
table
:
tableList
)
{
{
String
tableName
=
table
.
getTableName
();
String
tableName
=
table
.
getTableName
();
GenUtils
.
initTable
(
table
,
operName
);
GenUtils
.
initTable
(
table
,
operName
);
table
.
setCreateUserId
(
userId
);
table
.
setCreateBy
(
operName
);
int
row
=
genTableMapper
.
insertGenTable
(
table
);
int
row
=
genTableMapper
.
insertGenTable
(
table
);
if
(
row
>
0
)
if
(
row
>
0
)
{
{
...
@@ -210,6 +213,8 @@ public class GenTableServiceImpl implements IGenTableService
...
@@ -210,6 +213,8 @@ public class GenTableServiceImpl implements IGenTableService
List
<
GenTableColumn
>
genTableColumns
=
genTableColumnMapper
.
selectDbTableColumnsByName
(
tableName
);
List
<
GenTableColumn
>
genTableColumns
=
genTableColumnMapper
.
selectDbTableColumnsByName
(
tableName
);
for
(
GenTableColumn
column
:
genTableColumns
)
for
(
GenTableColumn
column
:
genTableColumns
)
{
{
column
.
setCreateBy
(
operName
);
column
.
setCreateUserId
(
userId
);
GenUtils
.
initColumnField
(
column
,
table
);
GenUtils
.
initColumnField
(
column
,
table
);
genTableColumnMapper
.
insertGenTableColumn
(
column
);
genTableColumnMapper
.
insertGenTableColumn
(
column
);
}
}
...
...
src/main/resources/mapper/generator/GenTableColumnMapper.xml
浏览文件 @
462d6cbd
...
@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -65,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dictType != null and dictType != ''"
>
dict_type,
</if>
<if
test=
"dictType != null and dictType != ''"
>
dict_type,
</if>
<if
test=
"sort != null"
>
sort,
</if>
<if
test=
"sort != null"
>
sort,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
create_user_id,
</if>
create_time
create_time
)values(
)values(
<if
test=
"tableId != null and tableId != ''"
>
#{tableId},
</if>
<if
test=
"tableId != null and tableId != ''"
>
#{tableId},
</if>
...
@@ -85,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -85,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"dictType != null and dictType != ''"
>
#{dictType},
</if>
<if
test=
"dictType != null and dictType != ''"
>
#{dictType},
</if>
<if
test=
"sort != null"
>
#{sort},
</if>
<if
test=
"sort != null"
>
#{sort},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
#{createUserId},
</if>
sysdate()
sysdate()
)
)
</insert>
</insert>
...
...
src/main/resources/mapper/generator/GenTableMapper.xml
浏览文件 @
462d6cbd
...
@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"genPath != null and genPath != ''"
>
gen_path,
</if>
<if
test=
"genPath != null and genPath != ''"
>
gen_path,
</if>
<if
test=
"remark != null and remark != ''"
>
remark,
</if>
<if
test=
"remark != null and remark != ''"
>
remark,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
create_user_id,
</if>
create_time
create_time
)values(
)values(
<if
test=
"tableName != null"
>
#{tableName},
</if>
<if
test=
"tableName != null"
>
#{tableName},
</if>
...
@@ -155,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -155,6 +156,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"genPath != null and genPath != ''"
>
#{genPath},
</if>
<if
test=
"genPath != null and genPath != ''"
>
#{genPath},
</if>
<if
test=
"remark != null and remark != ''"
>
#{remark},
</if>
<if
test=
"remark != null and remark != ''"
>
#{remark},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"createUserId != null and createUserId != ''"
>
#{createUserId},
</if>
sysdate()
sysdate()
)
)
</insert>
</insert>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论