|
@@ -2748,3 +2748,63 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
|
|
|
count += Integer.parseInt(s_count);
|
|
|
sum += Integer.parseInt(s_sum);
|
|
|
if((company_code!=null)&&(Nrow==0))
|
|
|
+ json.put("company_name", objects[3].toString());
|
|
|
+ Nrow++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map2 = new HashMap();
|
|
|
+ map2.put("day_list", daylist);
|
|
|
+ map2.put("count_list", countlist);
|
|
|
+ map2.put("sum_list", sumlist);
|
|
|
+ map2.put("count", count);
|
|
|
+ map2.put("sum", sum);
|
|
|
+ map2.put("id", "water_alarm");
|
|
|
+ jSONObject2 = JSONObject.fromObject(map2);
|
|
|
+ jSONArray.add(jSONObject2);
|
|
|
+ }
|
|
|
+ if((dwtype==null)||(dwtype.equals("6"))) {
|
|
|
+ wheresql = null;
|
|
|
+ if(COMMSTATUS!=null) {
|
|
|
+ if(COMMSTATUS.equals("NO"))
|
|
|
+ wheresql = chkhw(sqlwhere)+" status<>'44' ";
|
|
|
+ else if(COMMSTATUS.equals("ONLY"))
|
|
|
+ wheresql = chkhw(sqlwhere)+" status='44' ";
|
|
|
+ else
|
|
|
+ wheresql = sqlwhere;
|
|
|
+ }
|
|
|
+ list = ytiotVAlarmDao.queryBySQL(" select DATE_FORMAT(ytiot_v_rtu.time, \"%Y-%m-%d\") as days, count(*) as count, sum(clzt) as sum, company_name from ytiot_v_rtu "+((wheresql!=null)?wheresql:"")+" group by days order by days desc");
|
|
|
+ count=0;
|
|
|
+ sum=0;
|
|
|
+ daylist = new JSONArray();
|
|
|
+ countlist = new JSONArray();
|
|
|
+ sumlist = new JSONArray();
|
|
|
+ if(list.size()>0) {
|
|
|
+ int Nrow = 0;
|
|
|
+ for(Iterator iterator = list.iterator();iterator.hasNext();){
|
|
|
+ Object[] objects = (Object[]) iterator.next();
|
|
|
+ daylist.add(objects[0].toString());
|
|
|
+ String s_count = objects[1]==null?"0":objects[1].toString();
|
|
|
+ String s_sum = objects[2]==null?"0":objects[2].toString();
|
|
|
+ countlist.add(Integer.parseInt(s_count));
|
|
|
+ sumlist.add(Integer.parseInt(s_sum));
|
|
|
+ count += Integer.parseInt(s_count);
|
|
|
+ sum += Integer.parseInt(s_sum);
|
|
|
+ if((company_code!=null)&&(Nrow==0))
|
|
|
+ json.put("company_name", objects[3].toString());
|
|
|
+ Nrow++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map2 = new HashMap();
|
|
|
+ map2.put("day_list", daylist);
|
|
|
+ map2.put("count_list", countlist);
|
|
|
+ map2.put("sum_list", sumlist);
|
|
|
+ map2.put("count", count);
|
|
|
+ map2.put("sum", sum);
|
|
|
+ map2.put("id", "rtu_alarm");
|
|
|
+ jSONObject2 = JSONObject.fromObject(map2);
|
|
|
+ jSONArray.add(jSONObject2);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|