springboot集成mybatisplus,进行分页查询selectPage返回total为0

springboot集成mybatisplus,进行分页查询selectPage返回total为0。可以尝试如下解决方案:

 

1.添加如下配置文件


package com.hrhs;
 
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
 
import com.baomidou.mybatisplus.plugins.PaginationInterceptor;
 
@Configuration
public class MybatisPlusConfig {
	 /**
     *   mybatis-plus分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor page = new PaginationInterceptor();
        page.setDialectType("mysql");
        return page;
    }

}

2.去掉pom.xml中的pagehelper插件


			com.github.pagehelper
			pagehelper-spring-boot-starter
			1.2.3
		

 

你可能感兴趣的:(springboot集成mybatisplus,进行分页查询selectPage返回total为0)