From 244599f81767cf3324deef60cf2b4b56418b9977 Mon Sep 17 00:00:00 2001 From: wuweida <2918581207@qq.com> Date: Mon, 9 May 2022 11:34:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AEparentId=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=BB=84=E7=BB=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitormanage/controller/Controller.java | 16 ++++++++++------ .../monitormanage/mapper/CameraOrgenMapper.java | 5 +++-- .../monitormanage/service/MonitorService.java | 2 +- 3 files changed, 14 insertions(+), 9 deletions(-) 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";