项目使用mubits-plus,发现分页查询查询一直不生效
解决方法:
添加监听器,配置如下:
@Configuration
@MapperScan("com.zhou.mapper")
public class MybatisPlusConfig {
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
interceptor.addInnerInterceptor(new OptimisticLockerInnerInterceptor());
return interceptor;
}
}
文章讲述了在项目中使用mubits-plus时遇到分页查询不生效的问题,通过在MybatisPlusConfig中添加自定义的监听器,特别是PaginationInnerInterceptor和OptimisticLockerInnerInterceptor,解决了这一问题。
2384

被折叠的 条评论
为什么被折叠?



