From cd3982f1435ac05296120db197664d469604e244 Mon Sep 17 00:00:00 2001
From: whyclxw <http://whyclxw@118.89.139.230:10101/r/~whyclxw/IdeaTest.git>
Date: 星期五, 16 四月 2021 11:19:40 +0800
Subject: [PATCH] 代码生成器

---
 src/test/java/com/example/lxw/GeneratorCode.java |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/test/java/com/example/lxw/GeneratorCode.java b/src/test/java/com/example/lxw/GeneratorCode.java
index 90cd627..9d6c45e 100644
--- a/src/test/java/com/example/lxw/GeneratorCode.java
+++ b/src/test/java/com/example/lxw/GeneratorCode.java
@@ -12,6 +12,8 @@
 import com.baomidou.mybatisplus.generator.config.po.TableFill;
 import com.baomidou.mybatisplus.generator.config.rules.DateType;
 import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
+
 import java.util.ArrayList;
 
 import java.util.ArrayList;
@@ -47,17 +49,17 @@
         mpg.setDataSource(dsc);
         //3、包的配置
         PackageConfig pc = new PackageConfig();
-        pc.setModuleName("blog");
         pc.setParent("com.generator");
-        pc.setEntity("entity");
+        pc.setEntity("pojo");
         pc.setMapper("mapper");
         pc.setService("service");
         pc.setController("controller");
         mpg.setPackageInfo(pc);
         //4、策略配置
         StrategyConfig strategy = new StrategyConfig();
+        strategy.setTablePrefix("tb");
         strategy.setInclude("tb_user_inf","tb_user_battgroup_baojigroup","tb_user_battgroup_baojigroup_battgroup","tb_user_battgroup_baojigroup_usr"); // 设置要映射的表名
-                strategy.setNaming(NamingStrategy.underline_to_camel);
+        strategy.setNaming(NamingStrategy.underline_to_camel);
         strategy.setColumnNaming(NamingStrategy.underline_to_camel);
         strategy.setEntityLombokModel(true); // 自动lombok;
         strategy.setLogicDeleteFieldName("deleted");

--
Gitblit v1.9.1