use of com.company.project.common.aop.annotation.DataScope in project springboot-manager by aitangbao.
the class SysContentController method findListByPage.
@ApiOperation(value = "查询分页数据")
@PostMapping("/listByPage")
@RequiresPermissions("sysContent:list")
@DataScope
public DataResult findListByPage(@RequestBody SysContentEntity sysContent) {
Page page = new Page(sysContent.getPage(), sysContent.getLimit());
LambdaQueryWrapper<SysContentEntity> queryWrapper = Wrappers.lambdaQuery();
// 查询条件示例
if (!StringUtils.isEmpty(sysContent.getTitle())) {
queryWrapper.like(SysContentEntity::getTitle, sysContent.getTitle());
}
// 数据权限示例, 需手动添加此条件 begin
if (!CollectionUtils.isEmpty(sysContent.getCreateIds())) {
queryWrapper.in(SysContentEntity::getCreateId, sysContent.getCreateIds());
}
// 数据权限示例, 需手动添加此条件 end
IPage<SysContentEntity> iPage = sysContentService.page(page, queryWrapper);
return DataResult.success(iPage);
}
Aggregations