tanghc 4 anos atrás
pai
commit
4c06ea053c

+ 5 - 0
changelog.md

@@ -1,5 +1,10 @@
 # changelog
 
+## 1.3.4
+
+- 修复Mysql表名为关键字生成报错问题
+- 优化交互
+
 ## 1.3.3
 
 - 修复生成结果无法过滤文件错误

+ 39 - 1
front/public/velocity/csharp.json

@@ -2,7 +2,45 @@
   "data": [
     {
       "expression": "${pk}",
-      "text": "主键对象,同${column}"
+      "text": "",
+      "children": [
+        {
+          "expression": "${pk.columnName}",
+          "text": "主键表字段名"
+        },
+        {
+          "expression": "${pk.type}",
+          "text": "主键数据库类型"
+        },
+        {
+          "expression": "${pk.javaFieldName}",
+          "text": "主键java字段名"
+        },
+        {
+          "expression": "${pk.javaFieldNameUF}",
+          "text": "主键java字段名首字母大写"
+        },
+        {
+          "expression": "${pk.javaType}",
+          "text": "主键字段的java类型"
+        },
+        {
+          "expression": "${pk.javaTypeBox}",
+          "text": "主键字段的java装箱类型,如Integer"
+        },
+        {
+          "expression": "${pk.isIdentity}",
+          "text": "是否自增,返回boolean"
+        },
+        {
+          "expression": "${pk.mybatisJdbcType}",
+          "text": "mybatis定义的jdbcType"
+        },
+        {
+          "expression": "${pk.comment}",
+          "text": "主键字段注释"
+        }
+      ]
     },
     {
       "expression": "${context}",

+ 39 - 1
front/public/velocity/java.json

@@ -2,7 +2,45 @@
   "data": [
     {
       "expression": "${pk}",
-      "text": "主键对象,同${column}"
+      "text": "",
+      "children": [
+        {
+          "expression": "${pk.columnName}",
+          "text": "主键表字段名"
+        },
+        {
+          "expression": "${pk.type}",
+          "text": "主键数据库类型"
+        },
+        {
+          "expression": "${pk.javaFieldName}",
+          "text": "主键java字段名"
+        },
+        {
+          "expression": "${pk.javaFieldNameUF}",
+          "text": "主键java字段名首字母大写"
+        },
+        {
+          "expression": "${pk.javaType}",
+          "text": "主键字段的java类型"
+        },
+        {
+          "expression": "${pk.javaTypeBox}",
+          "text": "主键字段的java装箱类型,如Integer"
+        },
+        {
+          "expression": "${pk.isIdentity}",
+          "text": "是否自增,返回boolean"
+        },
+        {
+          "expression": "${pk.mybatisJdbcType}",
+          "text": "mybatis定义的jdbcType"
+        },
+        {
+          "expression": "${pk.comment}",
+          "text": "主键字段注释"
+        }
+      ]
     },
     {
       "expression": "${context}",

+ 3 - 1
gen/src/main/java/com/gitee/gen/gen/mysql/MySqlColumnSelector.java

@@ -16,6 +16,8 @@ public class MySqlColumnSelector extends ColumnSelector {
 
 	private static final TypeFormatter TYPE_FORMATTER = new MySqlTypeFormatter();
 
+	private static final String SHOW_SQL = "SHOW FULL COLUMNS FROM `%s`";
+
 	public MySqlColumnSelector(GeneratorConfig generatorConfig) {
 		super(generatorConfig);
 	}
@@ -25,7 +27,7 @@ public class MySqlColumnSelector extends ColumnSelector {
 	 */
 	@Override
 	protected String getColumnInfoSQL(String tableName) {
-		return "SHOW FULL COLUMNS FROM " + tableName;
+		return String.format(SHOW_SQL, tableName);
 	}
 	
 	/*

+ 39 - 1
gen/src/main/resources/public/velocity/csharp.json

@@ -2,7 +2,45 @@
   "data": [
     {
       "expression": "${pk}",
-      "text": "主键对象,同${column}"
+      "text": "",
+      "children": [
+        {
+          "expression": "${pk.columnName}",
+          "text": "主键表字段名"
+        },
+        {
+          "expression": "${pk.type}",
+          "text": "主键数据库类型"
+        },
+        {
+          "expression": "${pk.javaFieldName}",
+          "text": "主键java字段名"
+        },
+        {
+          "expression": "${pk.javaFieldNameUF}",
+          "text": "主键java字段名首字母大写"
+        },
+        {
+          "expression": "${pk.javaType}",
+          "text": "主键字段的java类型"
+        },
+        {
+          "expression": "${pk.javaTypeBox}",
+          "text": "主键字段的java装箱类型,如Integer"
+        },
+        {
+          "expression": "${pk.isIdentity}",
+          "text": "是否自增,返回boolean"
+        },
+        {
+          "expression": "${pk.mybatisJdbcType}",
+          "text": "mybatis定义的jdbcType"
+        },
+        {
+          "expression": "${pk.comment}",
+          "text": "主键字段注释"
+        }
+      ]
     },
     {
       "expression": "${context}",

+ 39 - 1
gen/src/main/resources/public/velocity/java.json

@@ -2,7 +2,45 @@
   "data": [
     {
       "expression": "${pk}",
-      "text": "主键对象,同${column}"
+      "text": "",
+      "children": [
+        {
+          "expression": "${pk.columnName}",
+          "text": "主键表字段名"
+        },
+        {
+          "expression": "${pk.type}",
+          "text": "主键数据库类型"
+        },
+        {
+          "expression": "${pk.javaFieldName}",
+          "text": "主键java字段名"
+        },
+        {
+          "expression": "${pk.javaFieldNameUF}",
+          "text": "主键java字段名首字母大写"
+        },
+        {
+          "expression": "${pk.javaType}",
+          "text": "主键字段的java类型"
+        },
+        {
+          "expression": "${pk.javaTypeBox}",
+          "text": "主键字段的java装箱类型,如Integer"
+        },
+        {
+          "expression": "${pk.isIdentity}",
+          "text": "是否自增,返回boolean"
+        },
+        {
+          "expression": "${pk.mybatisJdbcType}",
+          "text": "mybatis定义的jdbcType"
+        },
+        {
+          "expression": "${pk.comment}",
+          "text": "主键字段注释"
+        }
+      ]
     },
     {
       "expression": "${context}",