springboot使用PageHepler
maven
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
配置
#pagehelper分页插件配置 pagehelper.helperDialect=mysql
使用
public List<User> list(Integer num){
PageHelper.startPage(1,num);//开启分页功能,会在拦截器链中添加分页功能的拦截器
return this.userMapper.selectAll();
}
浙公网安备 33010602011771号