|
|
@@ -296,13 +296,25 @@ public class ProtectionServiceImpl extends ServiceImpl<ProtectionMapper, IotAlar
|
|
|
|
|
|
@Override
|
|
|
public int checkExitDevice(Long orgId, Long deviceId) {
|
|
|
- return lambdaQuery()
|
|
|
+ /* LambdaQueryWrapper<IotAlarmSubsystem> wrapper=new LambdaQueryWrapper<>();
|
|
|
+ wrapper.eq(IotAlarmSubsystem::getOrgId,orgId);
|
|
|
+ wrapper.eq(IotAlarmSubsystem::getDeleted,0);
|
|
|
+ final List<IotAlarmSubsystem> subsystemList = baseMapper.selectList(wrapper);
|
|
|
+ if (subsystemList.isEmpty()){
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ final boolean match = subsystemList.stream().anyMatch(r -> ObjectUtil.equal(r.getSource(), 1));
|
|
|
+ if (!match){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ return lambdaQuery()
|
|
|
.eq(IotAlarmSubsystem::getOrgId, orgId)
|
|
|
.ne(ObjectUtil.isNotNull(deviceId), IotAlarmSubsystem::getDeviceId, deviceId)
|
|
|
.eq(IotAlarmSubsystem::getSource, 1)
|
|
|
.eq(IotAlarmSubsystem::getDeleted, 0)
|
|
|
.count()
|
|
|
- .intValue();
|
|
|
+ .intValue();*/
|
|
|
+ return baseMapper.checkExitDevice(orgId,deviceId);
|
|
|
}
|
|
|
|
|
|
@Override
|