同步数据库表时保留更多信息

1. 增加代码生成通用常量中的数据库时间类型datetime2(SQL Server)
2. 字段如果在列表中显示,增加保留显示类型选项
This commit is contained in:
耿嘉祺 2022-04-15 16:58:25 +08:00
parent 68a616d7c7
commit 43bfbf87d7
2 changed files with 3 additions and 2 deletions

View File

@ -38,7 +38,7 @@ public class GenConstants
public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" };
/** 数据库时间类型 */
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
public static final String[] COLUMNTYPE_TIME = { "datetime", "datetime2", "time", "date", "timestamp" };
/** 数据库数字类型 */
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",

View File

@ -304,9 +304,10 @@ public class GenTableServiceImpl implements IGenTableService
column.setColumnId(prevColumn.getColumnId());
if (column.isList())
{
// 如果是列表继续保留查询方式/字典类型选项
// 如果是列表继续保留字典类型查询方式显示类型选项
column.setDictType(prevColumn.getDictType());
column.setQueryType(prevColumn.getQueryType());
column.setHtmlType(prevColumn.getHtmlType());
}
if (StringUtils.isNotEmpty(prevColumn.getIsRequired()) && !column.isPk()
&& (column.isInsert() || column.isEdit())