From 3a02431d4c4ab58e782ac8a6d40e084f19ecdc83 Mon Sep 17 00:00:00 2001
From: nnnjjj123 <494715143@qq.com>
Date: Sun, 10 Jan 2021 10:02:59 +0800
Subject: [PATCH] 1.netty调整

---
 src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml |   58 +++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 43 insertions(+), 15 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 7c9c933..272b381 100644
--- a/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
+++ b/src/main/java/org/springblade/modules/equipment/mapper/EquipmentMapper.xml
@@ -55,26 +55,26 @@
 
 
     <select id="selectEquipmentPage" resultMap="equipmentResultMap">
-        select id,deviceName,deviceNumber,deviceType,ownership,ownerId,devicestate,stime,ST_ASTEXT (coordinate ) AS coordinate,dtype,
+        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="equipment.deviceName!=null">
-            and deviceName like concat('%',#{equipment.deviceName},'%')
+        addvcd from sys_equipment where 1=1
+        <if test="deviceName!=null">
+            and (deviceName like concat('%',#{deviceName},'%') or deviceNumber like
+            concat('%',#{deviceName},'%'))
         </if>
-        <if test="equipment.addvcd!=null">
-            and addvcd=#{equipment.addvcd}
+        <if test="addvcd!=null">
+            and addvcd=#{addvcd}
         </if>
-        <if test="equipment.deviceType!=null">
-            and deviceType like concat('%',#{equipment.deviceType},'%')
+        <if test="devicestate!=null">
+            and devicestate =#{devicestate}
         </if>
-        <if test="equipment.deviceNumber!=null">
-            and deviceNumber IN (${equipment.deviceNumber})
-        </if>
-        <if test="equipment.dtype!=null">
-            and dtype=#{equipment.dtype}
+
+        <if test="dtype!=null">
+            and dtype=#{dtype}
         </if>
         and parent_id!=0
     </select>
@@ -93,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
@@ -166,11 +167,38 @@
         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}
         </if>
     </select>
 
+    <select id="selectInfos" resultType="java.util.HashMap">
+       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,
+   dept.jd,
+   dept.wd,
+   dept.street AS streeName,
+   u.yname,
+   d.addvnm,
+   dept.addvcd
+FROM
+   sys_equipment dept
+   LEFT JOIN sys_suser u ON u.ynumber = dept.ownerId
+   LEFT JOIN sys_district d ON d.addvcds = dept.addvcd
+   LEFT JOIN sys_street s ON s.id = dept.street  WHERE  dept.deviceNumber=#{deviceNumber}
+    </select>
+
 </mapper>

--
Gitblit v1.9.3