根据parentId查询所有组织

This commit is contained in:
wuweida 2022-05-09 11:34:11 +08:00
parent aac56928dd
commit 244599f817
3 changed files with 14 additions and 9 deletions

View File

@ -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<CameraOrgan> organs = cameraOrgenMapper.selectAllOrgan(cameraOrgan);
@RequestMapping("selectSubOrgan")
public Result selectSubOrgan(String parentId){
if (parentId == null){
parentId = "";
}
List<CameraOrgan> organs = cameraOrgenMapper.selectSubOrgan(parentId);
Result success = Result.success(organs);

View File

@ -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<CameraOrgan> {
@Select("select * from t_camera_organ")
List<CameraOrgan> selectAllOrgan(CameraOrgan cameraOrgan);
@Select("select * from t_camera_organ where parent_id = #{parentId}")
List<CameraOrgan> selectSubOrgan(@Param("parentId") String parentId);
}

View File

@ -77,7 +77,7 @@ public class MonitorService {
static int keepaliveCount = 16;
// @PostConstruct
@PostConstruct
public void init(){
String loginUrl = monitorDomain + "/videoService/accounts/authorize";