JAVA小白搞SpringBoot项目,最近很多接口都需要用到分页查询,于是乎想集成下pageHelper,听说是个十分好用的插件,然后开始配置项目依赖
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>5.1.4</version>
</dependency>
application.yaml文件中配置
#pagehelper分页插件
pagehelper:
helperDialect: oracle
reasonable: true
supportMethodsArguments: true
params: count=countSql
贴上代码片段

然后就开始踩坑了,发现不管怎么搞,查询出来都是全量的数据,最终排查了需求原因,才发现是SpringBoot要使用pageHelper的话,需要引入适配Spring Boot包!!!
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.10</version>
</dependency>
引入之后就可以了
1354





