Spring boot+Mybatis gradle项目的Pagehelper配置和简单使用
原始的分页需要在sql语句中加入limit num1,num2,还要在后台传递当前页、总页数、总记录数等数据,比较麻烦,所以使用Pagehelper插件来简化分页的工作量,以下写怎么配置使用该插件
build.gradle导入Pagehelper的依赖
compile group: 'com.github.pagehelper', name: 'pagehelper-spring-boot-starter', version: '1.2.7'
配置application.yml文件
pagehelper:
helper-dialect: mysql
# 分页合理化
reasonable: true
#支持通过 Mapper 接口参数来传递分页参数
support-methods-arguments: true
#