From a1de31cb6df040d28e1ad5afceb53dce7150c5de Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Thu, 14 Jan 2021 23:30:59 +0800
Subject: [PATCH] 客户列表接口修改
---
src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml b/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
index 272b381..7c2f1a2 100644
--- a/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
+++ b/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.equipment.mapper.EquipmentMapper">
<!-- 通用查询映射结果 -->
- <resultMap id="equipmentResultMap" type="org.springblade.modules.equipment.entity.Equipment">
+ <resultMap id="equipmentResultMap" type="org.springblade.modules.equipment.vo.EquipmentVO">
<id column="id" property="id"/>
<result column="deviceName" property="deviceName"/>
<result column="deviceNumber" property="deviceNumber"/>
@@ -21,6 +21,9 @@
<result column="serialNumber" property="serialNumber"/>
<result column="stype" property="stype"/>
<result column="channelNumber" property="channelNumber"/>
+ <result column="pay" property="pay"/>
+ <result column="expireTime" property="expireTime"/>
+ <result column="heartbeat" property="heartbeat"/>
</resultMap>
<resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
@@ -56,12 +59,12 @@
<select id="selectEquipmentPage" resultMap="equipmentResultMap">
select id,deviceName,deviceNumber,deviceType,ownership,ownerId,devicestate,stime,ST_ASTEXT (coordinate ) AS
- coordinate,dtype,
+ coordinate,dtype,heartbeat,expireTime,pay,
parent_id,
FORMAT( jd, 6 ) AS jd,
FORMAT( wd, 6 ) AS wd,
street,
- addvcd from sys_equipment where 1=1
+ addvcd,pay,expireTime from sys_equipment where 1=1
<if test="deviceName!=null">
and (deviceName like concat('%',#{deviceName},'%') or deviceNumber like
concat('%',#{deviceName},'%'))
@@ -76,7 +79,6 @@
<if test="dtype!=null">
and dtype=#{dtype}
</if>
- and parent_id!=0
</select>
<!--新增-->
@@ -92,7 +94,7 @@
<select id="lazyList" resultMap="deptVOResultMap">
SELECT dept.id,dept.deviceName,dept.deviceNumber,dept.deviceType,dept.ownership,
dept.ownerId,dept.devicestate,dept.stime,
- ST_ASTEXT(dept.coordinate) as coordinate,dept.dtype,
+ ST_ASTEXT(dept.coordinate) as coordinate,dept.dtype,dept.serialNumber,dept.stype,dept.channelNumber,dept.pay,dept.expireTime,dept.heartbeat,
dept.parent_id,FORMAT(dept.jd,6) as jd,FORMAT(dept.wd,6) as wd,dept.street as
streeName,u.yname,d.addvnm,dept.addvcd,
(
@@ -131,7 +133,15 @@
update sys_equipment SET deviceName=#{deviceName},deviceNumber=#{deviceNumber},deviceType=#{deviceType},
ownership=#{ownership},ownerId=#{yname},devicestate=#{devicestate},stime=#{stime},
coordinate=POINT(#{jd},#{wd}),parent_id=#{parentId},jd=#{jd},wd=#{wd},addvcd=#{addvnm},street=#{streeName},dtype=#{dtype} where id=#{id}
-</update>
+ </update>
+
+ <update id="updataType">
+ update sys_equipment SET devicestate = 1 where id in (${arr})
+ </update>
+
+ <update id="updataTypeC">
+ update sys_equipment SET devicestate = 0 where id in (${arr})
+ </update>
<update id="updateOnes" parameterType="org.springblade.modules.equipment.entity.Equipment">
update sys_equipment SET deviceName=#{deviceName},deviceNumber=#{deviceNumber},deviceType=#{deviceType},
@@ -145,7 +155,7 @@
SELECT
dept.id,dept.deviceName,dept.deviceNumber,dept.deviceType,dept.ownership,
dept.ownerId,dept.devicestate,dept.stime,
- ST_ASTEXT(dept.coordinate) as coordinate,dept.dtype,
+ ST_ASTEXT(dept.coordinate) as coordinate,dept.dtype,dept.expireTime,dept.heartbeat,
dept.parent_id,dept.jd,dept.wd,dept.street as streeName,u.yname,d.addvnm,dept.addvcd,
(
SELECT
@@ -201,4 +211,8 @@
LEFT JOIN sys_street s ON s.id = dept.street WHERE dept.deviceNumber=#{deviceNumber}
</select>
+ <update id="updateChannel">
+ update sys_equipment SET heartbeat=#{heartbeat} where deviceNumber=#{deviceNumber}
+</update>
+
</mapper>
--
Gitblit v1.9.3