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/LightTaskPoleRelationMapper.xml |   51 ++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 44 insertions(+), 7 deletions(-)

diff --git a/dao/src/main/resources/mapper/LightTaskPoleRelationMapper.xml b/dao/src/main/resources/mapper/LightTaskPoleRelationMapper.xml
index c50eafc..5785954 100644
--- a/dao/src/main/resources/mapper/LightTaskPoleRelationMapper.xml
+++ b/dao/src/main/resources/mapper/LightTaskPoleRelationMapper.xml
@@ -5,15 +5,52 @@
 <mapper namespace="com.sandu.ximon.dao.mapper.LightTaskPoleRelationMapper">
 
     <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LightTaskPoleRelation">
-            <id property="id" column="id" jdbcType="BIGINT"/>
-            <result property="taskId" column="task_id" jdbcType="BIGINT"/>
-            <result property="poleId" column="pole_id" jdbcType="BIGINT"/>
-            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
-            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
+        <id property="id" column="id" jdbcType="BIGINT"/>
+        <result property="taskId" column="task_id" jdbcType="BIGINT"/>
+        <result property="poleId" column="pole_id" jdbcType="BIGINT"/>
+        <result property="lightAddress" column="light_address" jdbcType="VARCHAR"/>
+        <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
+        <result property="sysScheduled" column="sys_scheduled" jdbcType="VARCHAR"/>
+        <result property="deviceScheduled" column="device_scheduled" jdbcType="VARCHAR"/>
+        <result property="issueStatus" column="issue_status" jdbcType="INTEGER"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
     </resultMap>
 
     <sql id="Base_Column_List">
-        id,task_id,pole_id,
-        create_time,update_time
+        id
+        ,task_id,pole_id,
+        issue_status,create_time,update_time
     </sql>
+    <select id="listPoleAndStatusIdByTaskId" resultType="com.sandu.ximon.dao.bo.LightTaskStatusAndPole">
+        SELECT
+        t1.issue_status,
+        t2.*
+        FROM
+        light_task_pole_relation t1
+        LEFT JOIN pole t2 ON t1.pole_id = t2.id
+        <where>
+            t1.task_id = #{taskId}
+        </where>
+        GROUP BY t2.id
+    </select>
+
+    <select id="test" resultType="com.sandu.ximon.dao.bo.LightTaskPoleRelationBo">
+        SELECT
+        t1.*,
+        t2.user_id, t2.client_id,
+        t3.task_name, t3.week, t3.open_order, t3.close_order, t3.control_order, t3.light_adress
+        FROM
+        light_task_pole_relation t1
+        LEFT JOIN pole t2 ON t1.pole_id = t2.id
+        LEFT JOIN light_task t3 ON t3.task_id = t1.task_id
+        <where>
+            t1.issue_status=0
+            AND
+            t1.task_id IN
+            <foreach collection="taskIdList" open="(" close=")" separator="," item="task_id">
+                #{task_id}
+            </foreach>
+        </where>
+    </select>
 </mapper>

--
Gitblit v1.9.3