转载自: MyBatis-plus中的Page出现返回total总为0的问题
最近发现好多人出现使用插件后,分页的参数有问题,总结使用MyBatis-plus 插件,出现page total 为0的情况
1:设置断言mysql
- @Configuration
- public class MybatisPlusConfig {
- /**
- * mybatis-plus分页插件
- */
- @Bean
- public PaginationInterceptor paginationInterceptor() {
- PaginationInterceptor page = new PaginationInterceptor();
- page.setDialectType("mysql");
- return page;
- }
- }
2:mysql 脚本语句 关联查询,出现关联表的id 都为id ,没有进行区分。
- 此处就不粘贴代码,如果有不清楚的,或者其他情况,在下方留言。