| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer deviceDeleteIdOrFather(Integer id, String deviceFather) { |
| | | public Integer deviceDeleteIdOrFather(Integer id, Integer type, String deviceFather) { |
| | | LambdaUpdateWrapper<Device> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(Device::getState, 0); |
| | | if (id != null) { |
| | | if (id == null && deviceFather == null) { |
| | | return 0; |
| | | } else if (id != null) { |
| | | updateWrapper.eq(Device::getId, id); |
| | | } else if (deviceFather != null) { |
| | | updateWrapper.eq(Device::getType, type); |
| | | updateWrapper.eq(Device::getFather, deviceFather); |
| | | } |
| | | return deviceMapper.update(new Device(), updateWrapper); |
| | |
| | | public List<Map<String, Object>> getDeviceNameByGroup(String deviceGroup) { |
| | | return deviceMapper.getDeviceNameByGroup(deviceGroup); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectDeviceIdAndName() { |
| | | LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.select(Device::getId, Device::getName, Device::getCode); |
| | | return deviceMapper.selectMaps(wrapper); |
| | | } |
| | | } |