MyBatis-Plus3.5.2版本分页插件不生效问题解决

解决问题代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

@EnableTransactionManagement
@Configuration
@MapperScan("com.framework.fs.mapper")
public class MyBatisPlusConfig {
/**
* 分页插件
*/
@Bean
public PaginationInnerInterceptor paginationInterceptor() {
PaginationInnerInterceptor page = new PaginationInnerInterceptor();
page.setMaxLimit(-1L);
page.setDbType(DbType.MYSQL);
page.setOptimizeJoin(true);
return page;
}

@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor(){
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
mybatisPlusInterceptor.setInterceptors(Collections.singletonList(paginationInterceptor()));
return mybatisPlusInterceptor;
}


}

文章目录