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