From d72e7d16776d31c2fd29b60929e896bccded3029 Mon Sep 17 00:00:00 2001
From: liuhaonan <konodioda2333@vip.qq.com>
Date: 星期五, 04 三月 2022 14:38:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 dao/src/main/resources/mapper/BroadcastTerminalV2EntityMapper.xml |   47 ++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 42 insertions(+), 5 deletions(-)

diff --git a/dao/src/main/resources/mapper/BroadcastTerminalV2EntityMapper.xml b/dao/src/main/resources/mapper/BroadcastTerminalV2EntityMapper.xml
index 602fcc3..d2be7a9 100644
--- a/dao/src/main/resources/mapper/BroadcastTerminalV2EntityMapper.xml
+++ b/dao/src/main/resources/mapper/BroadcastTerminalV2EntityMapper.xml
@@ -5,15 +5,52 @@
 <mapper namespace="com.sandu.ximon.dao.mapper.BroadcastTerminalV2EntityMapper">
 
     <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.BroadcastTerminalV2Entity">
-            <id property="id" column="id" jdbcType="INTEGER"/>
-            <result property="terminalName" column="terminal_name" jdbcType="VARCHAR"/>
-            <result property="streetlightId" column="streetlight_id" jdbcType="BIGINT"/>
-            <result property="bindStates" column="bind_states" jdbcType="INTEGER"/>
-            <result property="exist" column="exist" jdbcType="INTEGER"/>
+        <id property="id" column="id" jdbcType="INTEGER"/>
+        <result property="terminalName" column="terminal_name" jdbcType="VARCHAR"/>
+        <result property="streetlightId" column="streetlight_id" jdbcType="BIGINT"/>
+        <result property="bindStates" column="bind_states" jdbcType="INTEGER"/>
+        <result property="exist" column="exist" jdbcType="INTEGER"/>
     </resultMap>
 
     <sql id="Base_Column_List">
         id,terminal_name,streetlight_id,
         bind_states,exist
     </sql>
+    <select id="listAll" resultType="com.sandu.ximon.dao.domain.BroadcastTerminalV2Entity">
+        SELECT
+        a.*, b.pole_name
+        FROM
+        broadcast_v2_terminal a
+        LEFT JOIN pole b ON a.streetlight_id = b.id
+        WHERE
+        1 = 1
+        <if test="terminalName != null and terminalName != ''">
+            AND a.terminal_name like '%${terminalName}%'
+        </if>
+    </select>
+
+    <select id="getBroadcastTerminalList" resultType="com.sandu.ximon.dao.bo.BroadcastTerminalV2EntityBo">
+
+        SELECT
+        t1.*, t2.pole_id,
+        t3.pole_name
+        FROM
+        broadcast_v2_terminal t1
+        LEFT JOIN pole_binding t2 ON t1.id = t2.device_code
+        AND t2.device_type = 5
+        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.terminal_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+            </if>
+            <if test="clientId != null">
+                AND t3.client_id = #{clientId}
+            </if>
+            <if test="bindingState != 2">
+                AND t1.bind_states = #{bindingState}
+            </if>
+        </where>
+    </select>
+
 </mapper>

--
Gitblit v1.9.3