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