海康区域监控点添加total

This commit is contained in:
punchhhh 2025-01-26 14:14:57 +08:00
parent e9cf599dcf
commit fed667d49c
3 changed files with 7 additions and 1 deletions

View File

@ -19,6 +19,8 @@ public class RegionCameraListDTO {
private Integer leaf; private Integer leaf;
@Schema(description = "子区域") @Schema(description = "子区域")
private List<RegionCameraListDTO> children = new ArrayList<>(); private List<RegionCameraListDTO> children = new ArrayList<>();
@Schema(description = "查询数量")
private Long total;
@Schema(description = "摄像头列表") @Schema(description = "摄像头列表")
private List<CameraDTO> cameraList = new ArrayList<>(); private List<CameraDTO> cameraList = new ArrayList<>();
} }

View File

@ -20,6 +20,8 @@ public class RegionCameraListDTO {
private Integer leaf; private Integer leaf;
@Schema(description = "子区域") @Schema(description = "子区域")
private List<RegionCameraListDTO> children = new ArrayList<>(); private List<RegionCameraListDTO> children = new ArrayList<>();
@Schema(description = "查询数量")
private Long total;
@Schema(description = "摄像头列表") @Schema(description = "摄像头列表")
private List<CameraDTO> cameraList = new ArrayList<>(); private List<CameraDTO> cameraList = new ArrayList<>();
} }

View File

@ -114,12 +114,14 @@ public class RegionServiceImpl implements RegionService {
temp.setRegionName(regionDO.getName()); temp.setRegionName(regionDO.getName());
temp.setParentIndexCode(regionDO.getParentIndexCode()); temp.setParentIndexCode(regionDO.getParentIndexCode());
temp.setLeaf(regionDO.getLeaf()); temp.setLeaf(regionDO.getLeaf());
System.out.println("regionDO.getLeaf(): " + regionDO.getLeaf() + " temp.getLeaf(): " + temp.getLeaf()); // System.out.println("regionDO.getLeaf(): " + regionDO.getLeaf() + " temp.getLeaf(): " + temp.getLeaf());
if(temp.getLeaf() == 1) { if(temp.getLeaf() == 1) {
cameraMapper.selectCameraByRegionIndexCodeAndCameraNamePage(temp.getRegionIndexCode(), cameraName, start, pageSize).forEach(cameraDO -> { cameraMapper.selectCameraByRegionIndexCodeAndCameraNamePage(temp.getRegionIndexCode(), cameraName, start, pageSize).forEach(cameraDO -> {
temp.getCameraList().add(BeanUtils.toBean(cameraDO, CameraDTO.class)); temp.getCameraList().add(BeanUtils.toBean(cameraDO, CameraDTO.class));
temp.setTotal(cameraMapper.selectCameraByRegionIndexCodeAndCameraNameTotal(temp.getRegionIndexCode(), cameraName));
}); });
} }
// System.out.println(temp.getRegionName() +"----::::::total:::::---"+ temp.getTotal());
regions.add(temp); regions.add(temp);
regionMap.put(regionDO.getIndexCode(), temp); regionMap.put(regionDO.getIndexCode(), temp);
} }