本文共 533 字,大约阅读时间需要 1 分钟。
今天使用pageHelper,发现设置了PageHelper.startPage(page, pageSize);pageSize设置为10,但是结果并没有分页,查处了全部的数据;
问题解决:
原因是mybatis的依赖版本问题,之前配置的是1.0.0版本,这个版本不支持分页拦截
<dependency>
<groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.0.0</version></dependency>
所以修改成1.1.1版本解决问题
org.mybatis.spring.boot mybatis-spring-boot-starter 1.1.1 com.github.pagehelper pagehelper 4.1.6
转载地址:http://ajtbi.baihongyu.com/