From 855520e4e2863a07fb35c9c4616d505ff03add57 Mon Sep 17 00:00:00 2001
From: zengh <123456>
Date: Sat, 09 Jan 2021 19:50:20 +0800
Subject: [PATCH] 客户列表接口修改

---
 src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml |   38 +++++++++++++++++++++++++++++++++++---
 1 files changed, 35 insertions(+), 3 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 49d3591..6ba36bf 100644
--- a/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
+++ b/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
@@ -18,6 +18,9 @@
         <result column="wd" property="wd"/>
         <result column="addvcd" property="addvcd"/>
         <result column="street" property="street"/>
+        <result column="serialNumber" property="serialNumber"/>
+        <result column="stype" property="stype"/>
+        <result column="channelNumber" property="channelNumber"/>
     </resultMap>
 
     <resultMap id="treeNodeResultMap" type="org.springblade.core.tool.node.TreeNode">
@@ -52,7 +55,28 @@
 
 
     <select id="selectEquipmentPage" resultMap="equipmentResultMap">
-        select * from sys_equipment where is_deleted = 0
+        select id,deviceName,deviceNumber,deviceType,ownership,ownerId,devicestate,stime,ST_ASTEXT (coordinate ) AS
+        coordinate,dtype,
+        parent_id,
+        FORMAT( jd, 6 ) AS jd,
+        FORMAT( wd, 6 ) AS wd,
+        street,
+        addvcd from sys_equipment where 1=1
+        <if test="deviceName!=null">
+            and (deviceName like concat('%',#{deviceName},'%') or deviceNumber like
+            concat('%',#{deviceName},'%'))
+        </if>
+        <if test="addvcd!=null">
+            and addvcd=#{addvcd}
+        </if>
+        <if test="devicestate!=null">
+            and devicestate =#{devicestate}
+        </if>
+
+        <if test="dtype!=null">
+            and dtype=#{dtype}
+        </if>
+        and parent_id!=0
     </select>
 
     <!--新增-->
@@ -69,7 +93,8 @@
         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,
-        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,
+        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,
         (
         SELECT
         CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
@@ -108,6 +133,12 @@
     coordinate=POINT(#{jd},#{wd}),parent_id=#{parentId},jd=#{jd},wd=#{wd},addvcd=#{addvnm},street=#{streeName},dtype=#{dtype} where id=#{id}
 </update>
 
+    <update id="updateOnes" parameterType="org.springblade.modules.equipment.entity.Equipment">
+    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>
+
 
     <select id="selectInfo" resultMap="deptVOResultMap"
             parameterType="org.springblade.modules.equipment.entity.Equipment">
@@ -136,7 +167,8 @@
         e.parent_id,e.jd,e.wd,e.addvcd,
         s.yname,d.bType,di.addvnm FROM `sys_equipment` e
         LEFT JOIN sys_suser s
-        on s.ynumber=e.ownerId LEFT JOIN act_deploy d on d.deviceNumber=e.deviceNumber LEFT JOIN sys_district di on di.addvcds=e.addvcd LEFT JOIN sys_street t on t.id=e.street
+        on s.ynumber=e.ownerId LEFT JOIN act_deploy d on d.deviceNumber=e.deviceNumber LEFT JOIN sys_district di on
+        di.addvcds=e.addvcd LEFT JOIN sys_street t on t.id=e.street
         where 1=1
         <if test="deviceType!=null and deviceType!=''">
             and e.deviceType=#{deviceType}

--
Gitblit v1.9.3