分页写法2

    @Operation(summary = "分页查询" , description = "分页查询" )
    @GetMapping("/page" )
    public R getcmsArticlePage(Page page, CmsArticle cmsArticle) {
        LambdaQueryWrapper<CmsArticle> wrapper = Wrappers.lambdaQuery();
		wrapper.eq(ObjUtil.isNotNull(cmsArticle.getArticleCategoryId()),CmsArticle::getArticleCategoryId,cmsArticle.getArticleCategoryId());
		wrapper.like(StrUtil.isNotBlank(cmsArticle.getTitle()),CmsArticle::getTitle,cmsArticle.getTitle());

		List<OrderItem> lst = new ArrayList<>();
		OrderItem oItem = new OrderItem();
		lst.add(oItem);
		page.setOrders(lst);

        return R.ok(cmsArticleService.page(page, wrapper));

    }

https://zhuanlan.zhihu.com/p/383819664

https://blog.csdn.net/HanaBiiiiii/article/details/122330548

posted @ 2023-12-19 14:17  寒冷的雨呢  阅读(71)  评论(0编辑  收藏  举报