|
@@ -2690,3 +2690,61 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
|
|
if(COMMSTATUS!=null) {
|
|
if(COMMSTATUS!=null) {
|
|
if(COMMSTATUS.equals("NO"))
|
|
if(COMMSTATUS.equals("NO"))
|
|
wheresql = chkhw(sqlwhere)+" data1 <> 'U44' ";
|
|
wheresql = chkhw(sqlwhere)+" data1 <> 'U44' ";
|
|
|
|
+ else if(COMMSTATUS.equals("ONLY"))
|
|
|
|
+ wheresql = chkhw(sqlwhere)+" data1 = 'U44' ";
|
|
|
|
+ }
|
|
|
|
+ list = ytiotVAlarmDao.queryBySQL(" select DATE_FORMAT(ytiot_v_hj.time, \"%Y-%m-%d\") as days, count(*) as count, sum(clzt) as sum, company_name from ytiot_v_hj "+((wheresql!=null)?wheresql:"")+" group by days order by days desc");
|
|
|
|
+ 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", "fire_alarm");
|
|
|
|
+ jSONObject2 = JSONObject.fromObject(map2);
|
|
|
|
+ jSONArray.add(jSONObject2);
|
|
|
|
+ }
|
|
|
|
+ if((dwtype==null)||(dwtype.equals("2"))) {
|
|
|
|
+ wheresql = null;
|
|
|
|
+ if(COMMSTATUS!=null) {
|
|
|
|
+ if(COMMSTATUS.equals("NO"))
|
|
|
|
+ wheresql = chkhw(sqlwhere)+" ( data1<>'WP4' and data1<>'LL4' ) ";
|
|
|
|
+ else if(COMMSTATUS.equals("ONLY"))
|
|
|
|
+ wheresql = chkhw(sqlwhere)+" ( data1='WP4' or data1='LL4') ";
|
|
|
|
+ else
|
|
|
|
+ wheresql = sqlwhere;
|
|
|
|
+ }
|
|
|
|
+ list = ytiotVAlarmDao.queryBySQL(" select DATE_FORMAT(ytiot_v_sj.time, \"%Y-%m-%d\") as days, count(*) as count, sum(clzt) as sum, company_name from ytiot_v_sj "+((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))
|