diff --git a/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/system/SysMysqlCreateTableManagerImpl.java b/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/system/SysMysqlCreateTableManagerImpl.java index dd9ae39..294af5e 100644 --- a/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/system/SysMysqlCreateTableManagerImpl.java +++ b/mybatis-enhance-actable/src/main/java/com/gitee/sunchenbin/mybatis/actable/manager/system/SysMysqlCreateTableManagerImpl.java @@ -447,6 +447,7 @@ private List getModifyFieldList(List tableColumnList, L } // 判断类型+长度是否相同 + if (!sysColumn.getColumn_type().toLowerCase().equals(typeAndLength)) { modifyFieldList.add(modifyTableParam); continue; @@ -664,6 +665,8 @@ private Field[] recursionParents(Class clas, Field[] fields) { if (clas.getSuperclass() != null) { Class clsSup = clas.getSuperclass(); List fieldList = new ArrayList(); + //把父类属性字段放到最前面 + List superFieldList = new ArrayList(); fieldList.addAll(Arrays.asList(fields)); // 获取当前class的所有fields的name列表 List fdNames = getFieldNames(fieldList); @@ -674,6 +677,7 @@ private Field[] recursionParents(Class clas, Field[] fields) { } fieldList.add(pfd); } + fieldList.addAll(0, superFieldList); fields = new Field[fieldList.size()]; int i = 0; for (Object field : fieldList.toArray()) {