| | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | IPage<DeviceRole> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<DeviceRole> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | pageWrap.getModel().setIsdeleted(Constants.ZERO); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(DeviceRole::getId, pageWrap.getModel().getId()); |
| | | } |
| | |
| | | if (StringUtils.isNotBlank(pageWrap.getModel().getType())) { |
| | | if(pageWrap.getModel().getType().length() > 1) { |
| | | String[] types = pageWrap.getModel().getType().split(","); |
| | | queryWrapper.lambda() |
| | | .eq(DeviceRole::getType, types[0]) |
| | | queryWrapper.lambda().and(p-> p.eq(DeviceRole::getType, types[0]) |
| | | .or() |
| | | .eq(DeviceRole::getType, types[1]); |
| | | .eq(DeviceRole::getType, types[1])); |
| | | }else { |
| | | queryWrapper.lambda().eq(DeviceRole::getType, pageWrap.getModel().getType()); |
| | | } |
| | |
| | | List<DeviceRole> deviceRoleList = deviceRoleMapper.selectList(new QueryWrapper<DeviceRole>().lambda() |
| | | .eq(DeviceRole::getType,type) |
| | | .eq(DeviceRole::getIsdeleted, Constants.ZERO) |
| | | .eq(DeviceRole::getStatus, Constants.ZERO) |
| | | .eq(DeviceRole::getStatus, Constants.ONE) |
| | | ); |
| | | List<DeviceRoleVO> deviceRoleVOList = new ArrayList<>(); |
| | | for (DeviceRole deviceRole:deviceRoleList) { |