我的没有分页效果
@ApiOperation("后台管理员查看商品列表") @PostMapping("/admin/product/listProductForAdmin") public ApiResponseObj listProductForAdmin(@RequestParam Integer pageNum,@RequestParam Integer pageSize) throws MallExeception { PageInfo pageInfo = productService.listProductForAdmin(pageNum, pageNum); return ApiResponseObj.success(pageInfo); }
List<Product> listProductForAdmin();
<select id="listProductForAdmin" resultMap="BaseResultMap"> select <include refid="Base_Column_List"></include> from imooc_mall_product order by update_time desc </select>
@Override public PageInfo listProductForAdmin(Integer pageNum, Integer pageSize){ PageHelper.startPage(pageNum,pageSize); List<Product> products = productMapper.listProductForAdmin(); PageInfo<Product> pageInfo = new PageInfo<>(products); return pageInfo; }
相关截图:
结果就每次都是1条
10
收起
正在回答 回答被采纳积分+1
1回答
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星