查询分页列表

由于mybatis-plus升级版本后,自带的分页功能有bug,所以分页还是建议使用PageHelper的startPage方法。

  • Controller继承BaseController
  • 接口返回类型为TableDataInfo<T>
  • 接口第一行写上startPage
  • 接口返回时,使用PageUtils.buildDataInfo封装一下
    @GetMapping("/list")
    public TableDataInfo<BmStoreRoomVo> list(@Validated(QueryGroup.class) BmStoreRoomBo bo) {
        startPage();
        List<BmStoreRoomVo> list = iBmStoreRoomService.queryList(bo);
        return PageUtils.buildDataInfo((list));
    }
posted @ 2023-02-26 16:39  程序员曾奈斯  阅读(44)  评论(0)    收藏  举报