PageHelper分页插件Total使用方法
【发现问题】使用PageHelper时total的返回值总是和每页的size一样
1. 错误写法
2. 正确写法
- pom引用
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.4.0</version>
</dependency>
- 配置文件
# PageHelper分页插件
pagehelper:
helperDialect: mysql
supportMethodsArguments: true
params: count=countSql
- 代码编写
3. 原理
git官网issue:https://github.com/pagehelper/pagehelper-spring-boot/issues/21
4. PageHelper相关资料
https://blog.csdn.net/weixin_28766581/article/details/113310185