Mybatis-Plus分頁查詢返回total為0解決


一、創建一個類注入PaginationInterceptor

  1.  
    @Configuration
  2.  
    public class MybatisPlusConfig {
  3.  
     
  4.  
    /**
  5.  
    * 分頁插件
  6.  
    */
  7.  
    @Bean
  8.  
    public PaginationInterceptor paginationInterceptor() {
  9.  
    return new PaginationInterceptor();
  10.  
    }
  11.  
    }

二、去除pom.xml中的pagehelper的jar包

  1.  
    <dependency>
  2.  
    <groupId>com.github.pagehelper</groupId>
  3.  
    <artifactId>pagehelper-spring-boot-starter</artifactId>
  4.  
    <version>1.2.3</version>
  5.  
    </dependency>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM