Search in sources :

Example 1 with SysContentEntity

use of com.jun.plugin.system.entity.SysContentEntity in project jun_springboot_api_service by wujun728.

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);
}
Also used : Page(com.baomidou.mybatisplus.extension.plugins.pagination.Page) IPage(com.baomidou.mybatisplus.core.metadata.IPage) SysContentEntity(com.jun.plugin.system.entity.SysContentEntity) RequiresPermissions(org.apache.shiro.authz.annotation.RequiresPermissions) DataScope(com.jun.plugin.system.common.aop.annotation.DataScope) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

IPage (com.baomidou.mybatisplus.core.metadata.IPage)1 Page (com.baomidou.mybatisplus.extension.plugins.pagination.Page)1 DataScope (com.jun.plugin.system.common.aop.annotation.DataScope)1 SysContentEntity (com.jun.plugin.system.entity.SysContentEntity)1 ApiOperation (io.swagger.annotations.ApiOperation)1 RequiresPermissions (org.apache.shiro.authz.annotation.RequiresPermissions)1