分页工具
- 导包
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
- 配置 yaml
# 指定数据库
pagehelper:
helper‐dialect: mysql
- 操作
调用
@Test
public void testPageHelper() {
// 当前页何页容量
PageHelper.startPage(1, 2);
Page<CourseBase> courseList = courseMapper.findCourseList();
// 列表数据
List<CourseBase> list = courseList.getResult();
// 根据api自行调用其他数据
// 自行写一个查的sql
}

2265

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



