1:pom添加依赖
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
2:添加配置
mybatis:
mapper-locations: classpath:mapper/*.xml
pagehelper:
# 指定数据库类型
helper-dialect: mysql
# pageNum < 1会查询第一页,pageNum > pages 会查询最后一页,
# 当pegeNum一直大于pages时会一直加载最后一夜数据这样影响前端数据,建议关闭
reasonable: false
params: count=countSql
support-methods-arguments: true