| | |
| | | import com.baomidou.mybatisplus.core.toolkit.StringPool; |
| | | import com.baomidou.mybatisplus.generator.AutoGenerator; |
| | | import com.baomidou.mybatisplus.generator.InjectionConfig; |
| | | import com.baomidou.mybatisplus.generator.config.*; |
| | | import com.baomidou.mybatisplus.generator.config.DataSourceConfig; |
| | | import com.baomidou.mybatisplus.generator.config.FileOutConfig; |
| | | import com.baomidou.mybatisplus.generator.config.GlobalConfig; |
| | | import com.baomidou.mybatisplus.generator.config.PackageConfig; |
| | | import com.baomidou.mybatisplus.generator.config.StrategyConfig; |
| | | import com.baomidou.mybatisplus.generator.config.TemplateConfig; |
| | | import com.baomidou.mybatisplus.generator.config.po.LikeTable; |
| | | import com.baomidou.mybatisplus.generator.config.po.TableFill; |
| | | import com.baomidou.mybatisplus.generator.config.po.TableInfo; |
| | | import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy; |
| | | import org.junit.Test; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.junit.Test; |
| | | |
| | | /** |
| | | * 通过指定 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) 可达到加速的效果。 |
| | |
| | | pc.setMapper("mapper"); |
| | | pc.setService("service"); |
| | | |
| | | |
| | | // 自定义mapping文件生成路径配置 |
| | | InjectionConfig cfg = new InjectionConfig() { |
| | | @Override |
| | |
| | | //templateConfig.setController(null); |
| | | //mpg.setTemplate(templateConfig); |
| | | |
| | | |
| | | // 策略配置 |
| | | StrategyConfig strategy = new StrategyConfig(); |
| | | //设置字段和表名的是否把下划线完成驼峰命名规则 |
| | | strategy.setNaming(NamingStrategy.underline_to_camel); |
| | | strategy.setEntitySerialVersionUID(true); |
| | | strategy.setEntityColumnConstant(false); |
| | | |
| | | |
| | | //设置生成的实体类继承的父类 |
| | | // strategy.setSuperEntityClass(BaseModel.class); |
| | |
| | | // strategy.setTablePrefix(pc.getModuleName() + ""); |
| | | // strategy.setLikeTable(new LikeTable("room")); |
| | | //strategy.setLikeTable(new LikeTable("member")); |
| | | strategy.setLikeTable(new LikeTable("tb_basic_data_config"));// 生成表名 |
| | | strategy.setLikeTable(new LikeTable("tb_data_screen_score"));// 生成表名 |
| | | // strategy.setLikeTable(new LikeTable("t_hotel"));// 生成表名 |
| | | // strategy.setLikeTable(new LikeTable("t_scan_message"));// 生成表名 |
| | | // strategy.setNotLikeTable(new LikeTable("tb_dept"));// 不生成表名 |