MyBatis 使用PageHelper分页不起作用


springboot坏境下使用PageHelper不起作用

PageHelper.startPage(pageNo,pageSize);

上面语句跟随的mapper查出来的总是所有数据,并没有分页。

排查之后发现问题出在pom文件依赖错了,springboot坏境要用

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <version>{springbootPageHelper.version}</version>
</dependency>

而不是原来的

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>{pagehelper.version}</version>
</dependency>

因为上面的依赖缺少了

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
</dependency>

 


免责声明!

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



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