java spring boot 随笔

使用Mybatis-Plus分页插件进行分页 getTotal、getPages 获取值为0 的解决办法

在mybatisConfig 配置文件中增加

@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
  MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
  interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
  return interceptor;
}

 

posted @ 2021-09-11 16:00  好久没找你聊天了  阅读(23)  评论(0编辑  收藏  举报