From eb3d0386eed53c9ceecca4beff5a7180ea28dc23 Mon Sep 17 00:00:00 2001
From: YunaiV <zhijiantianya@gmail.com>
Date: Thu, 11 Feb 2021 23:02:53 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8?=
 =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=20excel=20=E5=AF=BC=E5=87=BA?=
 =?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../infra/enums/InfErrorCodeConstants.java    |  2 +-
 .../system/enums/SysErrorCodeConstants.java   |  3 -
 .../system/enums/dict/SysDictTypeEnum.java    |  2 +
 .../modules/tool/controller/package-info.java |  1 -
 .../test/ToolTestDemoController.java          | 88 +++++++++++++++++++
 .../test/vo/ToolTestDemoBaseVO.java           | 34 +++++++
 .../test/vo/ToolTestDemoCreateReqVO.java      | 14 +++
 .../test/vo/ToolTestDemoExcelVO.java          | 43 +++++++++
 .../test/vo/ToolTestDemoExportReqVO.java      | 39 ++++++++
 .../test/vo/ToolTestDemoPageReqVO.java        | 44 ++++++++++
 .../test/vo/ToolTestDemoRespVO.java           | 23 +++++
 .../test/vo/ToolTestDemoUpdateReqVO.java      | 21 +++++
 .../modules/tool/convert/package-info.java    |  1 -
 .../convert/test/ToolTestDemoConvert.java     | 36 ++++++++
 .../tool/dal/dataobject/package-info.java     |  1 -
 .../dal/dataobject/test/ToolTestDemoDO.java   | 54 ++++++++++++
 .../modules/tool/dal/mysql/package-info.java  |  1 -
 .../dal/mysql/test/ToolTestDemoMapper.java    | 43 +++++++++
 .../tool/enums/ToolErrorCodeConstants.java    | 15 ++++
 .../modules/tool/enums/package-info.java      |  1 -
 .../codegen/impl/ToolCodegenEngine.java       | 15 +++-
 .../modules/tool/service/package-info.java    |  1 -
 .../service/test/ToolTestDemoService.java     | 75 ++++++++++++++++
 .../test/impl/ToolTestDemoServiceImpl.java    | 86 ++++++++++++++++++
 .../codegen/java/controller/controller.vm     | 14 ++-
 .../codegen/java/controller/vo/excelReqVO.vm  | 42 ---------
 .../codegen/java/controller/vo/excelRespVO.vm |  0
 .../codegen/java/controller/vo/excelVO.vm     | 35 ++++++++
 .../codegen/java/controller/vo/exportReqVO.vm | 42 +++++++++
 .../resources/codegen/java/convert/convert.vm | 10 ++-
 src/main/resources/codegen/java/dal/do.vm     |  8 +-
 src/main/resources/codegen/java/dal/mapper.vm | 74 +++++++++-------
 .../resources/codegen/java/enums/errorcode.vm |  2 +-
 .../resources/codegen/java/service/service.vm | 16 +++-
 .../codegen/java/service/serviceImpl.vm       | 13 ++-
 35 files changed, 796 insertions(+), 103 deletions(-)
 delete mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/package-info.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoBaseVO.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoCreateReqVO.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExcelVO.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExportReqVO.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoPageReqVO.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoRespVO.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoUpdateReqVO.java
 delete mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/convert/package-info.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/convert/test/ToolTestDemoConvert.java
 delete mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/package-info.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/test/ToolTestDemoDO.java
 delete mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/package-info.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/test/ToolTestDemoMapper.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/enums/ToolErrorCodeConstants.java
 delete mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/enums/package-info.java
 delete mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/service/package-info.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/service/test/ToolTestDemoService.java
 create mode 100644 src/main/java/cn/iocoder/dashboard/modules/tool/service/test/impl/ToolTestDemoServiceImpl.java
 delete mode 100644 src/main/resources/codegen/java/controller/vo/excelReqVO.vm
 delete mode 100644 src/main/resources/codegen/java/controller/vo/excelRespVO.vm
 create mode 100644 src/main/resources/codegen/java/controller/vo/excelVO.vm
 create mode 100644 src/main/resources/codegen/java/controller/vo/exportReqVO.vm

diff --git a/src/main/java/cn/iocoder/dashboard/modules/infra/enums/InfErrorCodeConstants.java b/src/main/java/cn/iocoder/dashboard/modules/infra/enums/InfErrorCodeConstants.java
index 20e2f390a..81cc37a70 100644
--- a/src/main/java/cn/iocoder/dashboard/modules/infra/enums/InfErrorCodeConstants.java
+++ b/src/main/java/cn/iocoder/dashboard/modules/infra/enums/InfErrorCodeConstants.java
@@ -5,7 +5,7 @@ import cn.iocoder.dashboard.common.exception.ErrorCode;
 /**
  * Infra 错误码枚举类
  *
- * system 系统,使用 1-001-000-000 段
+ * infra 系统,使用 1-001-000-000 段
  */
 public interface InfErrorCodeConstants {
 
diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/enums/SysErrorCodeConstants.java b/src/main/java/cn/iocoder/dashboard/modules/system/enums/SysErrorCodeConstants.java
index 70703bda4..1bbde5784 100644
--- a/src/main/java/cn/iocoder/dashboard/modules/system/enums/SysErrorCodeConstants.java
+++ b/src/main/java/cn/iocoder/dashboard/modules/system/enums/SysErrorCodeConstants.java
@@ -75,7 +75,4 @@ public interface SysErrorCodeConstants {
     // ========== 文件 1002009000 ==========
     ErrorCode FILE_PATH_EXISTS = new ErrorCode(1002009001, "文件路径已经存在");
 
-    // ========== 字典类型(测试) 1002010000 ==========
-    ErrorCode TEST_DEMO_NOT_EXISTS = new ErrorCode(1002010000, "字典类型不存在}");
-
 }
diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java b/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java
index 921935a81..1aaf69d6a 100644
--- a/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java
+++ b/src/main/java/cn/iocoder/dashboard/modules/system/enums/dict/SysDictTypeEnum.java
@@ -16,6 +16,8 @@ public enum SysDictTypeEnum {
     SYS_LOGIN_RESULT("sys_login_result"), // 登陆结果
     SYS_CONFIG_TYPE("sys_config_type"), // 参数配置类型
     SYS_BOOLEAN_STRING("sys_boolean_string"), // Boolean 是否类型
+
+    INF_REDIS_TIMEOUT_TYPE("inf_redis_timeout_type"),  // Redis 超时类型
     ;
 
 
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/package-info.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/package-info.java
deleted file mode 100644
index 631d5fd44..000000000
--- a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.dashboard.modules.tool.controller;
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java
new file mode 100644
index 000000000..8f0c209fe
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/ToolTestDemoController.java
@@ -0,0 +1,88 @@
+package cn.iocoder.dashboard.modules.tool.controller.test;
+
+import cn.iocoder.dashboard.common.pojo.CommonResult;
+import cn.iocoder.dashboard.common.pojo.PageResult;
+import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.*;
+import cn.iocoder.dashboard.modules.tool.convert.test.ToolTestDemoConvert;
+import cn.iocoder.dashboard.modules.tool.dal.dataobject.test.ToolTestDemoDO;
+import cn.iocoder.dashboard.modules.tool.service.test.ToolTestDemoService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.annotation.Resource;
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+import static cn.iocoder.dashboard.common.pojo.CommonResult.success;
+
+@Api(tags = "字典类型")
+@RestController
+@RequestMapping("/tool/test-demo")
+@Validated
+public class ToolTestDemoController {
+
+    @Resource
+    private ToolTestDemoService testDemoService;
+
+    @ApiOperation("创建字典类型")
+    @PostMapping("/create")
+    public CommonResult<Long> createTestDemo(@Valid ToolTestDemoCreateReqVO createReqVO) {
+        return success(testDemoService.createTestDemo(createReqVO));
+    }
+
+    @ApiOperation("更新字典类型")
+    @PutMapping("/update")
+    public CommonResult<Boolean> updateTestDemo(@Valid ToolTestDemoUpdateReqVO updateReqVO) {
+        testDemoService.updateTestDemo(updateReqVO);
+        return success(true);
+    }
+
+    @ApiOperation("删除字典类型")
+    @DeleteMapping("/delete")
+    @ApiImplicitParam(name = "id", value = "编号", required = true)
+    public CommonResult<Boolean> deleteTestDemo(@RequestParam("id") Long id) {
+        testDemoService.deleteTestDemo(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @ApiOperation("获得字典类型")
+    @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class)
+    public CommonResult<ToolTestDemoRespVO> getTestDemo(@RequestParam("id") Long id) {
+        ToolTestDemoDO testDemo = testDemoService.getTestDemo(id);
+        return success(ToolTestDemoConvert.INSTANCE.convert(testDemo));
+    }
+
+    @GetMapping("/list")
+    @ApiOperation("获得字典类型列表")
+    @ApiImplicitParam(name = "ids", value = "编号列表", required = true, dataTypeClass = List.class)
+    public CommonResult<List<ToolTestDemoRespVO>> getTestDemoList(@RequestParam("ids") Collection<Long> ids) {
+        List<ToolTestDemoDO> list = testDemoService.getTestDemoList(ids);
+        return success(ToolTestDemoConvert.INSTANCE.convertList(list));
+    }
+
+    @ApiOperation("获得字典类型分页")
+    @GetMapping("/page")
+    public CommonResult<PageResult<ToolTestDemoRespVO>> getTestDemoPage(@Valid ToolTestDemoPageReqVO pageVO) {
+        PageResult<ToolTestDemoDO> pageResult = testDemoService.getTestDemoPage(pageVO);
+        return success(ToolTestDemoConvert.INSTANCE.convertPage(pageResult));
+    }
+
+    @GetMapping("/export-excel")
+    @ApiOperation("导出字典类型 Excel")
+    public void exportTestDemoExcel(@Valid ToolTestDemoExportReqVO exportReqVO,
+                                    HttpServletResponse response) throws IOException {
+        List<ToolTestDemoDO> list = testDemoService.getTestDemoList(exportReqVO);
+        // 导出 Excel
+        List<ToolTestDemoExcelVO> datas = ToolTestDemoConvert.INSTANCE.convertList02(list);
+        ExcelUtils.write(response, "字典类型.xls", "数据", ToolTestDemoExcelVO.class, datas);
+    }
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoBaseVO.java
new file mode 100644
index 000000000..f10fdb251
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoBaseVO.java
@@ -0,0 +1,34 @@
+package cn.iocoder.dashboard.modules.tool.controller.test.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+/**
+* 字典类型 Base VO,提供给添加、修改、详细的子 VO 使用
+* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成
+*/
+@Data
+public class ToolTestDemoBaseVO {
+
+    @ApiModelProperty(value = "名字", required = true, example = "芋道")
+    @NotNull(message = "名字不能为空")
+    private String name;
+
+    @ApiModelProperty(value = "状态", required = true, example = "1")
+    @NotNull(message = "状态不能为空")
+    private Integer status;
+
+    @ApiModelProperty(value = "类型", required = true, example = "2")
+    @NotNull(message = "类型不能为空")
+    private Integer type;
+
+    @ApiModelProperty(value = "分类", required = true, example = "3")
+    @NotNull(message = "分类不能为空")
+    private Integer category;
+
+    @ApiModelProperty(value = "备注", example = "我是备注")
+    private String remark;
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoCreateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoCreateReqVO.java
new file mode 100644
index 000000000..5b267fe35
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoCreateReqVO.java
@@ -0,0 +1,14 @@
+package cn.iocoder.dashboard.modules.tool.controller.test.vo;
+
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@ApiModel("字典类型创建 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ToolTestDemoCreateReqVO extends ToolTestDemoBaseVO {
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExcelVO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExcelVO.java
new file mode 100644
index 000000000..65ebc0c18
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExcelVO.java
@@ -0,0 +1,43 @@
+package cn.iocoder.dashboard.modules.tool.controller.test.vo;
+
+import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat;
+import com.alibaba.excel.annotation.ExcelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.*;
+
+/**
+ * 字典类型 Excel VO
+ *
+ * @author 芋艿
+ */
+@Data
+public class ToolTestDemoExcelVO {
+
+    @ExcelProperty("编号")
+    private Long id;
+
+    @ExcelProperty("名字")
+    private String name;
+
+    @ExcelProperty("状态")
+    @DictFormat(SYS_COMMON_STATUS)
+    private Integer status;
+
+    @ExcelProperty("类型")
+    @DictFormat(SYS_OPERATE_TYPE)
+    private Integer type;
+
+    @ExcelProperty("分类")
+    @DictFormat(INF_REDIS_TIMEOUT_TYPE)
+    private Integer category;
+
+    @ExcelProperty("备注")
+    private String remark;
+
+    @ExcelProperty("创建时间")
+    private Date createTime;
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExportReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExportReqVO.java
new file mode 100644
index 000000000..37933cf3f
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoExportReqVO.java
@@ -0,0 +1,39 @@
+package cn.iocoder.dashboard.modules.tool.controller.test.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@ApiModel(value = "字典类型 Excel 导出 Request VO", description = "参数和 ToolTestDemoPageReqVO 是一致的")
+@Data
+public class ToolTestDemoExportReqVO {
+
+    @ApiModelProperty(value = "名字", example = "芋道")
+    private String name;
+
+    @ApiModelProperty(value = "状态", example = "1")
+    private Integer status;
+
+    @ApiModelProperty(value = "类型", example = "2")
+    private Integer type;
+
+    @ApiModelProperty(value = "分类", example = "3")
+    private Integer category;
+
+    @ApiModelProperty(value = "备注", example = "我是备注")
+    private String remark;
+
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    @ApiModelProperty(value = "开始创建时间")
+    private Date beginCreateTime;
+
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    @ApiModelProperty(value = "结束创建时间")
+    private Date endCreateTime;
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoPageReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoPageReqVO.java
new file mode 100644
index 000000000..5a0d5a408
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoPageReqVO.java
@@ -0,0 +1,44 @@
+package cn.iocoder.dashboard.modules.tool.controller.test.vo;
+
+import cn.iocoder.dashboard.common.pojo.PageParam;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@ApiModel("字典类型分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ToolTestDemoPageReqVO extends PageParam {
+
+    @ApiModelProperty(value = "名字", example = "芋道")
+    private String name;
+
+    @ApiModelProperty(value = "状态", example = "1")
+    private Integer status;
+
+    @ApiModelProperty(value = "类型", example = "2")
+    private Integer type;
+
+    @ApiModelProperty(value = "分类", example = "3")
+    private Integer category;
+
+    @ApiModelProperty(value = "备注", example = "我是备注")
+    private String remark;
+
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    @ApiModelProperty(value = "开始创建时间")
+    private Date beginCreateTime;
+
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    @ApiModelProperty(value = "结束创建时间")
+    private Date endCreateTime;
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoRespVO.java
new file mode 100644
index 000000000..cc22897fd
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoRespVO.java
@@ -0,0 +1,23 @@
+package cn.iocoder.dashboard.modules.tool.controller.test.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.util.Date;
+
+@ApiModel("字典类型 Response VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ToolTestDemoRespVO extends ToolTestDemoBaseVO {
+
+    @ApiModelProperty(value = "编号", required = true, example = "1")
+    private Long id;
+
+    @ApiModelProperty(value = "创建时间", required = true)
+    private Date createTime;
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoUpdateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoUpdateReqVO.java
new file mode 100644
index 000000000..d4bb3830d
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/controller/test/vo/ToolTestDemoUpdateReqVO.java
@@ -0,0 +1,21 @@
+package cn.iocoder.dashboard.modules.tool.controller.test.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import javax.validation.constraints.NotNull;
+
+@ApiModel("字典类型更新 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ToolTestDemoUpdateReqVO extends ToolTestDemoBaseVO {
+
+    @ApiModelProperty(value = "编号", required = true, example = "1")
+    @NotNull(message = "编号不能为空")
+    private Long id;
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/convert/package-info.java b/src/main/java/cn/iocoder/dashboard/modules/tool/convert/package-info.java
deleted file mode 100644
index 6dd9aa41b..000000000
--- a/src/main/java/cn/iocoder/dashboard/modules/tool/convert/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.dashboard.modules.tool.convert;
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/convert/test/ToolTestDemoConvert.java b/src/main/java/cn/iocoder/dashboard/modules/tool/convert/test/ToolTestDemoConvert.java
new file mode 100644
index 000000000..7e2b28a05
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/convert/test/ToolTestDemoConvert.java
@@ -0,0 +1,36 @@
+package cn.iocoder.dashboard.modules.tool.convert.test;
+
+import cn.iocoder.dashboard.common.pojo.PageResult;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoCreateReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoExcelVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoRespVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoUpdateReqVO;
+import cn.iocoder.dashboard.modules.tool.dal.dataobject.test.ToolTestDemoDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+/**
+* 字典类型 Convert
+*
+* @author 芋艿
+*/
+@Mapper
+public interface ToolTestDemoConvert {
+
+    ToolTestDemoConvert INSTANCE = Mappers.getMapper(ToolTestDemoConvert.class);
+
+    ToolTestDemoDO convert(ToolTestDemoCreateReqVO bean);
+
+    ToolTestDemoDO convert(ToolTestDemoUpdateReqVO bean);
+
+    ToolTestDemoRespVO convert(ToolTestDemoDO bean);
+
+    List<ToolTestDemoRespVO> convertList(List<ToolTestDemoDO> list);
+
+    PageResult<ToolTestDemoRespVO> convertPage(PageResult<ToolTestDemoDO> page);
+
+    List<ToolTestDemoExcelVO> convertList02(List<ToolTestDemoDO> list);
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/package-info.java b/src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/package-info.java
deleted file mode 100644
index 0e3b7e405..000000000
--- a/src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.dashboard.modules.tool.dal.dataobject;
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/test/ToolTestDemoDO.java b/src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/test/ToolTestDemoDO.java
new file mode 100644
index 000000000..9d598ea11
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/dal/dataobject/test/ToolTestDemoDO.java
@@ -0,0 +1,54 @@
+package cn.iocoder.dashboard.modules.tool.dal.dataobject.test;
+
+import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+* 字典类型 DO
+*
+* @author 芋艿
+*/
+@TableName("tool_test_demo")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class ToolTestDemoDO extends BaseDO {
+
+    /**
+     * 编号
+     */
+    @TableId
+    private Long id;
+    /**
+     * 名字
+     */
+    private String name;
+    /**
+     * 状态
+     *
+     * 枚举 {@link cn.iocoder.dashboard.common.enums.CommonStatusEnum}
+     */
+    private Integer status;
+    /**
+     * 类型
+     *
+     * 枚举 {@link cn.iocoder.dashboard.framework.logger.operatelog.core.enums.OperateTypeEnum}
+     */
+    private Integer type;
+    /**
+     * 分类
+     *
+     * 枚举 {@link cn.iocoder.dashboard.framework.redis.core.RedisKeyDefine.TimeoutTypeEnum}
+     */
+    private Integer category;
+    /**
+     * 备注
+     */
+    private String remark;
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/package-info.java b/src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/package-info.java
deleted file mode 100644
index 71612014d..000000000
--- a/src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.dashboard.modules.tool.dal.mysql;
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/test/ToolTestDemoMapper.java b/src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/test/ToolTestDemoMapper.java
new file mode 100644
index 000000000..ff0b5670e
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/dal/mysql/test/ToolTestDemoMapper.java
@@ -0,0 +1,43 @@
+package cn.iocoder.dashboard.modules.tool.dal.mysql.test;
+
+import cn.iocoder.dashboard.common.pojo.PageResult;
+import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoExportReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoPageReqVO;
+import cn.iocoder.dashboard.modules.tool.dal.dataobject.test.ToolTestDemoDO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+/**
+ * 字典类型 Mapper
+ *
+ * @author 芋艿
+ */
+@Mapper
+public interface ToolTestDemoMapper extends BaseMapperX<ToolTestDemoDO> {
+
+    default PageResult<ToolTestDemoDO> selectPage(ToolTestDemoPageReqVO reqVO) {
+        return selectPage(reqVO, new QueryWrapperX<ToolTestDemoDO>()
+                .likeIfPresent("name", reqVO.getName())
+                .eqIfPresent("status", reqVO.getStatus())
+                .eqIfPresent("type", reqVO.getType())
+                .eqIfPresent("category", reqVO.getCategory())
+                .eqIfPresent("remark", reqVO.getRemark())
+                .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
+        );
+    }
+
+    default List<ToolTestDemoDO> selectList(ToolTestDemoExportReqVO reqVO) {
+        return selectList(new QueryWrapperX<ToolTestDemoDO>()
+                .likeIfPresent("name", reqVO.getName())
+                .eqIfPresent("status", reqVO.getStatus())
+                .eqIfPresent("type", reqVO.getType())
+                .eqIfPresent("category", reqVO.getCategory())
+                .eqIfPresent("remark", reqVO.getRemark())
+                .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
+        );
+    }
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/enums/ToolErrorCodeConstants.java b/src/main/java/cn/iocoder/dashboard/modules/tool/enums/ToolErrorCodeConstants.java
new file mode 100644
index 000000000..b24e2e07b
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/enums/ToolErrorCodeConstants.java
@@ -0,0 +1,15 @@
+package cn.iocoder.dashboard.modules.tool.enums;
+
+import cn.iocoder.dashboard.common.exception.ErrorCode;
+
+/**
+ * Tool 错误码枚举类
+ *
+ * tool 系统,使用 1-003-000-000 段
+ */
+public interface ToolErrorCodeConstants {
+
+    // ========== 字典类型(测试) 1003000000 ==========
+    ErrorCode TEST_DEMO_NOT_EXISTS = new ErrorCode(1003000000, "测试示例不存在");
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/enums/package-info.java b/src/main/java/cn/iocoder/dashboard/modules/tool/enums/package-info.java
deleted file mode 100644
index f76f926d5..000000000
--- a/src/main/java/cn/iocoder/dashboard/modules/tool/enums/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.dashboard.modules.tool.enums;
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenEngine.java b/src/main/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenEngine.java
index f56374809..809387cfd 100644
--- a/src/main/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenEngine.java
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenEngine.java
@@ -10,9 +10,12 @@ import cn.iocoder.dashboard.common.pojo.CommonResult;
 import cn.iocoder.dashboard.common.pojo.PageParam;
 import cn.iocoder.dashboard.common.pojo.PageResult;
 import cn.iocoder.dashboard.framework.codegen.config.CodegenProperties;
+import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat;
+import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils;
 import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO;
 import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX;
 import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX;
+import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum;
 import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO;
 import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO;
 import cn.iocoder.dashboard.util.collection.CollectionUtils;
@@ -59,6 +62,10 @@ public class ToolCodegenEngine {
                     javaFilePath("controller/${table.businessName}/vo/${table.className}RespVO"))
             .put(javaTemplatePath("controller/vo/updateReqVO"),
                     javaFilePath("controller/${table.businessName}/vo/${table.className}UpdateReqVO"))
+            .put(javaTemplatePath("controller/vo/exportReqVO"),
+                    javaFilePath("controller/${table.businessName}/vo/${table.className}ExportReqVO"))
+            .put(javaTemplatePath("controller/vo/excelVO"),
+                    javaFilePath("controller/${table.businessName}/vo/${table.className}ExcelVO"))
             .put(javaTemplatePath("convert/convert"),
                     javaFilePath("convert/${table.businessName}/${table.className}Convert"))
             .put(javaTemplatePath("dal/do"),
@@ -106,15 +113,19 @@ public class ToolCodegenEngine {
         // 全局 Java Bean
         globalBindingMap.put("CommonResultClassName", CommonResult.class.getName());
         globalBindingMap.put("PageResultClassName", PageResult.class.getName());
-        globalBindingMap.put("DateUtilsClassName", DateUtils.class.getName());
-        globalBindingMap.put("ServiceExceptionUtilClassName", ServiceExceptionUtil.class.getName());
         // VO 类,独有字段
         globalBindingMap.put("PageParamClassName", PageParam.class.getName());
+        globalBindingMap.put("DictFormatClassName", DictFormat.class.getName());
+        globalBindingMap.put("SysDictTypeEnumClassName", SysDictTypeEnum.class.getName());
         // DO 类,独有字段
         globalBindingMap.put("baseDOFields", ToolCodegenBuilder.BASE_DO_FIELDS);
         globalBindingMap.put("BaseDOClassName", BaseDO.class.getName());
         globalBindingMap.put("QueryWrapperClassName", QueryWrapperX.class.getName());
         globalBindingMap.put("BaseMapperClassName", BaseMapperX.class.getName());
+        // Util 了诶
+        globalBindingMap.put("ServiceExceptionUtilClassName", ServiceExceptionUtil.class.getName());
+        globalBindingMap.put("DateUtilsClassName", DateUtils.class.getName());
+        globalBindingMap.put("ExcelUtilsClassName", ExcelUtils.class.getName());
     }
 
     public Map<String, String> execute(ToolCodegenTableDO table, List<ToolCodegenColumnDO> columns) {
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/service/package-info.java b/src/main/java/cn/iocoder/dashboard/modules/tool/service/package-info.java
deleted file mode 100644
index 5c89d1db5..000000000
--- a/src/main/java/cn/iocoder/dashboard/modules/tool/service/package-info.java
+++ /dev/null
@@ -1 +0,0 @@
-package cn.iocoder.dashboard.modules.tool.service;
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/service/test/ToolTestDemoService.java b/src/main/java/cn/iocoder/dashboard/modules/tool/service/test/ToolTestDemoService.java
new file mode 100644
index 000000000..377eb0de4
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/service/test/ToolTestDemoService.java
@@ -0,0 +1,75 @@
+package cn.iocoder.dashboard.modules.tool.service.test;
+
+import cn.iocoder.dashboard.common.pojo.PageResult;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoCreateReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoExportReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoPageReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoUpdateReqVO;
+import cn.iocoder.dashboard.modules.tool.dal.dataobject.test.ToolTestDemoDO;
+
+import javax.validation.Valid;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * 字典类型 Service 接口
+ *
+ * @author 芋艿
+ */
+public interface ToolTestDemoService {
+
+    /**
+     * 创建字典类型
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createTestDemo(@Valid ToolTestDemoCreateReqVO createReqVO);
+
+    /**
+     * 更新字典类型
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateTestDemo(@Valid ToolTestDemoUpdateReqVO updateReqVO);
+
+    /**
+     * 删除字典类型
+     *
+     * @param id 编号
+     */
+    void deleteTestDemo(Long id);
+
+    /**
+     * 获得字典类型
+     *
+     * @param id 编号
+     * @return 字典类型
+     */
+    ToolTestDemoDO getTestDemo(Long id);
+
+    /**
+     * 获得字典类型列表
+     *
+     * @param ids 编号
+     * @return 字典类型列表
+     */
+    List<ToolTestDemoDO> getTestDemoList(Collection<Long> ids);
+
+    /**
+     * 获得字典类型分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 字典类型分页
+     */
+    PageResult<ToolTestDemoDO> getTestDemoPage(ToolTestDemoPageReqVO pageReqVO);
+
+    /**
+     * 获得字典类型列表, 用于 Excel 导出
+     *
+     * @param exportReqVO 查询条件
+     * @return 字典类型分页
+     */
+    List<ToolTestDemoDO> getTestDemoList(ToolTestDemoExportReqVO exportReqVO);
+
+}
diff --git a/src/main/java/cn/iocoder/dashboard/modules/tool/service/test/impl/ToolTestDemoServiceImpl.java b/src/main/java/cn/iocoder/dashboard/modules/tool/service/test/impl/ToolTestDemoServiceImpl.java
new file mode 100644
index 000000000..5483bab0e
--- /dev/null
+++ b/src/main/java/cn/iocoder/dashboard/modules/tool/service/test/impl/ToolTestDemoServiceImpl.java
@@ -0,0 +1,86 @@
+package cn.iocoder.dashboard.modules.tool.service.test.impl;
+
+import cn.iocoder.dashboard.common.exception.util.ServiceExceptionUtil;
+import cn.iocoder.dashboard.common.pojo.PageResult;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoCreateReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoExportReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoPageReqVO;
+import cn.iocoder.dashboard.modules.tool.controller.test.vo.ToolTestDemoUpdateReqVO;
+import cn.iocoder.dashboard.modules.tool.convert.test.ToolTestDemoConvert;
+import cn.iocoder.dashboard.modules.tool.dal.dataobject.test.ToolTestDemoDO;
+import cn.iocoder.dashboard.modules.tool.dal.mysql.test.ToolTestDemoMapper;
+import cn.iocoder.dashboard.modules.tool.service.test.ToolTestDemoService;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import javax.annotation.Resource;
+import java.util.Collection;
+import java.util.List;
+
+import static cn.iocoder.dashboard.modules.tool.enums.ToolErrorCodeConstants.TEST_DEMO_NOT_EXISTS;
+
+/**
+ * 字典类型 Service 实现类
+ *
+ * @author 芋艿
+ */
+@Service
+@Validated
+public class ToolTestDemoServiceImpl implements ToolTestDemoService {
+
+    @Resource
+    private ToolTestDemoMapper testDemoMapper;
+
+    @Override
+    public Long createTestDemo(ToolTestDemoCreateReqVO createReqVO) {
+        // 插入
+        ToolTestDemoDO testDemo = ToolTestDemoConvert.INSTANCE.convert(createReqVO);
+        testDemoMapper.insert(testDemo);
+        // 返回
+        return testDemo.getId();
+    }
+
+    @Override
+    public void updateTestDemo(ToolTestDemoUpdateReqVO updateReqVO) {
+        // 校验存在
+        this.validateTestDemoExists(updateReqVO.getId());
+        // 更新
+        ToolTestDemoDO updateObj = ToolTestDemoConvert.INSTANCE.convert(updateReqVO);
+        testDemoMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteTestDemo(Long id) {
+        // 校验存在
+        this.validateTestDemoExists(id);
+        // 更新
+        testDemoMapper.deleteById(id);
+    }
+
+    private void validateTestDemoExists(Long id) {
+        if (testDemoMapper.selectById(id) == null) {
+            throw ServiceExceptionUtil.exception(TEST_DEMO_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public ToolTestDemoDO getTestDemo(Long id) {
+        return testDemoMapper.selectById(id);
+    }
+
+    @Override
+    public List<ToolTestDemoDO> getTestDemoList(Collection<Long> ids) {
+        return testDemoMapper.selectBatchIds(ids);
+    }
+
+    @Override
+    public PageResult<ToolTestDemoDO> getTestDemoPage(ToolTestDemoPageReqVO pageReqVO) {
+		return testDemoMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public List<ToolTestDemoDO> getTestDemoList(ToolTestDemoExportReqVO exportReqVO) {
+		return testDemoMapper.selectList(exportReqVO);
+    }
+
+}
diff --git a/src/main/resources/codegen/java/controller/controller.vm b/src/main/resources/codegen/java/controller/controller.vm
index e443b7c9b..273c0eba4 100644
--- a/src/main/resources/codegen/java/controller/controller.vm
+++ b/src/main/resources/codegen/java/controller/controller.vm
@@ -8,12 +8,16 @@ import io.swagger.annotations.*;
 
 import javax.validation.constraints.*;
 import javax.validation.*;
+import javax.servlet.http.*;
 import java.util.*;
+import java.io.IOException;
 
 import ${PageResultClassName};
 import ${CommonResultClassName};
 import static ${CommonResultClassName}.success;
 
+import ${ExcelUtilsClassName};
+
 import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*;
 import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
 import ${basePackage}.${table.moduleName}.convert.${table.businessName}.${table.className}Convert;
@@ -73,6 +77,14 @@ public class ${table.className}Controller {
         return success(${table.className}Convert.INSTANCE.convertPage(pageResult));
     }
 
-
+    @GetMapping("/export-excel")
+    @ApiOperation("导出${table.classComment} Excel")
+    public void export${simpleClassName}Excel(@Valid ${table.className}ExportReqVO exportReqVO,
+              HttpServletResponse response) throws IOException {
+        List<${table.className}DO> list = ${classNameVar}Service.get${simpleClassName}List(exportReqVO);
+        // 导出 Excel
+        List<${table.className}ExcelVO> datas = ${table.className}Convert.INSTANCE.convertList02(list);
+        ExcelUtils.write(response, "${table.classComment}.xls", "数据", ${table.className}ExcelVO.class, datas);
+    }
 
 }
diff --git a/src/main/resources/codegen/java/controller/vo/excelReqVO.vm b/src/main/resources/codegen/java/controller/vo/excelReqVO.vm
deleted file mode 100644
index e0af63d13..000000000
--- a/src/main/resources/codegen/java/controller/vo/excelReqVO.vm
+++ /dev/null
@@ -1,42 +0,0 @@
-package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo;
-
-import lombok.*;
-import java.util.*;
-import io.swagger.annotations.*;
-import ${PageParamClassName};
-## 处理 Date 字段的引入
-#foreach ($column in $columns)
-    #if (${column.listOperation} && ${column.javaType} == "Date")## 时间类型
-		import org.springframework.format.annotation.DateTimeFormat;
-
-		import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-        #break
-    #end
-#end
-## 字段模板
-#macro(columnTpl $prefix $prefixStr)
-    #if (${column.javaType} == "Date")## 时间类型
-		@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    #end
-@ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
-private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
-#end
-
-@ApiModel(value = "${table.classComment} Excel 导出 Request VO", description = "参数和 ${table.className}PageReqVO 是一致的")
-@Data
-public class ${table.className}ExcelReqVO {
-
-#foreach ($column in $columns)
-    #set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写
-    #if (${column.listOperation})##查询操作
-        #if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
-            #columnTpl('begin', '开始')
-
-            #columnTpl('end', '结束')
-        #else##情况二,非 Between 的时间
-            #columnTpl('', '')
-        #end
-
-    #end
-#end
-}
diff --git a/src/main/resources/codegen/java/controller/vo/excelRespVO.vm b/src/main/resources/codegen/java/controller/vo/excelRespVO.vm
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/main/resources/codegen/java/controller/vo/excelVO.vm b/src/main/resources/codegen/java/controller/vo/excelVO.vm
new file mode 100644
index 000000000..031d5d71c
--- /dev/null
+++ b/src/main/resources/codegen/java/controller/vo/excelVO.vm
@@ -0,0 +1,35 @@
+package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.annotations.*;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+#foreach ($column in $columns)
+#if ("$!column.dictType" != "")## 有设置数据字典
+import ${DictFormatClassName};
+
+import static ${SysDictTypeEnumClassName}.*;
+#break
+#end
+#end
+
+/**
+ * ${table.classComment} Excel VO
+ *
+ * @author ${table.author}
+ */
+@Data
+public class ${table.className}ExcelVO {
+
+#foreach ($column in $columns)
+    #if (${column.listOperationResult})##返回字段
+    @ExcelProperty("${column.columnComment}")
+    #if ("$!column.dictType" != "")##处理枚举值
+    @DictFormat(${column.dictType.toUpperCase()})
+    #end
+    private ${column.javaType} ${column.javaField};
+
+    #end
+#end
+}
diff --git a/src/main/resources/codegen/java/controller/vo/exportReqVO.vm b/src/main/resources/codegen/java/controller/vo/exportReqVO.vm
new file mode 100644
index 000000000..6a5dbc0e6
--- /dev/null
+++ b/src/main/resources/codegen/java/controller/vo/exportReqVO.vm
@@ -0,0 +1,42 @@
+package ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo;
+
+import lombok.*;
+import java.util.*;
+import io.swagger.annotations.*;
+import ${PageParamClassName};
+## 处理 Date 字段的引入
+#foreach ($column in $columns)
+#if (${column.listOperation} && ${column.javaType} == "Date")## 时间类型
+import org.springframework.format.annotation.DateTimeFormat;
+
+import static ${DateUtilsClassName}.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+#break
+#end
+#end
+## 字段模板
+#macro(columnTpl $prefix $prefixStr)
+#if (${column.javaType} == "Date")## 时间类型
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+#end
+    @ApiModelProperty(value = "${prefixStr}${column.columnComment}"#if ("$!column.example" != ""), example = "${column.example}"#end)
+    private ${column.javaType}#if ("$!prefix" != "") ${prefix}${JavaField}#else ${column.javaField}#end;
+#end
+
+@ApiModel(value = "${table.classComment} Excel 导出 Request VO", description = "参数和 ${table.className}PageReqVO 是一致的")
+@Data
+public class ${table.className}ExportReqVO {
+
+#foreach ($column in $columns)
+#set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写
+#if (${column.listOperation})##查询操作
+#if (${column.listOperationCondition} == "BETWEEN")## 情况一,Between 的时候
+    #columnTpl('begin', '开始')
+
+    #columnTpl('end', '结束')
+#else##情况二,非 Between 的时间
+    #columnTpl('', '')
+#end
+
+#end
+#end
+}
diff --git a/src/main/resources/codegen/java/convert/convert.vm b/src/main/resources/codegen/java/convert/convert.vm
index d8e72709e..0ec103181 100644
--- a/src/main/resources/codegen/java/convert/convert.vm
+++ b/src/main/resources/codegen/java/convert/convert.vm
@@ -10,10 +10,10 @@ import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*;
 import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
 
 /**
-* ${table.classComment} Convert
-*
-* @author ${table.author}
-*/
+ * ${table.classComment} Convert
+ *
+ * @author ${table.author}
+ */
 @Mapper
 public interface ${table.className}Convert {
 
@@ -29,4 +29,6 @@ public interface ${table.className}Convert {
 
     PageResult<${table.className}RespVO> convertPage(PageResult<${table.className}DO> page);
 
+    List<${table.className}ExcelVO> convertList02(List<${table.className}DO> list);
+
 }
diff --git a/src/main/resources/codegen/java/dal/do.vm b/src/main/resources/codegen/java/dal/do.vm
index ba0e81129..b70d01d18 100644
--- a/src/main/resources/codegen/java/dal/do.vm
+++ b/src/main/resources/codegen/java/dal/do.vm
@@ -6,10 +6,10 @@ import com.baomidou.mybatisplus.annotation.*;
 import ${BaseDOClassName};
 
 /**
-* ${table.classComment} DO
-*
-* @author ${table.author}
-*/
+ * ${table.classComment} DO
+ *
+ * @author ${table.author}
+ */
 @TableName("${table.tableName}")
 @Data
 @EqualsAndHashCode(callSuper = true)
diff --git a/src/main/resources/codegen/java/dal/mapper.vm b/src/main/resources/codegen/java/dal/mapper.vm
index 6eaced4a8..57228264c 100644
--- a/src/main/resources/codegen/java/dal/mapper.vm
+++ b/src/main/resources/codegen/java/dal/mapper.vm
@@ -1,48 +1,60 @@
 package ${basePackage}.${table.moduleName}.dal.mysql.${table.businessName};
 
+import java.util.*;
+
 import ${PageResultClassName};
 import ${QueryWrapperClassName};
 import ${BaseMapperClassName};
 import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.${table.className}DO;
 import org.apache.ibatis.annotations.Mapper;
-import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.${table.className}PageReqVO;
+import ${basePackage}.${table.moduleName}.controller.${table.businessName}.vo.*;
 
+## 字段模板
+#macro(listCondition)
+#foreach ($column in $columns)
+#if (${column.listOperation})
+#set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写
+#if (${column.listOperationCondition} == "=")##情况一,= 的时候
+                .eqIfPresent("${column.columnName}", reqVO.get${JavaField}())
+#end
+#if (${column.listOperationCondition} == "!=")##情况二,!= 的时候
+                .neIfPresent("${column.columnName}", reqVO.get${JavaField}())
+#end
+#if (${column.listOperationCondition} == ">")##情况三,> 的时候
+                .gtIfPresent("${column.columnName}", reqVO.get${JavaField}())
+#end
+#if (${column.listOperationCondition} == ">=")##情况四,>= 的时候
+                .geIfPresent("${column.columnName}", reqVO.get${JavaField}())
+#end
+#if (${column.listOperationCondition} == "<")##情况五,< 的时候
+                .gtIfPresent("${column.columnName}", reqVO.get${JavaField}())
+#end
+#if (${column.listOperationCondition} == "LIKE")##情况七,Like 的时候
+                .likeIfPresent("${column.columnName}", reqVO.get${JavaField}())
+#end
+#if (${column.listOperationCondition} == "BETWEEN")##情况八,Between 的时候
+                .betweenIfPresent("${column.columnName}", reqVO.getBegin${JavaField}(), reqVO.getEnd${JavaField}())
+#end
+#end
+#end
+#end
 /**
-* ${table.classComment} Mapper
-*
-* @author ${table.author}
-*/
+ * ${table.classComment} Mapper
+ *
+ * @author ${table.author}
+ */
 @Mapper
 public interface ${table.className}Mapper extends BaseMapperX<${table.className}DO> {
 
     default PageResult<${table.className}DO> selectPage(${table.className}PageReqVO reqVO) {
         return selectPage(reqVO, new QueryWrapperX<${table.className}DO>()
-#foreach ($column in $columns)
-#if (${column.listOperation})
-#set ($JavaField = $column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})##首字母大写
-#if (${column.listOperationCondition} == "=")##情况一,= 的时候
-            .eqIfPresent("${column.columnName}", reqVO.get${JavaField}())
-#end
-#if (${column.listOperationCondition} == "!=")##情况二,!= 的时候
-            .neIfPresent("${column.columnName}", reqVO.get${JavaField}())
-#end
-#if (${column.listOperationCondition} == ">")##情况三,> 的时候
-            .gtIfPresent("${column.columnName}", reqVO.get${JavaField}())
-#end
-#if (${column.listOperationCondition} == ">=")##情况四,>= 的时候
-            .geIfPresent("${column.columnName}", reqVO.get${JavaField}())
-#end
-#if (${column.listOperationCondition} == "<")##情况五,< 的时候
-            .gtIfPresent("${column.columnName}", reqVO.get${JavaField}())
-#end
-#if (${column.listOperationCondition} == "LIKE")##情况七,Like 的时候
-            .likeIfPresent("${column.columnName}", reqVO.get${JavaField}())
-#end
-#if (${column.listOperationCondition} == "BETWEEN")##情况八,Between 的时候
-            .betweenIfPresent("${column.columnName}", reqVO.getBegin${JavaField}(), reqVO.getEnd${JavaField}())
-#end
-#end
-#end
+			#listCondition()
+        );
+    }
+
+    default List<${table.className}DO> selectList(${table.className}ExportReqVO reqVO) {
+        return selectList(new QueryWrapperX<${table.className}DO>()
+			#listCondition()
         );
     }
 
diff --git a/src/main/resources/codegen/java/enums/errorcode.vm b/src/main/resources/codegen/java/enums/errorcode.vm
index 099a1d228..94f12df03 100644
--- a/src/main/resources/codegen/java/enums/errorcode.vm
+++ b/src/main/resources/codegen/java/enums/errorcode.vm
@@ -1,2 +1,2 @@
 // ========== ${table.classComment} TODO 补充编号 ==========
-ErrorCode ${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS = new ErrorCode(TODO 补充编号, "${table.classComment}不存在}");
+ErrorCode ${simpleClassName_underlineCase.toUpperCase()}_NOT_EXISTS = new ErrorCode(TODO 补充编号, "${table.classComment}不存在");
diff --git a/src/main/resources/codegen/java/service/service.vm b/src/main/resources/codegen/java/service/service.vm
index efa4bac55..31cba1cca 100644
--- a/src/main/resources/codegen/java/service/service.vm
+++ b/src/main/resources/codegen/java/service/service.vm
@@ -7,10 +7,10 @@ import ${basePackage}.${table.moduleName}.dal.dataobject.${table.businessName}.$
 import ${PageResultClassName};
 
 /**
-* ${table.classComment} Service 接口
-*
-* @author ${table.author}
-*/
+ * ${table.classComment} Service 接口
+ *
+ * @author ${table.author}
+ */
 public interface ${table.className}Service {
 
     /**
@@ -59,4 +59,12 @@ public interface ${table.className}Service {
      */
     PageResult<${table.className}DO> get${simpleClassName}Page(${table.className}PageReqVO pageReqVO);
 
+    /**
+     * 获得${table.classComment}列表, 用于 Excel 导出
+     *
+     * @param exportReqVO 查询条件
+     * @return ${table.classComment}分页
+     */
+    List<${table.className}DO> get${simpleClassName}List(${table.className}ExportReqVO exportReqVO);
+
 }
diff --git a/src/main/resources/codegen/java/service/serviceImpl.vm b/src/main/resources/codegen/java/service/serviceImpl.vm
index 5dd0938ff..29daa80fe 100644
--- a/src/main/resources/codegen/java/service/serviceImpl.vm
+++ b/src/main/resources/codegen/java/service/serviceImpl.vm
@@ -19,10 +19,10 @@ import ${ServiceExceptionUtilClassName};
 import static ${basePackage}.${table.moduleName}.enums.${simpleModuleName_upperFirst}ErrorCodeConstants.*;
 
 /**
-* ${table.classComment} Service 实现类
-*
-* @author ${table.author}
-*/
+ * ${table.classComment} Service 实现类
+ *
+ * @author ${table.author}
+ */
 @Service
 @Validated
 public class ${table.className}ServiceImpl implements ${table.className}Service {
@@ -77,4 +77,9 @@ public class ${table.className}ServiceImpl implements ${table.className}Service
 		return ${classNameVar}Mapper.selectPage(pageReqVO);
     }
 
+    @Override
+    public List<${table.className}DO> get${simpleClassName}List(${table.className}ExportReqVO exportReqVO) {
+		return ${classNameVar}Mapper.selectList(exportReqVO);
+    }
+
 }