From 089b302259e03ce52fc102bcf168d1fa048fffe9 Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期四, 26 九月 2024 16:38:28 +0800 Subject: [PATCH] 修改 --- modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml | 69 +++++++++++++++++++++++++++++++++- 1 files changed, 66 insertions(+), 3 deletions(-) diff --git a/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml b/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml index 6d3d256..fe82e4a 100644 --- a/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml +++ b/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml @@ -6,8 +6,7 @@ <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess"> select id, CONCAT_WS(' ', name, CREATE_DATE) AS name from simulat_assess - where product_id = ${productId} - and task_model_id = ${taskModelId} + where task_model_id = ${taskModelId} and IS_DELETE = 0 order by CREATE_DATE desc </select> @@ -66,7 +65,7 @@ </select> <select id="getTimeDiagram" resultType="com.zt.life.modules.mainPart.taskReliability.model.TimeDiagram"> select * - from time_diagram + from time_diagram_temp where is_delete = 0 <if test="projectId!=null and projectId!=''"> and PROJECT_ID = #{projectId} @@ -123,4 +122,68 @@ and b.is_delete = 0 limit 1 </select> + <select id="getProductList" resultType="com.zt.life.modules.mainPart.taskReliability.dto.WeakDto"> + SELECT id, + pid, + NAME, + product_type, + sum(timeRate) AS timeRate, + sort + FROM ( + SELECT f.id, + null as pid, + f.NAME, + f.product_type, + 1 AS timeRate, + 0 AS sort + FROM product_model f + WHERE f.id = ${productId} + AND f.is_delete = 0 + UNION + SELECT f.id, + f.pid, + f.NAME, + f.product_type, + CASE + + WHEN f.product_type = 5 + AND g.reliab_distrib_type = 1 THEN + a.phase_duration_rate * b.operat_condit_duration_rate * g.task_mtbcf_operating_ratio + ELSE a.phase_duration_rate * b.operat_condit_duration_rate + END AS timeRate, + f.sort + FROM `task_phase` a, + task_phase_model b, + operat_condit c, + operat_condit_model d, + model_rbd_node e, + product_model f + left join param_data g on g.product_id = f.id + AND g.IS_DELETE = 0 + WHERE a.task_id = ${taskId} + AND b.phase_id = a.id + AND b.is_delete = 0 + AND a.is_delete = 0 + AND b.is_delete = 0 + AND c.id = b.operat_condit_id + AND c.is_delete = 0 + AND d.operat_condit_id = c.id + AND d.is_delete = 0 + AND e.model_id = d.model_id + AND e.is_delete = 0 + AND f.id = e.node_id + AND f.ship_id = ${productId} + AND f.is_delete = 0 + ) b + GROUP BY id + order by sort + </select> + <select id="getByTaskId" resultType="com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess"> + select * + from simulat_assess + where task_model_id = ${taskModelId} + and IS_DELETE = 0 + order by CREATE_DATE desc + limit 1 + </select> </mapper> -- Gitblit v1.9.1