分页写法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));
}
择善人而交,择善书而读,择善言而听,择善行而从。