| | |
| | | // 演示例子,执行 main 方法控制台输入模块表名回车自动生成对应项目目录中 |
| | | public class CodeGenerator { |
| | | |
| | | public static String database_url = "jdbc:mysql://localhost:3306/center-lims?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8"; |
| | | public static String database_url = "jdbc:mysql://10.1.200.86:3306/center-lims?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8"; |
| | | public static String database_username = "root"; |
| | | public static String database_password= "123456"; |
| | | public static String database_password= "zttZTT123!"; |
| | | public static String author = "江苏鵷雏网络科技有限公司"; |
| | | public static String model_name = "/cnas-server"; // 如果为分布式填子模块名称,如果不是分布式为空即可 |
| | | public static String setParent = "com.yuanchu.mom"; // 包路径 |
| | | public static String tablePrefix = "device_"; // 设置过滤表前缀 |
| | | public static void main(String[] args) { |
| | | String projectPath = System.getProperty("user.dir"); |
| | | FastAutoGenerator.create(database_url, database_username, database_password) |
| | |
| | | // 策略配置 |
| | | .strategyConfig(builder -> { |
| | | builder.addInclude(scanner("表名,多个空格分割").split(" ")) // 设置需要生成的表名 |
| | | .addTablePrefix("sys_") // 设置过滤表前缀 |
| | | .addTablePrefix(tablePrefix) // 设置过滤表前缀 |
| | | // Entity 策略配置 |
| | | .entityBuilder() |
| | | .enableLombok() //开启 Lombok |