From 7b43c04dd530bdd193e0cf02c4e19ba7c2ee2c11 Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期三, 11 五月 2022 10:41:31 +0800
Subject: [PATCH] 设备归属

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

diff --git a/dao/src/main/resources/mapper/LightTaskMapper.xml b/dao/src/main/resources/mapper/LightTaskMapper.xml
index 71c63ef..c5d110d 100644
--- a/dao/src/main/resources/mapper/LightTaskMapper.xml
+++ b/dao/src/main/resources/mapper/LightTaskMapper.xml
@@ -9,6 +9,7 @@
         <result property="clientId" column="client_id" jdbcType="BIGINT"/>
         <result property="userId" column="user_id" jdbcType="BIGINT"/>
         <result property="taskName" column="task_name" jdbcType="VARCHAR"/>
+        <result property="lightAdress" column="light_adress" jdbcType="VARCHAR"/>
         <result property="pause" column="pause" jdbcType="TINYINT"/>
         <result property="week" column="week" jdbcType="TINYINT"/>
         <result property="openOrder" column="open_order" jdbcType="VARCHAR"/>
@@ -31,9 +32,30 @@
             parameterType="java.lang.Long">
         SELECT t1.*
         FROM light_task t1
-                 LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
-                 LEFT JOIN pole t3 ON t2.pole_id = t3.id
+        LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
+        LEFT JOIN pole t3 ON t2.pole_id = t3.id
         WHERE t2.issue_status = 0
-          AND (t3.user_id = #{userId} or t3.client_id = #{userId})
+        <if test="userid != null">
+            AND (t3.user_id = #{userid} OR t3.client_id = #{userid})
+        </if>
+    </select>
+    <select id="listLightTaskByTaskId" resultType="com.sandu.ximon.dao.bo.PoleTaskLightPowerBo"
+            parameterType="java.lang.Long">
+        SELECT
+        t1.id ,
+        t2.task_id,
+        t4.power1,
+        t4.power2
+        FROM
+        pole t1
+        LEFT JOIN light_task_pole_relation t2 ON t1.id = t2.pole_id
+        LEFT JOIN pole_binding t3 ON t3.device_code = t1.device_code
+        LEFT JOIN light t4 ON t4.device_code = t1.device_code
+        WHERE
+        t3.device_type=0
+        <if test=" taskId != null">
+            AND
+            t2.task_id = #{taskId}
+        </if>
     </select>
 </mapper>

--
Gitblit v1.9.3