فهرست منبع

设备树带参数

lchao 6 روز پیش
والد
کامیت
ba285ddb4d

+ 11 - 0
src/main/java/com/sooka/sponest/monitor/camera/controller/CentermonitorTCameraController.java

@@ -790,6 +790,17 @@ public class CentermonitorTCameraController extends BaseController {
     public AjaxResult getDeviceTree() {
         return AjaxResult.success(centermonitorTCameraService.selectDeviceTreeData());
     }
+    
+    /**
+     * 根据标签ID获取设备树数据
+     * 包含摄像头主表信息和关联的通道信息
+     */
+    @ApiOperation(value = "根据标签ID获取设备树数据", notes = "根据标签ID获取设备树数据,包含摄像头主表信息和关联的通道信息")
+    @Log(title = "设备树", businessType = BusinessType.OTHER)
+    @GetMapping("/getDeviceTreeByLabelId")
+    public AjaxResult getDeviceTreeByLabelId(@RequestParam("labelId") String labelId) {
+        return AjaxResult.success(centermonitorTCameraService.selectDeviceTreeDataByLabelId(labelId));
+    }
 
 }
 

+ 8 - 0
src/main/java/com/sooka/sponest/monitor/camera/mapper/CentermonitorTCameraMapper.java

@@ -358,6 +358,14 @@ public interface CentermonitorTCameraMapper {
      * 包含摄像头主表信息和关联的通道信息
      **/
     List<CentermonitorTCamera> selectDeviceTreeData();
+    
+    /**
+     * 根据标签ID查询设备树数据
+     * 
+     * @param labelId 标签ID
+     * @return 设备树数据
+     */
+    List<CentermonitorTCamera> selectDeviceTreeDataByLabelId(String labelId);
 
     /**
      * 根据cameraCode更新执法仪状态

+ 8 - 0
src/main/java/com/sooka/sponest/monitor/camera/service/ICentermonitorTCameraService.java

@@ -312,6 +312,14 @@ public interface ICentermonitorTCameraService
     List<CentermonitorTCamera> selectDeviceTreeData();
 
     /**
+     * 根据标签ID查询设备树数据
+     * 
+     * @param labelId 标签ID
+     * @return 设备树数据
+     */
+    List<CentermonitorTCamera> selectDeviceTreeDataByLabelId(String labelId);
+
+    /**
      * 视频目录统计
      */
     Map<String, List> getVideoDirectory(Long deptId);

+ 8 - 0
src/main/java/com/sooka/sponest/monitor/camera/service/impl/CentermonitorTCameraServiceImpl.java

@@ -795,6 +795,14 @@ public class CentermonitorTCameraServiceImpl extends BaseService implements ICen
     public List<CentermonitorTCamera> selectDeviceTreeData() {
         return centermonitorTCameraMapper.selectDeviceTreeData();
     }
+    
+    /**
+     * 根据标签ID查询设备树数据
+     */
+    @Override
+    public List<CentermonitorTCamera> selectDeviceTreeDataByLabelId(String labelId) {
+        return centermonitorTCameraMapper.selectDeviceTreeDataByLabelId(labelId);
+    }
 
     @Override
     public Map<String, List> getCameraCallDepartmentLogOneStatistics(List<SysDept> sysDeptList) {

+ 10 - 0
src/main/resources/mapper/monitor/camera/CentermonitorTCameraMapper.xml

@@ -1673,5 +1673,15 @@
         <include refid="selectCentermonitorTCameraVo"/>
         ORDER BY create_time DESC
     </select>
+    
+    <!-- 根据标签ID查询设备树数据 -->
+    <select id="selectDeviceTreeDataByLabelId" parameterType="String" resultMap="DeviceTreeResult">
+        <include refid="selectCentermonitorTCameraVo"/>
+        WHERE id IN (
+            SELECT a.device_id FROM centermonitor_t_label_mapping a
+            WHERE a.label_id = #{labelId}
+        )
+        ORDER BY create_time DESC
+    </select>
 
 </mapper>