From a4b1395e929ff13dcdadc18ef76b7fdbc767ba32 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 13 Nov 2023 09:52:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=EF=BC=9A?= =?UTF-8?q?=E4=B8=BB=E5=AD=90=E8=A1=A8=EF=BC=88inner=EF=BC=89=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../codegen/vue3/views/components/_column.vm | 13 + .../views/components/form_sub_normal.vue.vm | 5 + .../vue3/views/components/list_sub_erp.vue.vm | 100 ++++++ .../views/components/list_sub_inner.vue.vm | 4 + .../codegen/inner/CodegenEngineTest.java | 286 +++++++++++++++++- 5 files changed, 407 insertions(+), 1 deletion(-) create mode 100644 yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/_column.vm diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/_column.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/_column.vm new file mode 100644 index 000000000..57a6ef123 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/_column.vm @@ -0,0 +1,13 @@ +## 提供给 baseVO、createVO、updateVO 生成字段 + @Schema(description = "${column.columnComment}"#if (!${column.nullable}), requiredMode = Schema.RequiredMode.REQUIRED#end#if ("$!column.example" != ""), example = "${column.example}"#end) +#if (!${column.nullable})## 判断 @NotEmpty 和 @NotNull 注解 +#if (${column.javaType} == 'String') + @NotEmpty(message = "${column.columnComment}不能为空") +#else + @NotNull(message = "${column.columnComment}不能为空") +#end +#end +#if (${column.javaType} == "LocalDateTime")## 时间类型 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) +#end + private ${column.javaType} ${column.javaField}; diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm index 0ba601cd8..dd713b4f2 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/form_sub_normal.vue.vm @@ -146,6 +146,11 @@ #end #end #end + + + diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm index e69de29bb..d7ce1cebe 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_erp.vue.vm @@ -0,0 +1,100 @@ +#set ($subTable = $subTables.get($subIndex))##当前表 +#set ($subColumns = $subColumnsList.get($subIndex))##当前字段数组 +#set ($subJoinColumn = $subJoinColumns.get($subIndex))##当前 join 字段 +#set ($subSimpleClassName = $subSimpleClassNames.get($subIndex)) +#set ($subJoinColumn = $subJoinColumns.get($subIndex))##当前 join 字段 +#set ($SubJoinColumnName = $subJoinColumn.javaField.substring(0,1).toUpperCase() + ${subJoinColumn.javaField.substring(1)})##首字母大写 + + + \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm index e69de29bb..3fe648892 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3/views/components/list_sub_inner.vue.vm @@ -0,0 +1,4 @@ +## 子表的 erp 和 inner 使用相似的 list 列表,差异主要两点: +## 1)inner 使用 list 不分页,erp 使用 page 分页 +## 2)erp 支持单个子表的新增、修改、删除,inner 不支持 +#parse("codegen/vue3/views/components/list_sub_erp.vue.vm") \ No newline at end of file diff --git a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngineTest.java b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngineTest.java index 7b1fff144..a0db155af 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngineTest.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngineTest.java @@ -178,7 +178,7 @@ public class CodegenEngineTest extends BaseMockitoUnitTest { } @Test - public void testExecute_vue3_masterSub() { + public void testExecute_vue3_masterNormal() { // 准备请求参数 // 主表 CodegenTableDO table = new CodegenTableDO().setScene(CodegenSceneEnum.ADMIN.getScene()).setParentMenuId(888L) @@ -461,6 +461,290 @@ public class CodegenEngineTest extends BaseMockitoUnitTest { } } + @Test + public void testExecute_vue3_masterInner() { + // 准备请求参数 + // 主表 + CodegenTableDO table = new CodegenTableDO().setScene(CodegenSceneEnum.ADMIN.getScene()).setParentMenuId(888L) + .setTableName("infra_demo12_student").setTableComment("学生表") + .setModuleName("infra").setBusinessName("demo12").setClassName("InfraDemo11Student") + .setClassComment("学生").setAuthor("芋道源码") + .setTemplateType(CodegenTemplateTypeEnum.MASTER_INNER.getType()) + .setFrontType(CodegenFrontTypeEnum.VUE3.getType()); + CodegenColumnDO idColumn = new CodegenColumnDO().setColumnName("id").setDataType(JdbcType.BIGINT.name()) + .setId(100L) + .setColumnComment("编号").setNullable(false).setPrimaryKey(true).setAutoIncrement(true) + .setJavaType("Long").setJavaField("id").setExample("1024") + .setCreateOperation(false).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true); + CodegenColumnDO nameColumn = new CodegenColumnDO().setColumnName("name").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("名字").setNullable(false) + .setJavaType("String").setJavaField("name").setExample("芋头") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.LIKE.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.INPUT.getType()); + CodegenColumnDO descriptionColumn = new CodegenColumnDO().setColumnName("description").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("简介").setNullable(false) + .setJavaType("String").setJavaField("description").setExample("我是介绍") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.TEXTAREA.getType()); + CodegenColumnDO birthdayColumn = new CodegenColumnDO().setColumnName("birthday").setDataType(JdbcType.DATE.name()) + .setColumnComment("出生日期").setNullable(false) + .setJavaType("LocalDateTime").setJavaField("birthday") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.DATETIME.getType()); + CodegenColumnDO sexColumn = new CodegenColumnDO().setColumnName("sex").setDataType(JdbcType.INTEGER.name()) + .setColumnComment("性别").setNullable(false) + .setJavaType("Integer").setJavaField("sex").setExample("1") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.SELECT.getType()) + .setDictType("system_user_sex"); + CodegenColumnDO enabledColumn = new CodegenColumnDO().setColumnName("enabled").setDataType(JdbcType.BOOLEAN.name()) + .setColumnComment("是否有效").setNullable(false) + .setJavaType("Boolean").setJavaField("enabled").setExample("true") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.RADIO.getType()) + .setDictType("infra_boolean_string"); + CodegenColumnDO avatarColumn = new CodegenColumnDO().setColumnName("avatar").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("头像").setNullable(false) + .setJavaType("String").setJavaField("avatar").setExample("https://www.iocoder.cn/1.png") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.IMAGE_UPLOAD.getType()); + CodegenColumnDO videoColumn = new CodegenColumnDO().setColumnName("video").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("附件").setNullable(true) + .setJavaType("String").setJavaField("video").setExample("https://www.iocoder.cn/1.mp4") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.FILE_UPLOAD.getType()); + CodegenColumnDO memoColumn = new CodegenColumnDO().setColumnName("memo").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("备注").setNullable(false) + .setJavaType("String").setJavaField("memo").setExample("我是备注") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.EDITOR.getType()); + CodegenColumnDO createTimeColumn = new CodegenColumnDO().setColumnName("create_time").setDataType(JdbcType.DATE.name()) + .setColumnComment("创建时间").setNullable(true) + .setJavaType("LocalDateTime").setJavaField("createTime") + .setCreateOperation(false).setUpdateOperation(false) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.BETWEEN.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.DATETIME.getType()); + List columns = Arrays.asList(idColumn, nameColumn, descriptionColumn, birthdayColumn, + sexColumn, enabledColumn, avatarColumn, videoColumn, memoColumn, createTimeColumn); + + // 子表(联系人) + CodegenTableDO contactTable = new CodegenTableDO().setScene(CodegenSceneEnum.ADMIN.getScene()) + .setTableName("infra_demo12_student_contact").setTableComment("学生联系人表") + .setModuleName("infra").setBusinessName("demo12").setClassName("InfraDemo11StudentContact") + .setClassComment("学生联系人").setAuthor("芋道源码") + .setTemplateType(CodegenTemplateTypeEnum.SUB.getType()) + .setFrontType(CodegenFrontTypeEnum.VUE3.getType()) + .setSubJoinColumnId(100L).setSubJoinMany(true); + CodegenColumnDO contactIdColumn = new CodegenColumnDO().setColumnName("id").setDataType(JdbcType.BIGINT.name()) + .setColumnComment("编号").setNullable(false).setPrimaryKey(true).setAutoIncrement(true) + .setJavaType("Long").setJavaField("id").setExample("1024") + .setCreateOperation(false).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true); + CodegenColumnDO contactStudentIdColumn = new CodegenColumnDO().setColumnName("student_id").setDataType(JdbcType.BIGINT.name()) + .setColumnComment("学生编号").setNullable(false).setPrimaryKey(false) + .setJavaType("Long").setJavaField("studentId").setExample("2048") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setId(100L); + CodegenColumnDO contactNameColumn = new CodegenColumnDO().setColumnName("name").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("名字").setNullable(false) + .setJavaType("String").setJavaField("name").setExample("芋头") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.LIKE.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.INPUT.getType()); + CodegenColumnDO contactDescriptionColumn = new CodegenColumnDO().setColumnName("description").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("简介").setNullable(false) + .setJavaType("String").setJavaField("description").setExample("我是介绍") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.TEXTAREA.getType()); + CodegenColumnDO contactBirthdayColumn = new CodegenColumnDO().setColumnName("birthday").setDataType(JdbcType.DATE.name()) + .setColumnComment("出生日期").setNullable(false) + .setJavaType("LocalDateTime").setJavaField("birthday") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.DATETIME.getType()); + CodegenColumnDO contactSexColumn = new CodegenColumnDO().setColumnName("sex").setDataType(JdbcType.INTEGER.name()) + .setColumnComment("性别").setNullable(false) + .setJavaType("Integer").setJavaField("sex").setExample("1") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.SELECT.getType()) + .setDictType("system_user_sex"); + CodegenColumnDO contactEnabledColumn = new CodegenColumnDO().setColumnName("enabled").setDataType(JdbcType.BOOLEAN.name()) + .setColumnComment("是否有效").setNullable(false) + .setJavaType("Boolean").setJavaField("enabled").setExample("true") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.RADIO.getType()) + .setDictType("infra_boolean_string"); + CodegenColumnDO contactAvatarColumn = new CodegenColumnDO().setColumnName("avatar").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("头像").setNullable(false) + .setJavaType("String").setJavaField("avatar").setExample("https://www.iocoder.cn/1.png") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.IMAGE_UPLOAD.getType()); + CodegenColumnDO contactVideoColumn = new CodegenColumnDO().setColumnName("video").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("附件").setNullable(true) + .setJavaType("String").setJavaField("video").setExample("https://www.iocoder.cn/1.mp4") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.FILE_UPLOAD.getType()); + CodegenColumnDO contactMemoColumn = new CodegenColumnDO().setColumnName("memo").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("备注").setNullable(false) + .setJavaType("String").setJavaField("memo").setExample("我是备注") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.EDITOR.getType()); + CodegenColumnDO contactCreateTimeColumn = new CodegenColumnDO().setColumnName("create_time").setDataType(JdbcType.DATE.name()) + .setColumnComment("创建时间").setNullable(true) + .setJavaType("LocalDateTime").setJavaField("createTime") + .setCreateOperation(false).setUpdateOperation(false) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.BETWEEN.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.DATETIME.getType()); + List contactColumns = Arrays.asList(contactIdColumn, contactStudentIdColumn, + contactNameColumn, contactDescriptionColumn, contactBirthdayColumn, + contactSexColumn, contactEnabledColumn, contactAvatarColumn, contactVideoColumn, contactMemoColumn, contactCreateTimeColumn); + + // 子表(班主任) + CodegenTableDO teacherTable = new CodegenTableDO().setScene(CodegenSceneEnum.ADMIN.getScene()) + .setTableName("infra_demo12_student_teacher").setTableComment("学生班主任表") + .setModuleName("infra").setBusinessName("demo12").setClassName("InfraDemo11StudentTeacher") + .setClassComment("学生班主任").setAuthor("芋道源码") + .setTemplateType(CodegenTemplateTypeEnum.SUB.getType()) + .setFrontType(CodegenFrontTypeEnum.VUE3.getType()) + .setSubJoinColumnId(200L).setSubJoinMany(false); + CodegenColumnDO teacherIdColumn = new CodegenColumnDO().setColumnName("id").setDataType(JdbcType.BIGINT.name()) + .setColumnComment("编号").setNullable(false).setPrimaryKey(true).setAutoIncrement(true) + .setJavaType("Long").setJavaField("id").setExample("1024") + .setCreateOperation(false).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true); + CodegenColumnDO teacherStudentIdColumn = new CodegenColumnDO().setColumnName("student_id").setDataType(JdbcType.BIGINT.name()) + .setColumnComment("学生编号").setNullable(false).setPrimaryKey(false) + .setJavaType("Long").setJavaField("studentId").setExample("2048") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setId(200L); + CodegenColumnDO teacherNameColumn = new CodegenColumnDO().setColumnName("name").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("名字").setNullable(false) + .setJavaType("String").setJavaField("name").setExample("芋头") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.LIKE.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.INPUT.getType()); + CodegenColumnDO teacherDescriptionColumn = new CodegenColumnDO().setColumnName("description").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("简介").setNullable(false) + .setJavaType("String").setJavaField("description").setExample("我是介绍") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.TEXTAREA.getType()); + CodegenColumnDO teacherBirthdayColumn = new CodegenColumnDO().setColumnName("birthday").setDataType(JdbcType.DATE.name()) + .setColumnComment("出生日期").setNullable(false) + .setJavaType("LocalDateTime").setJavaField("birthday") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.DATETIME.getType()); + CodegenColumnDO teacherSexColumn = new CodegenColumnDO().setColumnName("sex").setDataType(JdbcType.INTEGER.name()) + .setColumnComment("性别").setNullable(false) + .setJavaType("Integer").setJavaField("sex").setExample("1") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.SELECT.getType()) + .setDictType("system_user_sex"); + CodegenColumnDO teacherEnabledColumn = new CodegenColumnDO().setColumnName("enabled").setDataType(JdbcType.BOOLEAN.name()) + .setColumnComment("是否有效").setNullable(false) + .setJavaType("Boolean").setJavaField("enabled").setExample("true") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.EQ.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.RADIO.getType()) + .setDictType("infra_boolean_string"); + CodegenColumnDO teacherAvatarColumn = new CodegenColumnDO().setColumnName("avatar").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("头像").setNullable(false) + .setJavaType("String").setJavaField("avatar").setExample("https://www.iocoder.cn/1.png") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.IMAGE_UPLOAD.getType()); + CodegenColumnDO teacherVideoColumn = new CodegenColumnDO().setColumnName("video").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("附件").setNullable(true) + .setJavaType("String").setJavaField("video").setExample("https://www.iocoder.cn/1.mp4") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.FILE_UPLOAD.getType()); + CodegenColumnDO teacherMemoColumn = new CodegenColumnDO().setColumnName("memo").setDataType(JdbcType.VARCHAR.name()) + .setColumnComment("备注").setNullable(false) + .setJavaType("String").setJavaField("memo").setExample("我是备注") + .setCreateOperation(true).setUpdateOperation(true) + .setListOperation(false) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.EDITOR.getType()); + CodegenColumnDO teacherCreateTimeColumn = new CodegenColumnDO().setColumnName("create_time").setDataType(JdbcType.DATE.name()) + .setColumnComment("创建时间").setNullable(true) + .setJavaType("LocalDateTime").setJavaField("createTime") + .setCreateOperation(false).setUpdateOperation(false) + .setListOperation(true).setListOperationCondition(CodegenColumnListConditionEnum.BETWEEN.getCondition()) + .setListOperationResult(true) + .setHtmlType(CodegenColumnHtmlTypeEnum.DATETIME.getType()); + List teacherColumns = Arrays.asList(teacherIdColumn, teacherStudentIdColumn, + teacherNameColumn, teacherDescriptionColumn, teacherBirthdayColumn, + teacherSexColumn, teacherEnabledColumn, teacherAvatarColumn, teacherVideoColumn, teacherMemoColumn, teacherCreateTimeColumn); + + // 调用 + Map result = codegenEngine.execute(table, columns, + Arrays.asList(contactTable, teacherTable), Arrays.asList(contactColumns, teacherColumns)); + + // 构建 zip 包 + writeFile(result, "/Users/yunai/test/demo12.zip"); + + // 断言 + assertEquals(27, result.size()); + + for (Map.Entry entry : result.entrySet()) { + System.out.println(entry.getKey()); + System.out.println(entry.getValue()); + System.out.println(""); + System.out.println(""); + System.out.println(""); + } + } + private void assertPathContentEquals(String path, Map result, String key) { String pathContent = ResourceUtil.readUtf8Str("codegen/" + path); String valueContent = result.get(key);