git
https://github.com/haohongyaocom/bootdemo
依赖,要用springboot的
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
spring配置
#pagehelper分页插件配置
pagehelper.helperDialect=mysql
pagehelper.reasonable=true
pagehelper.supportMethodsArguments=true
pagehelper.params=count=countSql
code
UserInfoExample example = new UserInfoExample();
PageHelper.startPage(start,offset);
List<UserInfo> userInfos = userInfoMapper.selectByExample(example);
PageInfo<UserInfo> pageInfo = new PageInfo<>(userInfos);