mybatis專案升級到mybatis-plus專案
阿新 • • 發佈:2020-09-10
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(); } }