1、引入mybatis-plus坐标
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.2.0</version>
</dependency>
2、配置数据源
spring:
datasource:
username: root
password: root
url: jdbc://192.168.5.1:3306/admin?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
driver-class-name: com.mysql.cj.jdbc.Driver
3、开启Mapper扫描
使用@MapperScan
开启mapper扫描,指定需要扫描的mapper位置
4、指定Mapper.xml所在的文件的位置
mybatis-plus:
mapper-locations: classpath*:/mapper/**/*.xml
标签:xml,mapper,MybatisPlus,Springboot,扫描,plus,整合,mybatis
From: https://www.cnblogs.com/ccblblog/p/17908464.html