| | |
| | | if (zoneId == null) { |
| | | return Collections.emptyList(); |
| | | } |
| | | // 防区不存在时直接返回空结果 |
| | | Integer exists = baseMapper.selectDefenseZoneExists(zoneId); |
| | | if (exists == null || exists == 0) { |
| | | return null; |
| | |
| | | if (records == null || records.isEmpty()) { |
| | | return; |
| | | } |
| | | // 组装防区-场景-区域-设备的统计链路 |
| | | Set<Long> sceneIdSet = new HashSet<>(); |
| | | Map<Long, List<Long>> zoneSceneMap = new HashMap<>(); |
| | | for (FwDefenseZoneVO record : records) { |
| | |
| | | } |
| | | Map<Long, List<Long>> areaDeviceMap = new HashMap<>(); |
| | | if (!sceneAreaIdSet.isEmpty()) { |
| | | // 预加载区域关联的设备ID集合 |
| | | List<FwAreaDivideEntity> areaList = fwAreaDivideService.listByIds(sceneAreaIdSet); |
| | | for (FwAreaDivideEntity area : areaList) { |
| | | if (area == null || area.getId() == null) { |