mirror of https://gitee.com/y_project/RuoYi.git
代码生成列extra属性
parent
c064115501
commit
00a10ed8df
|
@ -31,6 +31,9 @@ public class ColumnInfo
|
||||||
/** Java属性名称(第一个字母小写),如:user_name => userName */
|
/** Java属性名称(第一个字母小写),如:user_name => userName */
|
||||||
private String attrname;
|
private String attrname;
|
||||||
|
|
||||||
|
/** 执行计划(包含了与索引相关的一些细节信息) */
|
||||||
|
private String extra;
|
||||||
|
|
||||||
public String getColumnName()
|
public String getColumnName()
|
||||||
{
|
{
|
||||||
return columnName;
|
return columnName;
|
||||||
|
@ -100,6 +103,16 @@ public class ColumnInfo
|
||||||
this.attrType = attrType;
|
this.attrType = attrType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getExtra()
|
||||||
|
{
|
||||||
|
return extra;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtra(String extra)
|
||||||
|
{
|
||||||
|
this.extra = extra;
|
||||||
|
}
|
||||||
|
|
||||||
public ColumnConfigInfo getConfigInfo()
|
public ColumnConfigInfo getConfigInfo()
|
||||||
{
|
{
|
||||||
return configInfo;
|
return configInfo;
|
||||||
|
|
|
@ -44,6 +44,7 @@ public class GenUtils
|
||||||
String attrName = StringUtils.convertToCamelCase(column.getColumnName());
|
String attrName = StringUtils.convertToCamelCase(column.getColumnName());
|
||||||
column.setAttrName(attrName);
|
column.setAttrName(attrName);
|
||||||
column.setAttrname(StringUtils.uncapitalize(attrName));
|
column.setAttrname(StringUtils.uncapitalize(attrName));
|
||||||
|
column.setExtra(column.getExtra());
|
||||||
|
|
||||||
// 列的数据类型,转换成Java类型
|
// 列的数据类型,转换成Java类型
|
||||||
String attrType = javaTypeMap.get(column.getDataType());
|
String attrType = javaTypeMap.get(column.getDataType());
|
||||||
|
|
|
@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTableColumnsByName" parameterType="String" resultMap="ColumnInfoResult">
|
<select id="selectTableColumnsByName" parameterType="String" resultMap="ColumnInfoResult">
|
||||||
select column_name, data_type, column_comment from information_schema.columns
|
select column_name, data_type, column_comment, extra from information_schema.columns
|
||||||
where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position
|
where table_name = #{tableName} and table_schema = (select database()) order by ordinal_position
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue