From 664db98c9e8595ce4dd636a27f480e3a08b81ff5 Mon Sep 17 00:00:00 2001
From: xyc <jc_xiong@hotmail.com>
Date: 星期五, 21 二月 2025 11:13:51 +0800
Subject: [PATCH] 新增可忽略的维修时间
---
modules/mainPart/src/main/resources/mapper/taskReliability/SimulatAssessDao.xml | 133 ++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 127 insertions(+), 6 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..13730c8 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>
@@ -28,18 +27,19 @@
<select id="getChildren" resultType="com.zt.life.modules.mainPart.taskReliability.dto.ProductStatusDto">
select *
from (
- SELECT f.id, f.name, 0 as sort
+ SELECT f.id, f.name, 0 as sort, 1 as sameSbNum,f.product_type
FROM product_model f
WHERE f.id = ${productId}
AND f.is_delete = 0
union
- SELECT f.id, f.name, f.sort
+ SELECT f.id, f.name, f.sort, g.basic_unit_num as sameSbNum,f.product_type
FROM `task_phase` a,
task_phase_model b,
operat_condit c,
operat_condit_model d,
model_rbd_node e,
- product_model f
+ product_model f,
+ param_data g
WHERE a.task_id = ${taskId}
and d.product_id = ${productId}
AND a.is_delete = 0
@@ -52,6 +52,8 @@
AND e.is_delete = 0
AND f.id = e.node_id
AND f.is_delete = 0
+ AND g.product_id = f.id
+ AND g.is_delete = 0
GROUP BY f.id, f.name, f.sort
) as f
ORDER BY f.sort
@@ -66,7 +68,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 +125,123 @@
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>
+ <select id="getModel" resultType="com.zt.life.modules.mainPart.taskReliability.model.OperatConditModel">
+ SELECT d.product_id,
+ d.model_id,
+ e.content
+ FROM task a,
+ task_phase b,
+ `task_phase_model` c,
+ operat_condit_model d,
+ model_rbd e
+ WHERE a.id = ${taskId}
+ AND a.IS_DELETE = 0
+ AND b.task_id = a.id
+ AND b.IS_DELETE = 0
+ AND c.phase_id = b.id
+ AND c.operat_condit_duration_rate > 0
+ AND c.IS_DELETE = 0
+ AND d.operat_condit_id = c.operat_condit_id
+ AND d.IS_DELETE = 0
+ AND e.id = d.model_id
+ AND e.IS_DELETE = 0
+ </select>
+ <select id="getNode" resultType="com.zt.life.modules.mainPart.taskReliability.dto.verifyDto">
+ SELECT c.`NAME`,
+ c.id,
+ b.task_mtbcf_regulate as mtbf
+ FROM `model_rbd_node` a,
+ param_data b,
+ product_model c
+ WHERE a.node_id = c.id
+ and a.model_id = ${modelId}
+ AND c.id = b.product_id
+ AND a.is_delete = 0
+ AND b.is_delete = 0
+ AND c.is_delete = 0
+ </select>
+ <select id="getVoteNum" resultType="java.lang.Integer">
+ select vote_num
+ from algorithm
+ where is_delete = 0
+ and model_id = ${modelId}
+ and model_type = 'vote'
+ and vote_num is not null
+ limit 1
+ </select>
+
+ <select id="getProcessList" resultType="com.zt.life.modules.mainPart.taskReliability.model.SimulatAssess">
+ select *
+ from simulat_assess
+ where IS_DELETE = 0
+ and pid is not null
+ <if test="isAlive">
+ and process_is_alive=1
+ </if>
+ order by process_start_time desc
+ </select>
</mapper>
--
Gitblit v1.9.1