Selaa lähdekoodia

增加查询所有监控接口

liaoyitao 3 kuukautta sitten
vanhempi
commit
a73ee89e19

+ 7 - 0
src/main/java/com/lqkj/info/controller/EquipmentInfoController.java

@@ -109,4 +109,11 @@ public class EquipmentInfoController extends BaseController
109
     {
109
     {
110
         return resultByRows(equipmentInfoService.deleteEquipmentInfoByEquipmentIds(equipmentIds));
110
         return resultByRows(equipmentInfoService.deleteEquipmentInfoByEquipmentIds(equipmentIds));
111
     }
111
     }
112
+
113
+    @ApiOperation("查询所有监控")
114
+    @GetMapping("/getAllMonitors")
115
+    public ResultUtil selectEquipmentInfoList()
116
+    {
117
+    	return ResultUtil.success(equipmentInfoService.getAllMonitors());
118
+    }
112
 }
119
 }

+ 5 - 0
src/main/java/com/lqkj/info/mapper/EquipmentInfoMapper.java

@@ -3,6 +3,7 @@ package com.lqkj.info.mapper;
3
 import java.util.List;
3
 import java.util.List;
4
 import org.apache.ibatis.annotations.Mapper;
4
 import org.apache.ibatis.annotations.Mapper;
5
 import com.lqkj.info.entity.EquipmentInfo;
5
 import com.lqkj.info.entity.EquipmentInfo;
6
+import org.apache.ibatis.annotations.Select;
6
 
7
 
7
 /**
8
 /**
8
  * 设备信息Mapper接口
9
  * 设备信息Mapper接口
@@ -60,4 +61,8 @@ public interface EquipmentInfoMapper
60
      * @return 结果
61
      * @return 结果
61
      */
62
      */
62
     public int deleteEquipmentInfoByEquipmentIds(Integer[] equipmentIds);
63
     public int deleteEquipmentInfoByEquipmentIds(Integer[] equipmentIds);
64
+
65
+    @Select("SELECT * FROM equipment_info ei " +
66
+            "WHERE ei.type_id IN (SELECT et.type_id FROM equipment_type et WHERE et.parent_id = 1)")
67
+    List<EquipmentInfo> getAllMonitors();
63
 }
68
 }

+ 5 - 0
src/main/java/com/lqkj/info/service/EquipmentInfoService.java

@@ -90,4 +90,9 @@ public class EquipmentInfoService
90
     {
90
     {
91
         return equipmentInfoMapper.deleteEquipmentInfoByEquipmentId(equipmentId);
91
         return equipmentInfoMapper.deleteEquipmentInfoByEquipmentId(equipmentId);
92
     }
92
     }
93
+
94
+    public List<EquipmentInfo> getAllMonitors() {
95
+
96
+        return equipmentInfoMapper.getAllMonitors();
97
+    }
93
 }
98
 }