From e55c8b0a92eb9715edd90c31dfd4de51a47b588b Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期五, 04 十一月 2022 17:40:08 +0800
Subject: [PATCH] changes

---
 dao/src/main/resources/mapper/LedPlayerEntityMapper.xml |   68 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml b/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
index 3e43ce2..6294706 100644
--- a/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
+++ b/dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
@@ -10,6 +10,7 @@
         <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="resolution" column="resolution" jdbcType="VARCHAR"/>
         <result property="createTimestamp" column="create_timestamp" jdbcType="BIGINT"/>
     </resultMap>
 
@@ -25,6 +26,29 @@
 
     <select id="ledPlayerEntityList" resultType="com.sandu.ximon.dao.domain.LedPlayerEntity">
         SELECT
+        t1.*,
+        t2.pole_id,
+        t3.pole_name
+        FROM
+        led t1
+        LEFT JOIN pole_binding t2 ON t1.sn = t2.device_code
+        AND t2.device_type = 1
+        LEFT JOIN pole t3 ON t3.id = t2.pole_id
+        <where>
+            1=1
+            <if test="keyword != null and keyword != ''">
+                AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                OR t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+            </if>
+            <if test="userId != null">
+                AND (t3.user_id = #{userId} OR t3.client_id = #{userId})
+            </if>
+        </where>
+    </select>
+
+    <select id="ledPlayerEntityListOnBinding" resultType="com.sandu.ximon.dao.domain.LedPlayerEntity">
+        SELECT
         t1.*, t2.pole_id,
         t3.pole_name, t3.id
         FROM
@@ -35,6 +59,7 @@
         <where>
             <if test="keyword != null and keyword != ''">
                 AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                OR t1.player_name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                 OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
                 OR t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
             </if>
@@ -43,4 +68,47 @@
             </if>
         </where>
     </select>
+    <select id="getListByGroupId" resultType="com.sandu.ximon.dao.bo.LEDNovaGroupListBo">
+        SELECT
+        t1.*
+        FROM
+        led t1
+        INNER JOIN led_nova_group_relation t2 ON t1.id = t2.nova_id
+        LEFT JOIN led_nova_group t3 ON t3.group_id = t2.nova_group_id
+        WHERE
+        t3.group_id=#{groupId}
+        <if test="clientId != null">
+            AND (t3.user_id = #{clientId} OR t3.client_id = #{clientId})
+        </if>
+    </select>
+    <select id="ledListByGroupId" resultType="com.sandu.ximon.dao.domain.LedPlayerEntity">
+        SELECT
+        t1.*,
+        t2.pole_id,
+        t3.pole_name
+        FROM
+        led t1
+        LEFT JOIN pole_binding t2 ON t1.sn = t2.device_code
+        AND t2.device_type = 1
+        LEFT JOIN pole t3 ON t3.id = t2.pole_id
+        LEFT JOIN led_nova_group_relation t4 ON t4.nova_id = t1.id
+        LEFT JOIN led_nova_group t5 ON t5.group_id = t4.nova_group_id
+        <where>
+            1=1
+            <if test="groupId != null">
+                AND t5.group_id=#{groupId}
+            </if>
+            <if test="keyword != null and keyword != ''">
+                AND t1.name LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                OR t1.sn LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+                OR t1.id LIKE CONCAT(CONCAT('%', #{keyword}), '%')
+            </if>
+            <if test="userId != null">
+                AND (t3.user_id = #{userId} OR t3.client_id = #{userId})
+            </if>
+        </where>
+        GROUP BY t1.id
+    </select>
+
+
 </mapper>

--
Gitblit v1.9.3