Parcourir la source

soc-modules-iot模块后台代码-告警中心下拉框列表查询优化

humingshi-7@163.com il y a 1 an
Parent
commit
9f9ad4412a

+ 2 - 2
soc-modules/soc-modules-iot/src/main/java/com/xunmei/iot/service/impl/IotAlarmDataServiceImpl.java

@@ -303,7 +303,7 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
         List<AlarmTypeSelectedVO> list = Lists.newArrayList();
         AlarmTypeSelectedVO bean;
         String suffix = "告警";
-        List<String> excludeTypes = Lists.newArrayList("FSU_AirConditioner","FSU_DoPowerCollection","FSU_DoPowerControl",
+        List<String> excludeTypes = Lists.newArrayList("FSU_AirConditioner","FSU_DoPowerCollection","FSU_DoPowerControlBoxButton",
                 "AlarmHostInput_Humidity","AlarmHostInput_Temperature","AlarmHostInput_Smoke","AlarmHostInput_Infrared","AlarmHostInput_Soaking","AlarmHostInput_DoorSensor");
         List<String> mixTypes = Lists.newArrayList(
                 String.valueOf(SensorType.INFRARED_SENSOR.getProductName()),
@@ -328,7 +328,7 @@ public class IotAlarmDataServiceImpl extends ServiceImpl<IotAlarmDataMapper, Iot
                 if(isMix){
                     vo.setType("0_2");
                 }else{
-                    vo.setType(vo.getValue().startsWith("4") ? "0" : "2");
+                    vo.setType(vo.getValue().startsWith("FSU_") ? "0" : "2");
                 }
             }
             list.addAll(types0);

+ 7 - 7
soc-modules/soc-modules-iot/src/main/resources/mapper/IotAlarmDataMapper.xml

@@ -195,22 +195,22 @@
     </select>
 
     <select id="selectAlarmTypeList" resultType="com.xunmei.iot.vo.alarmData.AlarmTypeSelectedVO">
-        select source_type as value,
-        replace(source_type_des,'传感器','') as label
+        select product_type as value,
+        replace(product_name,'传感器','') as label
         from iot_alarm_system_field
-        where source_type not in
+        where product_type not in
         <foreach item="name" collection="excludeTypes" separator="," open="(" close=")">
             #{name}
         </foreach>
         <choose>
             <when test=" category == null or category =='' ">
-                and (source_type like 'FSU_%' or source_type like 'AlarmHostInput_%')
+                and (product_type like 'FSU_%' or product_type like 'AlarmHostInput_%')
             </when>
             <when test=" category == '0' ">
-                and source_type like 'FSU_%'
+                and product_type like 'FSU_%'
             </when>
             <when test=" category == '2'">
-                and (source_type like 'AlarmHostInput_%' or source_type in
+                and (product_type like 'AlarmHostInput_%' or product_type in
                 <foreach item="name" collection="mixTypes" separator="," open="(" close=")">
                     #{name}
                 </foreach>
@@ -219,6 +219,6 @@
             <otherwise>
             </otherwise>
         </choose>
-        group by source_type
+        group by product_type
     </select>
 </mapper>