Showing
1 changed file
with
4 additions
and
8 deletions
@@ -35,8 +35,9 @@ public class MonitorAlarmServiceImpl { | @@ -35,8 +35,9 @@ public class MonitorAlarmServiceImpl { | ||
35 | String sql = "SHOW TAG VALUES FROM monitor_alarm WITH KEY = idc"; | 35 | String sql = "SHOW TAG VALUES FROM monitor_alarm WITH KEY = idc"; |
36 | List<List<Object>> values = getResultList(influxdbName, sql); | 36 | List<List<Object>> values = getResultList(influxdbName, sql); |
37 | List<String> typeList = new ArrayList<>(); | 37 | List<String> typeList = new ArrayList<>(); |
38 | - typeList.add("all"); | ||
39 | - values.forEach(v -> typeList.add(v.get(1).toString())); | 38 | + if(!CollectionUtils.isEmpty(values)){ |
39 | + values.forEach(v -> typeList.add(v.get(1).toString())); | ||
40 | + } | ||
40 | return typeList; | 41 | return typeList; |
41 | } | 42 | } |
42 | 43 | ||
@@ -68,12 +69,7 @@ public class MonitorAlarmServiceImpl { | @@ -68,12 +69,7 @@ public class MonitorAlarmServiceImpl { | ||
68 | String querySql = "SELECT sms_content, info, send_status,type,idc FROM monitor_alarm WHERE event = 'alarm' "; | 69 | String querySql = "SELECT sms_content, info, send_status,type,idc FROM monitor_alarm WHERE event = 'alarm' "; |
69 | String countSql = "SELECT COUNT(sms_content) FROM monitor_alarm WHERE event = 'alarm' "; | 70 | String countSql = "SELECT COUNT(sms_content) FROM monitor_alarm WHERE event = 'alarm' "; |
70 | StringBuilder conditionBuilder = new StringBuilder(" "); | 71 | StringBuilder conditionBuilder = new StringBuilder(" "); |
71 | - if (CollectionUtils.isEmpty(idcList)) { | ||
72 | - idcList = new ArrayList<>(); | ||
73 | - idcList.add("all");//默认所有 | ||
74 | - } | ||
75 | - | ||
76 | - if (idcList.contains("all")) { | 72 | + if (CollectionUtils.isEmpty(idcList)) {//默认查询所有的 |
77 | conditionBuilder.append(" and type != 'work_system' "); | 73 | conditionBuilder.append(" and type != 'work_system' "); |
78 | }else{ | 74 | }else{ |
79 | String s = ""; | 75 | String s = ""; |
-
Please register or login to post a comment