SpringBoot分页插件PageHelper

论坛 期权论坛 脚本     
匿名技术用户   2021-1-4 01:28   11   0

欢迎微信扫小程序码进入共同学习成长

1:添加pom文件依赖

<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>

2.配置application.yml

# 分页配置
pagehelper:
helper-dialect: mysql
reasonable: true
support-methods-arguments: true
params: count=countSql

3:使用

PageHelper.startPage(pageNum, pageSize);
List list= service.getList();
PageInfo pageInfo= new PageInfo<>(list);
分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP