Browse Source

代码生成列extra属性

RuoYi 6 years ago
parent
commit
00a10ed8df

+ 15 - 2
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/ColumnInfo.java

@@ -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;

+ 1 - 0
ruoyi-generator/src/main/java/com/ruoyi/generator/util/GenUtils.java

@@ -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());

+ 1 - 1
ruoyi-generator/src/main/resources/mapper/generator/GenMapper.xml

@@ -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>