// 分页插件声明, 旧版本是:setLimit
@Bean
public PaginationInnerInterceptor paginationInnerInterceptor(){
PaginationInnerInterceptor page = new PaginationInnerInterceptor();
page.setDbType(DbType.MYSQL);
page.setMaxLimit(Long.parseLong("-1"));
return page;
}
// 添加拦截器
MybatisSqlSessionFactoryBean sqlSessionFactory = new MybatisSqlSessionFactoryBean();
// plugins
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
mybatisPlusInterceptor.addInnerInterceptor(paginationInnerInterceptor());
sqlSessionFactory.setPlugins(new MybatisPlusInterceptor[] {
mybatisPlusInterceptor
});
取消mybatis plus默认分页500限制
最新推荐文章于 2024-06-23 23:27:23 发布
关键词由CSDN通过智能技术生成