xyc
2024-08-02 300b8b3de2fbb30cecf30efe13930836167fe692
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?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.TaskDao">
 
    <select id="getList" resultType="com.zt.life.modules.mainPart.taskReliability.model.Task">
        select a.*
        FROM
        task a
        <where>
            a.is_delete = 0
            and a.product_id=${productId}
            <if test="whereSql!=null">
                and ${whereSql}
            </if>
        </where>
        <if test="orderBySql!=null">
            ORDER BY ${orderBySql}
        </if>
    </select>
    <select id="getTaskList" resultType="com.zt.life.modules.mainPart.taskReliability.model.Task">
        select a.id,a.task_name as name
        from task a
        where
        a.is_delete = 0
        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>