From 7a00187d197548e23a38dcb87187ef6b2b7f8bfb Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期一, 24 十月 2022 11:19:58 +0800
Subject: [PATCH] changes

---
 dao/src/main/resources/mapper/AirEquipmentNongGengMapper.xml |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/dao/src/main/resources/mapper/AirEquipmentNongGengMapper.xml b/dao/src/main/resources/mapper/AirEquipmentNongGengMapper.xml
index a855823..436f8ac 100644
--- a/dao/src/main/resources/mapper/AirEquipmentNongGengMapper.xml
+++ b/dao/src/main/resources/mapper/AirEquipmentNongGengMapper.xml
@@ -7,10 +7,33 @@
     <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.AirEquipmentNongGeng">
             <id property="id" column="id" jdbcType="BIGINT"/>
             <result property="mac" column="mac" jdbcType="VARCHAR"/>
+            <result property="type" column="type" jdbcType="VARCHAR"/>
             <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,mac,create_time
+        id,mac,type,
+        create_time
     </sql>
+    <select id="listAirEquipmentByIds" resultType="com.sandu.ximon.dao.bo.AirEquipmentNongGengBo">
+        SELECT
+        t1.*, t2.pole_id,
+        t3.pole_name
+        FROM
+        air_equipment_nong_geng t1
+        LEFT JOIN pole_binding t2 ON t1.mac = t2.device_code
+        AND t2.device_type = 11
+        LEFT JOIN pole t3 ON t3.id = t2.pole_id
+        <where>
+            <if test="keyword != null and keyword != ''">
+                AND (
+                t3.pole_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                    or t1.mac LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                )
+            </if>
+            <if test="userid != null">
+                AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
+            </if>
+        </where>
+    </select>
 </mapper>

--
Gitblit v1.9.3