springboot版本
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
按照正常的代码:
PageHelper.startPage(pageNum,4);
WechatAccountExample example = new WechatAccountExample();
List<WechatAccount> accounts = wechatAccountMapper.selectByExample(example);
PageInfo<WechatAccount> pageInfo = new PageInfo<>(accounts);
return pageInfo;
pagehelper配置
#pagehelper分页插件配置
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSqle
pom依赖
<!--分页插件-->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>4.1.0</version>
</dependency>
结果查出来还是没暖用,全部给查出来了。后来查了很多博客有人说加上
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-autoconfigure</artifactId>
<version>1.2.5</version>
</dependency>
还是没用,有人说用一个依赖就行了,
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
还是不行!!!!!
无意中把版本改为了1.2.10,妈的出来了。
记录一下。。。