diff --git a/src/main/java/com/hisense/monitormanage/controller/Controller.java b/src/main/java/com/hisense/monitormanage/controller/Controller.java index 9c305e6..1cda68a 100644 --- a/src/main/java/com/hisense/monitormanage/controller/Controller.java +++ b/src/main/java/com/hisense/monitormanage/controller/Controller.java @@ -90,7 +90,7 @@ public class Controller { /** - * 查询摄像头 + * 查询所有摄像头 * @param cameraChannel * @return */ @@ -147,13 +147,17 @@ public class Controller { } /** - * 查询所有组织 - * @param cameraOrgan + * 根据parentId查询组织 + * @param parentId * @return */ - @RequestMapping("selectAllOrgan") - public Result selectAllOrgan(CameraOrgan cameraOrgan){ - List organs = cameraOrgenMapper.selectAllOrgan(cameraOrgan); + @RequestMapping("selectSubOrgan") + public Result selectSubOrgan(String parentId){ + if (parentId == null){ + parentId = ""; + } + + List organs = cameraOrgenMapper.selectSubOrgan(parentId); Result success = Result.success(organs); diff --git a/src/main/java/com/hisense/monitormanage/mapper/CameraOrgenMapper.java b/src/main/java/com/hisense/monitormanage/mapper/CameraOrgenMapper.java index f5679a7..84761c2 100644 --- a/src/main/java/com/hisense/monitormanage/mapper/CameraOrgenMapper.java +++ b/src/main/java/com/hisense/monitormanage/mapper/CameraOrgenMapper.java @@ -2,12 +2,13 @@ package com.hisense.monitormanage.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hisense.monitormanage.entity.CameraOrgan; +import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; public interface CameraOrgenMapper extends BaseMapper { - @Select("select * from t_camera_organ") - List selectAllOrgan(CameraOrgan cameraOrgan); + @Select("select * from t_camera_organ where parent_id = #{parentId}") + List selectSubOrgan(@Param("parentId") String parentId); } diff --git a/src/main/java/com/hisense/monitormanage/service/MonitorService.java b/src/main/java/com/hisense/monitormanage/service/MonitorService.java index ab95ddf..ba4a044 100644 --- a/src/main/java/com/hisense/monitormanage/service/MonitorService.java +++ b/src/main/java/com/hisense/monitormanage/service/MonitorService.java @@ -77,7 +77,7 @@ public class MonitorService { static int keepaliveCount = 16; -// @PostConstruct + @PostConstruct public void init(){ String loginUrl = monitorDomain + "/videoService/accounts/authorize";