代码生成器:简化 vo 和 convert 的生成逻辑

This commit is contained in:
zhijiantianya@gmail.com 2023-11-15 21:05:00 +08:00
parent 91d7938ddf
commit 413640f593

View File

@ -1,17 +1,17 @@
-- 将该建表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/create_tables.sql 文件里 -- 将该建表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/create_tables.sql 文件里
CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" ( CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" (
#foreach ($column in $columns) #foreach ($column in $columns)
#if (${column.javaType} == 'Long') #if (${column.javaType} == 'Long')
#set ($dataType='bigint') #set ($dataType='bigint')
#elseif (${column.javaType} == 'Integer') #elseif (${column.javaType} == 'Integer')
#set ($dataType='int') #set ($dataType='int')
#elseif (${column.javaType} == 'Boolean') #elseif (${column.javaType} == 'Boolean')
#set ($dataType='bit') #set ($dataType='bit')
#elseif (${column.javaType} == 'Date') #elseif (${column.javaType} == 'Date')
#set ($dataType='datetime') #set ($dataType='datetime')
#else #else
#set ($dataType='varchar') #set ($dataType='varchar')
#end #end
#if (${column.primaryKey})##处理主键 #if (${column.primaryKey})##处理主键
"${column.javaField}"#if (${column.javaType} == 'String') ${dataType} NOT NULL#else ${dataType} NOT NULL GENERATED BY DEFAULT AS IDENTITY#end, "${column.javaField}"#if (${column.javaType} == 'String') ${dataType} NOT NULL#else ${dataType} NOT NULL GENERATED BY DEFAULT AS IDENTITY#end,
#else #else
@ -30,7 +30,7 @@ CREATE TABLE IF NOT EXISTS "${table.tableName.toLowerCase()}" (
#end #end
#end #end
#end #end
PRIMARY KEY ("${primaryColumn.columnName.toLowerCase()}") PRIMARY KEY ("${primaryColumn.columnName.toLowerCase()}")
) COMMENT '${table.tableComment}'; ) COMMENT '${table.tableComment}';
-- 将该删表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/clean.sql 文件里 -- 将该删表 SQL 语句,添加到 yudao-module-${table.moduleName}-biz 模块的 test/resources/sql/clean.sql 文件里