1.注释mybatis-starter
添加 mybatis-plus
``` <dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.2</version>
</dependency>
```
2.配置文件mybatis修改为mybatis-puls
mybatis-puls:
mapper-locations:
- classpath*:com/**/mapper/*.xml
- classpath*:mapper/*.xml
3.添加MybatisPlusConfig配置文件
@Configuration
@MapperScan(basePackages = {"com.xxxx.xxxx.mapper"})
@EnableTransactionManagement
public class MybatisPlusConfig {
/**
* 性能分析拦截器,不建议生产使用
*/
// @Bean
// public PerformanceInterceptor performanceInterceptor(){
// return new PerformanceInterceptor();
// }
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
/**
* pagehelper的分页插件
*/
@Bean
public PageInterceptor pageInterceptor() {
return new PageInterceptor();
}
}