1、pom文件引用
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>RELEASE</version>
</dependency>
2、代码实现
//在返回的list前面设置分页
//注意前后顺序
PageHelper.startPage(1, 10);
//查询list
List<GoodsCats> list = goodsCatsService.selectList(entityWrapper);
//设置分页
PageInfo<GoodsCats> pageInfo = new PageInfo<>(list);