分页器无法使用可能的原因
依赖中添加的 分页器插件的版本过低
依赖
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.3</version>
</dependency>
properties文件中加
#用于分页
pagehelper.helper-dialect=mysql
pagehelper.params=count=countSql
pagehelper.reasonable=true
pagehelper.support-methods-arguments=true
control 写法
@PostMapping(value = "/list")
public Result getall(int pageLndex, int pageSize, String name, String userCode) {
PageHelper.startPage(pageLndex,pageSize);
List<ycxxx> list=ycxxxservice.getAll();
PageInfo<ycxxx> pageInfo=new PageInfo<>(list);
Result result=new Result();
result.put("data",pageInfo);
result.put("errno",-1);
return result;
}