代码生成列extra属性

dep_wangsr
RuoYi 6 years ago committed by Limy
parent b5fb2b9d59
commit d79b4ab676

@ -18,7 +18,7 @@ public class ColumnInfo
/** 列描述 */
private String columnComment;
/** 列配置 */
private ColumnConfigInfo configInfo;
@ -31,6 +31,9 @@ public class ColumnInfo
/** Java属性名称(第一个字母小写)user_name => userName */
private String attrname;
/** 执行计划(包含了与索引相关的一些细节信息) */
private String extra;
public String getColumnName()
{
return columnName;
@ -99,7 +102,17 @@ public class ColumnInfo
{
this.attrType = attrType;
}
public String getExtra()
{
return extra;
}
public void setExtra(String extra)
{
this.extra = extra;
}
public ColumnConfigInfo getConfigInfo()
{
return configInfo;

@ -44,6 +44,7 @@ public class GenUtils
String attrName = StringUtils.convertToCamelCase(column.getColumnName());
column.setAttrName(attrName);
column.setAttrname(StringUtils.uncapitalize(attrName));
column.setExtra(column.getExtra());
// 列的数据类型转换成Java类型
String attrType = javaTypeMap.get(column.getDataType());

@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<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
</select>

Loading…
Cancel
Save