jinlin
2024-06-24 3ca8ce266bf5b06556d80c78b31405e7a54aa4e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 
<mapper namespace="com.zt.life.modules.mainPart.taskReliability.dao.TaskBinoParamDao">
 
    <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.TaskBinoParam">
        select a.task_id
             , a.phase_id
             , a.phase_name
             , a.phase_sort
             , a.operat_condit_id
             , a.operat_condit_name
             , a.model_id
             , a.product_name
             , a.product_id
             , case
                   when b.success_rate is not null then b.success_rate
                   else a.task_mtbcf_regul_succ_rate end as success_rate
             , b.id
             , b.simulat_times
             , b.success_times
        from (
                 SELECT a.task_id
                      , a.id   as phase_id
                      , a.phase_name
                      , a.phase_sort
                      , b.operat_condit_id
                      , c.name as operat_condit_name
                      , d.model_id
                      , f.name as product_name
                      , f.id   as product_id
                      , g.task_mtbcf_regul_succ_rate
                 FROM `task_phase` a
                    , task_phase_model b
                    , operat_condit c
                    , operat_condit_model d
                    , model_rbd_node e
                    , product_model f
                    , param_data g
                 where a.task_id = ${taskId}
                   and a.is_delete = 0
                   and b.phase_id = a.id
                   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
                   and g.product_id = f.id
                   and g.is_delete = 0
                   and g.reliab_distrib_type = 2
             ) a
                 left join task_bino_param b on
                b.task_id = ${taskId}
                and b.phase_id = a.phase_id
                and b.operat_condit_id = a.operat_condit_id
                and b.model_id = a.model_id
                and b.product_id = a.product_id
        order by a.phase_id, a.operat_condit_id, a.product_id
    </select>
 
</mapper>