1、添加如下配置文件
importorg.springframework.context.annotation.Bean; importorg.springframework.context.annotation.Configuration; importcom.baomidou.mybatisplus.plugins.PaginationInterceptor; publicclassMybatisPlusConfig { /*** mybatis-plus分页插件*/publicPaginationInterceptorpaginationInterceptor() { PaginationInterceptorpage=newPaginationInterceptor(); page.setDialectType("mysql"); returnpage; } }
2、去掉 pom.xml 中的 pagehelper 插件
<dependency><groupId>com.github.pagehelper</groupId><artifactId>pagehelper-spring-boot-starter</artifactId><version>1.2.3</version></dependency>