1 pom.xml中 核对是否引入 分页插件库
<!-- 分页插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>
2 核对 springboot 配置文件中分页插件是否配置 (yml配置如下)
#pagehelper分页插件
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
3 检查分页插件拦截器是否启用
@Configuration
public class MybatisPlusConfig
{
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor page = new PaginationInterceptor();
page.setDialectType("mysql");
return page;
}
}
本文详细介绍了如何在SpringBoot项目中正确配置和使用分页插件,包括在pom.xml中引入分页插件库,配置yml文件中的分页插件参数,以及在代码中启用分页插件拦截器。
1971

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



