101captain
2022-01-14 dad5e5fd2abbf5d77d23f1b9a4500a9ae9bf274d
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java
@@ -6,6 +6,7 @@
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.BeanUtils;
@@ -108,8 +109,13 @@
     * @return 角色集合
     */
    @Override
    public R listRoleBackstage(Long communityId,Integer pageNum,Integer pageSize) {
        IPage<SysRoleDO> sysRoleDOIPage=this.roleDAO.selectPage(new Page<>(pageNum,pageSize),new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getCommunityId, communityId).orderByDesc(SysRoleDO::getCreateAt));
    public R listRoleBackstage(Long communityId,Integer pageNum,Integer pageSize,String areaCode) {
        LambdaQueryWrapper<SysRoleDO> queryWrapper=new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getCommunityId, communityId);
        if(com.panzhihua.common.utlis.StringUtils.isNotEmpty(areaCode)){
            queryWrapper.eq(SysRoleDO::getAreaCode,areaCode);
        }
        queryWrapper.orderByDesc(SysRoleDO::getCreateAt);
        IPage<SysRoleDO> sysRoleDOIPage=this.roleDAO.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
        if (ObjectUtils.isEmpty(sysRoleDOIPage.getRecords())) {
            return R.fail("角色列表为空");
        }