转载自: MyBatis-plus中的Page出现返回total总为0的问题

最近发现好多人出现使用插件后,分页的参数有问题,总结使用MyBatis-plus  插件,出现page total 为0的情况

1:设置断言mysql

  1. @Configuration
  2. public class MybatisPlusConfig {
  3. /**
  4. *   mybatis-plus分页插件
  5. */
  6. @Bean
  7. public PaginationInterceptor paginationInterceptor() {
  8. PaginationInterceptor page = new PaginationInterceptor();
  9. page.setDialectType("mysql");
  10. return page;
  11. }
  12. }

2:mysql 脚本语句 关联查询,出现关联表的id 都为id ,没有进行区分。

  1. 此处就不粘贴代码,如果有不清楚的,或者其他情况,在下方留言。