|
@@ -2,8 +2,10 @@ package com.fdkankan.generate;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
|
|
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
|
|
|
|
+import com.baomidou.mybatisplus.generator.config.OutputFile;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Collections;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
public class AutoGenerate {
|
|
public class AutoGenerate {
|
|
@@ -13,7 +15,7 @@ public class AutoGenerate {
|
|
String path ="H:\\project\\4dkankan-parent\\4dkankan-center-platform";
|
|
String path ="H:\\project\\4dkankan-parent\\4dkankan-center-platform";
|
|
List<String> tables = new ArrayList<>();
|
|
List<String> tables = new ArrayList<>();
|
|
tables.add("t_agent");
|
|
tables.add("t_agent");
|
|
-
|
|
|
|
|
|
+ String moduleName ="test";
|
|
FastAutoGenerator.create("jdbc:mysql://localhost:3306/4dkankan_center_application",
|
|
FastAutoGenerator.create("jdbc:mysql://localhost:3306/4dkankan_center_application",
|
|
"root","123456")
|
|
"root","123456")
|
|
.globalConfig(builder -> {
|
|
.globalConfig(builder -> {
|
|
@@ -26,14 +28,14 @@ public class AutoGenerate {
|
|
})
|
|
})
|
|
.packageConfig(builder -> {
|
|
.packageConfig(builder -> {
|
|
builder.parent("com.fdkankan")
|
|
builder.parent("com.fdkankan")
|
|
- .moduleName("test")
|
|
|
|
|
|
+ .moduleName(moduleName)
|
|
.entity("entity")
|
|
.entity("entity")
|
|
.service("service")
|
|
.service("service")
|
|
.serviceImpl("service.impl")
|
|
.serviceImpl("service.impl")
|
|
.controller("controller")
|
|
.controller("controller")
|
|
.mapper("mapper")
|
|
.mapper("mapper")
|
|
- .xml("mapper.xml");
|
|
|
|
- //.pathInfo(Collections.singletonMap(OutputFile.mapperXml,path+"\\src\\main\\resources\\mapper"));
|
|
|
|
|
|
+ .xml("test.mapper")
|
|
|
|
+ .pathInfo(Collections.singletonMap(OutputFile.mapperXml,path+"\\src\\main\\resources\\mapper\\"+moduleName));
|
|
})
|
|
})
|
|
.strategyConfig(builder -> {
|
|
.strategyConfig(builder -> {
|
|
builder.addInclude(tables)
|
|
builder.addInclude(tables)
|