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/LightTaskMapper.xml | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 55 insertions(+), 0 deletions(-)
diff --git a/dao/src/main/resources/mapper/LightTaskMapper.xml b/dao/src/main/resources/mapper/LightTaskMapper.xml
index cebc022..bddf6d3 100644
--- a/dao/src/main/resources/mapper/LightTaskMapper.xml
+++ b/dao/src/main/resources/mapper/LightTaskMapper.xml
@@ -39,4 +39,59 @@
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>
+ <select id="successCount" resultType="java.lang.Integer" parameterType="java.lang.Long">
+ SELECT count(*)
+ FROM light_task t1
+ LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
+ WHERE t1.task_id = #{taskId}
+ AND t2.issue_status = 0
+ </select>
+ <select id="toTalCount" resultType="java.lang.Integer">
+ SELECT count(*)
+ FROM light_task t1
+ LEFT JOIN light_task_pole_relation t2 ON t1.task_id = t2.task_id
+ WHERE t1.task_id = #{taskId}
+ </select>
+ <select id="listTask" resultType="com.sandu.ximon.dao.domain.LightTask">
+ 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 t3.id = t2.pole_id
+ LEFT JOIN pole_binding t4 ON t3.id = t4.pole_id
+ LEFT JOIN light t5 ON t5.device_code = t4.device_code
+ WHERE
+ 1=1
+ <if test="keyword != null and keyword != ''">
+ AND ( t1.task_name LIKE CONCAT(CONCAT('%', #{keyword}), '%') OR t5.device_code LIKE CONCAT(CONCAT('%',
+ #{keyword}), '%'))
+ </if>
+ <if test="userId != null">
+ AND ( t1.client_id =#{userId} OR t1.user_id =#{userId} )
+ </if>
+ GROUP BY
+ task_id
+ ORDER BY
+ t1.${orderBy}
+ </select>
</mapper>
--
Gitblit v1.9.3