springboot+MyBatisPlus 自动生成代码

您所在的位置:网站首页 mybatisplus自动生成主键 springboot+MyBatisPlus 自动生成代码

springboot+MyBatisPlus 自动生成代码

2022-05-12 13:00| 来源: 网络整理| 查看: 265

【实例简介】springboot MyBatisPlus 自动生成代码

使用springboot MyBatisPlus,完成对三层代码的生成,并使用Junit测试

【实例截图】

from clipboard

【核心代码】

//2、数据源配置 DataSourceConfig dsc = new DataSourceConfig(); dsc.setUrl("jdbc:mysql://localhost:3306/stu001?useUnicode=true&serverTimezone=GMT&useSSL=false&characterEncoding=utf8"); dsc.setDriverName("com.mysql.jdbc.Driver"); dsc.setUsername("root"); dsc.setPassword("ok"); mpg.setDataSource(dsc);//设置数据源 // 3、包配置 PackageConfig pc = new PackageConfig(); //pc.setModuleName("sys");//设置模型名 pc.setParent("com.zsp.shengcheng"); mpg.setPackageInfo(pc);

. ├── plus │   ├── HELP.md │   ├── README.md │   ├── mvnw │   ├── mvnw.cmd │   ├── plus.iml │   ├── pom.xml │   ├── src │   │   ├── main │   │   │   ├── java │   │   │   │   └── com │   │   │   │       └── sc │   │   │   │           └── plus │   │   │   │               ├── PlusApplication.java │   │   │   │               ├── controller │   │   │   │               │   ├── BankCardController.java │   │   │   │               │   ├── BaseController.java │   │   │   │               │   ├── CardController.java │   │   │   │               │   ├── ScoreController.java │   │   │   │               │   └── SubjectController.java │   │   │   │               ├── entity │   │   │   │               │   ├── BankCard.java │   │   │   │               │   ├── BaseEntity.java │   │   │   │               │   ├── Card.java │   │   │   │               │   ├── Score.java │   │   │   │               │   └── Subject.java │   │   │   │               ├── generator │   │   │   │               │   └── MysqlGenerator.java │   │   │   │               ├── mapper │   │   │   │               │   ├── BankCardMapper.java │   │   │   │               │   ├── CardMapper.java │   │   │   │               │   ├── ScoreMapper.java │   │   │   │               │   ├── SubjectMapper.java │   │   │   │               │   └── xml │   │   │   │               │       ├── BankCardMapper.xml │   │   │   │               │       ├── CardMapper.xml │   │   │   │               │       ├── ScoreMapper.xml │   │   │   │               │       └── SubjectMapper.xml │   │   │   │               └── service │   │   │   │                   ├── BankCardService.java │   │   │   │                   ├── CardService.java │   │   │   │                   ├── ScoreService.java │   │   │   │                   ├── SubjectService.java │   │   │   │                   └── impl │   │   │   │                       ├── BankCardServiceImpl.java │   │   │   │                       ├── CardServiceImpl.java │   │   │   │                       ├── ScoreServiceImpl.java │   │   │   │                       └── SubjectServiceImpl.java │   │   │   └── resources │   │   │       └── application.properties │   │   └── test │   │       └── java │   │           └── com │   │               └── sc │   │                   └── plus │   │                       └── PlusApplicationTests.java │   └── target │       ├── classes │       │   ├── application.properties │       │   └── com │       │       └── sc │       │           └── plus │       │               ├── PlusApplication.class │       │               ├── controller │       │               │   └── BaseController.class │       │               ├── entity │       │               │   └── BaseEntity.class │       │               └── generator │       │                   └── MysqlGenerator.class │       ├── generated-sources │       │   └── annotations │       ├── generated-test-sources │       │   └── test-annotations │       └── test-classes │           └── com │               └── sc │                   └── plus │                       └── PlusApplicationTests.class └── 好例子网_mybatisPlus代码生成.rar 36 directories, 43 files



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3