pageHelper使用时的注意点


 

1 在pom.xml中导入相关的依赖(注意版本问题,报错十有八九是因为版本问题)

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

2 在yml配置文件中输入相关配置

pagehelper:
  helper-dialect: mysql
  reasonable: true
  support-methods-arguments: true
  params: count=countSql

3 使用 (个人推荐返回值为PageHelper方式)

3.1 返回page对象(注意,查询语句必须紧跟着pagehelper语句,否则会报错。 )

返回的为需要查询的数据集合

3.2 返回pagehelper对象

返回的值为需要查询的数据集合以及一系列分页信息

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM