From 826cd5b51d5106cfea07e397eda184fb15ec7a30 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 02 八月 2024 14:33:59 +0800
Subject: [PATCH] 修改

---
 modules/mainPart/src/main/resources/mapper/taskReliability/TaskDao.xml |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 55 insertions(+), 4 deletions(-)

diff --git a/modules/mainPart/src/main/resources/mapper/taskReliability/TaskDao.xml b/modules/mainPart/src/main/resources/mapper/taskReliability/TaskDao.xml
index 1b7c0cd..0f7f89b 100644
--- a/modules/mainPart/src/main/resources/mapper/taskReliability/TaskDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/taskReliability/TaskDao.xml
@@ -4,12 +4,9 @@
 <mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.TaskDao">
 
     <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.Task">
-        select a.*,
-        b.phaseDuration
+        select a.*
         FROM
         task a
-        LEFT JOIN (select task_id , SUM(phase_duration_rate) as phaseDuration from task_phase
-        where is_delete =0 group by task_id) b ON a.id = b.task_id
         <where>
             a.is_delete = 0
             and a.product_id=${productId}
@@ -29,4 +26,58 @@
         and a.product_id=${productId}
     </select>
 
+    <select id="getTaskModels" resultType="com.zt.life.modules.mainPart.taskReliability.model.Task">
+        select
+            a.*
+        FROM
+            task a
+        where
+            a.is_delete = 0
+        <if test="productId!=null">
+            and a.product_id=${productId}
+        </if>
+        <if test="taskModelId!=null">
+            and a.id=${taskModelId}
+        </if>
+        ORDER BY a.task_sort
+    </select>
+    <select id="getTaskModelPhases" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskPhase">
+        select
+            b.*
+        FROM
+            task a
+            inner join task_phase b on b.task_id=a.id
+        where
+            a.is_delete = 0
+            and b.is_delete = 0
+        <if test="productId!=null">
+            and a.product_id=${productId}
+        </if>
+        <if test="taskModelId!=null">
+            and a.id=${taskModelId}
+        </if>
+        ORDER BY a.task_sort, b.phase_sort
+    </select>
+    <select id="getTaskModelPhaseModels" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskPhaseModel">
+        select
+            c.*
+        FROM
+            task a
+            inner join task_phase b on b.task_id=a.id
+            inner join task_phase_model c on c.phase_id=b.id
+            inner join operat_condit d on d.id=c.operat_condit_id
+        where
+            a.is_delete = 0
+            and b.is_delete = 0
+            and c.is_delete = 0
+            and d.is_delete = 0
+        <if test="productId!=null">
+            and a.product_id=${productId}
+            and d.product_id=${productId}
+        </if>
+        <if test="taskModelId!=null">
+            and a.id=${taskModelId}
+        </if>
+        ORDER BY a.task_sort, b.phase_sort
+    </select>
 </mapper>

--
Gitblit v1.9.1