MybatisPlusCodeGenerator.java
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
package com.bs.reception.utils;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.util.Collections;
*/
/**
* <pre>
* mybatis-plus code generator
* generator file include:
* - entity
* - mapper
* - service
* - controller
* - mapper.xml
* </pre>
* @author yangwei
* @version 1.0
* @since 2025/11/21 18:10
*//*
public final class MybatisPlusCodeGenerator {
public static void main(String[] args) {
FastAutoGenerator.create("jdbc:mysql://192.168.2.12:3306/lw-cloud?characterEncoding=utf-8&userSSL=false", "root", "glsx1208")
.globalConfig(builder -> {
// 设置作者
builder.author("zhouhb")
// 开启 swagger 模式
// .enableSwagger()
// 覆盖已生成文件
.fileOverride()
// 指定输出目录
.outputDir("F:\\360MoveData\\Users\\11\\Desktop\\企微SAAS\\2025\\link\\link-wechat\\linkwe-reception\\src\\main\\java");
})
.packageConfig(builder -> {
// 设置父包名
builder.parent("com.bs")
// 设置父包模块名
.moduleName("reception")
// 设置mapperXml生成路径
.pathInfo(Collections.singletonMap(OutputFile.mapperXml, "F:\\360MoveData\\Users\\11\\Desktop\\企微SAAS\\2025\\link\\link-wechat\\linkwe-reception\\src\\main\\java"));
})
.strategyConfig(builder -> {
// 设置需要生成的表名
builder.addInclude("recording_model_tem_config")
// 设置过滤表前缀
.addTablePrefix("t_", "c_");
})
// 使用Freemarker引擎模板,默认的是Velocity引擎模板
.templateEngine(new FreemarkerTemplateEngine())
.execute();
}
}
*/