1、创建Module

Spring Boot 23——整合MyBatis注解版

2、pom.xml引入druid依赖,配置数据源,见上一节

3、创建实体类

Spring Boot 23——整合MyBatis注解版

4、创建Mapper

Spring Boot 23——整合MyBatis注解版

注意:注释@Mapper是为了自动装配com.cyz.boot.mapper包下所有注解mapper

Spring Boot 23——整合MyBatis注解版

5、创建实例测试

Spring Boot 23——整合MyBatis注解版

6、自定义MyBatis配置类,替代MyBatis配置文件(开启驼峰模式,数据库字段is_del自动转成isDel)

Spring Boot 23——整合MyBatis注解版

相关文章:

  • 2021-12-28
  • 2021-12-11
  • 2021-09-21
  • 2021-09-08
  • 2021-09-27
  • 2021-11-03
  • 2021-12-13
猜你喜欢
  • 2021-10-07
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-21
相关资源
相似解决方案