详细使用

MyBatis分页插件

依赖

  1. <!-- Mybatis分页插件 -->
  2. <dependency>
  3. <groupId>com.github.pagehelper</groupId>
  4. <artifactId>pagehelper-spring-boot-starter</artifactId>
  5. <version>1.2.5</version>
  6. </dependency>

application.yaml配置

pagehelper是顶层!

  1. #可能需要这个
  2. spring:
  3. main:
  4. allow-circular-references: true
  5. #配置分页插件
  6. #pagehelper分页插件
  7. pagehelper:
  8. helperDialect: mysql
  9. reasonable: true
  10. supportMethodsArguments: true
  11. params: count=countSql
  12. auto-runtime-dialect: false