From 3ecb68c427a627ad8e90d8c555655e7724be2d96 Mon Sep 17 00:00:00 2001
From: jinlin <jinlin>
Date: 星期五, 06 九月 2024 11:06:12 +0800
Subject: [PATCH] 修改
---
modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml | 193 ++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 162 insertions(+), 31 deletions(-)
diff --git a/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml b/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml
index 81f5f6a..5ad395b 100644
--- a/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml
+++ b/modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml
@@ -4,12 +4,11 @@
<mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.SimulatAssessDao">
<select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess">
- select *
+ 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 name desc
+ order by CREATE_DATE desc
</select>
<select id="getNumById" resultType="java.lang.Integer">
select COUNT(*)
@@ -26,33 +25,165 @@
and a.IS_DELETE = 0
</select>
<select id="getChildren" resultType="com.zt.life.modules.mainPart.taskReliability.dto.ProductStatusDto">
- select * from (
- SELECT f.id,f.name, 0 as sort
- FROM product_model f
- WHERE f.id = 1813102074724945921
- AND f.is_delete = 0
- union
- SELECT f.id,f.name,f.sort
- FROM `task_phase` a,
- task_phase_model b,
- operat_condit c,
- operat_condit_model d,
- model_rbd_node e,
- product_model f
- WHERE a.task_id = ${taskId}
- and d.product_id = ${productId}
- 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.is_delete = 0
- GROUP BY f.id,f.name,f.sort
- ) as f
+ select *
+ from (
+ SELECT f.id, f.name, 0 as sort
+ FROM product_model f
+ WHERE f.id = ${productId}
+ AND f.is_delete = 0
+ union
+ SELECT f.id, f.name, f.sort
+ FROM `task_phase` a,
+ task_phase_model b,
+ operat_condit c,
+ operat_condit_model d,
+ model_rbd_node e,
+ product_model f
+ WHERE a.task_id = ${taskId}
+ and d.product_id = ${productId}
+ 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.is_delete = 0
+ GROUP BY f.id, f.name, f.sort
+ ) as f
ORDER BY f.sort
</select>
+ <select id="getTaskPhaseModelByTaskId"
+ resultType="com.zt.life.modules.mainPart.taskReliability.model.SimulatAssessTaskPhaseModel">
+ select *
+ from simulat_assess_task_phase_model
+ where is_delete = 0
+ and task_id = ${taskId}
+ order by sort
+ </select>
+ <select id="getTimeDiagram" resultType="com.zt.life.modules.mainPart.taskReliability.model.TimeDiagram">
+ select *
+ from time_diagram
+ where is_delete = 0
+ <if test="projectId!=null and projectId!=''">
+ and PROJECT_ID = #{projectId}
+ </if>
+ <if test="diagramId!=null and diagramId!=''">
+ and DIAGRAM_ID = #{diagramId}
+ </if>
+ <if test="hasPublish!=null and hasPublish!=''">
+ and HAS_PUBLISH = #{hasPublish}
+ </if>
+ </select>
+ <select id="getModelListOld" resultType="com.zt.life.modules.mainPart.taskReliability.dto.ModelDto">
+ SELECT a.id AS phase_id,
+ a.phase_name,
+ a.phase_duration_rate,
+ b.operat_condit_duration_rate,
+ b.operat_condit_id,
+ c.NAME AS operat_condit_name,
+ d.model_id,
+ e.model_name
+ FROM `task_phase` a,
+ task_phase_model b,
+ operat_condit c,
+ operat_condit_model d,
+ model_rbd e
+ WHERE a.task_id = ${taskId}
+ and d.product_id = ${productId}
+ 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.is_delete = 0
+ and d.model_id = e.id
+ order by c.CREATE_DATE
+ </select>
+ <select id="getModelList"
+ resultType="com.zt.life.modules.mainPart.taskReliability.model.SimulatAssessTaskPhaseModel">
+ SELECT *
+ FROM simulat_assess_task_phase_model
+ WHERE fz_id = ${fzId}
+ AND is_delete = 0
+ order by sort
+ </select>
+ <select id="getModelByProductGk" resultType="com.zt.life.modules.mainPart.taskReliability.model.ModelRbd">
+ select a.*
+ from model_rbd a,
+ operat_condit_model b
+ where a.id = b.model_id
+ and b.operat_condit_id = ${gkId}
+ and b.product_id = ${productId}
+ and a.is_delete = 0
+ 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