From 5b6e4a9e17e2425b43e3a6957115366e84ba8ce5 Mon Sep 17 00:00:00 2001
From: tangzy <tangzy123456>
Date: Tue, 06 Apr 2021 14:30:34 +0800
Subject: [PATCH] 1.监控台接口 2.客户管理

---
 blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml |   28 +++++++++++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml
index 9046a9a..6b447fe 100644
--- a/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml
+++ b/blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml
@@ -164,6 +164,10 @@
             and dtype=#{equipment.dtype}
         </if>
 
+        <if test="dxtype!=null">
+            and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY)
+        </if>
+
         <if test="childList!=null and childList.size>0">
             and deptId in
             <foreach collection="childList" index="index" item="item" open="(" separator="," close=")">
@@ -247,10 +251,13 @@
     <select id="selectInfo" resultMap="deptVOResultMap"
             parameterType="org.springblade.jfpt.equipment.entity.Equipment">
         SELECT
-        dept.id,dept.deviceName,dept.deviceNumber,dept.deviceType,dept.ownership,
+        dept.deptId,dept.id,dept.deviceName,dept.deviceNumber,dept.deviceType,dept.ownership,
         dept.ownerId,dept.devicestate,dept.stime,dept.district,dept.province,dept.city,
         ST_ASTEXT(dept.coordinate) as coordinate,dept.dtype,dept.expireTime,dept.heartbeat, dept.state,dept.reason,
         dept.parent_id,dept.jd,dept.wd,dept.street,u.yname,d.addvnm,dept.addvcd,dept.serialNumber,dept.channelNumber,
+        dept.oneContacts,dept.onePhone,dept.oneId,
+        dept.twoContacts,dept.twoPhone,dept.twoId,
+        dept.ThreeContacts,dept.ThreePhone,dept.threeId,
         (
         SELECT
         CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
@@ -319,4 +326,23 @@
         update sys_equipment SET state=#{state},reason=#{reason}  where deviceNumber=#{deviceNumber}
     </update>
 
+    <!--查询设备在线数量-->
+    <select id="selectEqCz" resultType="Integer">
+        select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY)
+    </select>
+
+    <!--查询设备掉线数量-->
+    <select id="selectEqCd" resultType="Integer">
+        select COUNT(*) from sys_equipment where heartbeat &lt; DATE_SUB(NOW(),INTERVAL 1 DAY)
+    </select>
+
+    <!--查询预警设备数量-->
+    <select id="selectEqCy" resultType="java.util.HashMap">
+        SELECT COUNT(deviceNumber) as cou,deviceNumber FROM `sys_alarm` WHERE alarmTime like concat(concat('%', #{time}), '%') and waringType NOT IN("系统测试","主机重新上电") group by deviceNumber
+    </select>
+
+    <!--查询设故障数量-->
+    <select id="selectEqCg" resultType="Integer">
+        select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and state!=null
+    </select>
 </mapper>

--
Gitblit v1.9.3