From 16abd944c4331a31e99c28564c9b8a31bfbbfefc Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 27 Aug 2021 21:14:15 +0800
Subject: [PATCH] 海康设备接口调用工具类修改
---
blade-service/blade-jfpts/src/main/java/org/springblade/jfpt/equipment/mapper/EquipmentMapper.xml | 62 +++++++++++++++++++++++++++----
1 files changed, 54 insertions(+), 8 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 3c57a77..35bd9d9 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
@@ -31,6 +31,10 @@
<result column="reason" property="reason"/>
<result column="jtype" property="jtype"/>
<result column="manufacturers" property="manufacturers"/>
+ <result column="eqModel" property="eqModel"/>
+ <result column="proId" property="proId"/>
+ <result column="eqSecret" property="eqSecret"/>
+ <result column="eqName" property="eqName"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
@@ -189,16 +193,19 @@
and dtype=#{equipment.dtype}
</if>
<if test="dxtype!=null and dxtype == 0">
- and heartbeat < DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=0
+ and dtype=0
</if>
<if test="dxtype!=null and dxtype == 1">
- and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=1
+ and dtype=1
</if>
<if test="dxtype!=null and dxtype == 2">
- and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=2
+ and dtype=2
</if>
<if test="dxtype!=null and dxtype == 3">
- and heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=3
+ and dtype=3
+ </if>
+ <if test="dxtype!=null and dxtype == 4">
+ and dtype!=0
</if>
<if test="pid!=null and pid!=''">
and deptId like concat('%',#{pid},'%')
@@ -408,6 +415,8 @@
dept.id,
dept.deviceName,
dept.deviceNumber,
+ dept.serialNumber,
+ dept.channelNumber,
dept.deviceType,
dept.ownership,
dept.ownerId,
@@ -445,12 +454,12 @@
<!--查询设备在线数量-->
<select id="selectEqCz" resultType="Integer">
- select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=1
+ select COUNT(*) from sys_equipment where dtype=1
</select>
<!--查询设备掉线数量-->
<select id="selectEqCd" resultType="Integer">
- select COUNT(*) from sys_equipment where heartbeat < DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=0
+ select COUNT(*) from sys_equipment where dtype=0
</select>
<!--查询预警设备数量-->
@@ -471,12 +480,12 @@
<!--查询预警设备数量-->
<select id="selectEqCys" resultType="Integer">
- select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=2
+ select COUNT(*) from sys_equipment where dtype=2
</select>
<!--查询设故障数量-->
<select id="selectEqCg" resultType="Integer">
- select COUNT(*) from sys_equipment where heartbeat >= DATE_SUB(NOW(),INTERVAL 1 DAY) and dtype=3
+ select COUNT(*) from sys_equipment where dtype=3
</select>
<!--查询所有的设备,不包含故障和警情状态-->
@@ -503,4 +512,41 @@
#{id}
</foreach>
</update>
+
+ <!--查询在线设备数量-->
+ <select id="selectOnlineEqNum" resultType="java.lang.Integer">
+ select COUNT(*) from sys_equipment where dtype=1 or dtype=2 or dtype=3
+ </select>
+
+ <!--获取设备视频播放的信息-->
+ <select id="selectEquimentPlayInfo" resultType="org.springblade.jfpt.equipment.entity.EquipmentPlayInfo">
+ select * from equipment_play_info
+ where
+ bmp=#{bmp}
+ and
+ number=#{number}
+ and
+ manufacturer =#{manufacturer}
+ </select>
+
+<!-- select id,number,serial_number serialNumber,bmp,address from equipment_play_info-->
+
+ <!--新增设备视频播放的信息-->
+ <insert id="saveEquipmentPlayInfo">
+ INSERT INTO equipment_play_info
+ (number, serial_number, manufacturer, bmp, address, create_time)
+ VALUES
+ (#{number}, #{serialNumber}, #{manufacturer}, #{bmp}, #{address}, #{createTime});
+ </insert>
+
+ <!--修改设备视频播放的信息-->
+ <update id="updateEquipmentPlayInfo">
+ update equipment_play_info
+ set
+ bmp=#{bmp},address=#{address}
+
+ where
+ id=#{id}
+ </update>
+
</mapper>
--
Gitblit v1.9.3