Prechádzať zdrojové kódy

3dDisplayEngine YtiotVAlarmServiceImpl.java 吉超博 commit at 2021-02-01

吉超博 4 rokov pred
rodič
commit
1c9773f7de

+ 117 - 0
3dDisplayEngine/buildingService/YtiotVAlarmServiceImpl.java

@@ -2808,3 +2808,120 @@ public class YtiotVAlarmServiceImpl implements YtiotVAlarmService {
 
 
 
+
+//视频监控统计数据
+			if((dwtype==null)||(dwtype.equals("16"))) {
+				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_video2017.time, \"%Y-%m-%d\") as days, count(*) as count, sum(clzt) as sum, company_name from ytiot_v_video2017 "+((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);
+			}
+
+			//视频设备离线统计
+			if((dwtype==null)||(dwtype.equals("18"))) {
+				wheresql = null;
+				if(COMMSTATUS!=null) {
+					if(COMMSTATUS.equals("NO"))
+						wheresql = chkhw(sqlwhere)+" status<>'上线' ";
+					else if(COMMSTATUS.equals("ONLY"))
+						wheresql = chkhw(sqlwhere)+" status='离线' ";
+					else
+						wheresql = sqlwhere;
+				}
+				list = ytiotVAlarmDao.queryBySQL(" select DATE_FORMAT(ytiot_v_video2017s.time, \"%Y-%m-%d\") as days, count(*) as count, sum(clzt=1) as sum, company_name from ytiot_v_video2017s "+((wheresql!=null)?wheresql:"")+" group by days order by device_code 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);
+			}
+
+
+
+
+			//电梯监控统计数据
+			if((dwtype==null)||(dwtype.equals("17"))) {
+				wheresql = null;
+				if(COMMSTATUS!=null) {
+					if(COMMSTATUS.equals("NO"))
+						wheresql = chkhw(sqlwhere)+" ncmd<>'0' ";
+					else if(COMMSTATUS.equals("ONLY"))
+						wheresql = chkhw(sqlwhere)+" ncmd='0' ";
+					else
+						wheresql = sqlwhere;
+				}
+				list = ytiotVAlarmDao.queryBySQL(" select DATE_FORMAT(ytiot_v_lift.time, \"%Y-%m-%d\") as days, count(*) as count, sum(clzt) as sum, company_name from ytiot_v_lift "+((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));