From f8c33ad3fb09dd0f70b68b74d59ce28761142bf0 Mon Sep 17 00:00:00 2001
From: Van333 <van666666@foxmail.com>
Date: 星期一, 14 十一月 2022 15:21:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/xm-20221107' into xm-20221107

---
 dao/src/main/resources/mapper/NewNovaLedMapper.xml |   38 +++++++++++++++++++++++++++++---------
 1 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/dao/src/main/resources/mapper/NewNovaLedMapper.xml b/dao/src/main/resources/mapper/NewNovaLedMapper.xml
index 862178c..fbad90f 100644
--- a/dao/src/main/resources/mapper/NewNovaLedMapper.xml
+++ b/dao/src/main/resources/mapper/NewNovaLedMapper.xml
@@ -5,19 +5,39 @@
 <mapper namespace="com.sandu.ximon.dao.mapper.NewNovaLedMapper">
 
     <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.NewNovaLed">
-            <id property="id" column="id" jdbcType="BIGINT"/>
-            <result property="name" column="name" jdbcType="VARCHAR"/>
-            <result property="playerName" column="player_name" jdbcType="VARCHAR"/>
-            <result property="playerId" column="player_id" jdbcType="VARCHAR"/>
-            <result property="sn" column="sn" jdbcType="VARCHAR"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="resolution" column="resolution" jdbcType="VARCHAR"/>
-            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <id property="id" column="id" jdbcType="BIGINT"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="sn" column="sn" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="onlineSign" column="online_sign" jdbcType="VARCHAR"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,name,player_name,
+        id
+        ,name,player_name,
         player_id,sn,create_time,
         resolution,update_time
     </sql>
+    <select id="listLed" resultType="com.sandu.ximon.dao.domain.NewNovaLed">
+        SELECT
+        t1.*,
+        t3.id AS pole_id,
+        t3.pole_name
+        FROM
+        new_nova_led t1
+        LEFT JOIN pole_binding t2 ON t1.sn = t2.device_code
+        AND t2.device_type = 12
+        LEFT JOIN pole t3 ON t2.pole_id = t3.id
+        <where>
+            1=1
+            <if test="keyword != null and keyword != ''">
+                AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                OR t1.sn 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