jar
jinlin
2025-03-10 f0aae4b39afbcbb18fb5a0b32e3ca689662c5ca7
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<?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.example.server.progressTrack.dao.DjJdgzNetworkLevel3Dao">
    <delete id="deleteLevel3">
        update dj_jdgz_network_level3
        set is_delete=1
        where id = ${id};
    </delete>
    <delete id="deleteLevel3List">
        update dj_jdgz_network_level3_list
        set is_delete=1
        where network_id = ${id};
    </delete>
    <delete id="deleteByTeamGroup">
        update dj_jdgz_network_level3_list
        set is_delete=1
        where network_id in (select id from dj_jdgz_network_level3 where NAME = #{name})
          and TEAMGROUP_ID = ${teamGroupId};
        update dj_jdgz_network_level3
        set is_delete=1
        where NAME = ${name};
    </delete>
 
    <select id="getList" resultType="com.example.server.progressTrack.model.DjJdgzNetworkLevel3">
        SELECT
        a.*,
        b.PROCESS_NAME AS level1NodeName,
        c.project_name,
        d.PROCESS_NAME AS level2NodeName
        FROM `dj_jdgz_network_level3` a
        LEFT JOIN dj_jdgz_network_level1 c on c.ID = a.LEVEL1_NETWORK_ID
        LEFT JOIN dj_jdgz_network_level1_list b on b.NETWORK_ID = c.ID
        LEFT JOIN dj_jdgz_network_level2_list d on d.ID = a.LEVEL2_NODE_ID
        where
        a.is_delete = 0
        and b.is_delete = 0
        and c.is_delete = 0
        and d.is_delete = 0
        <if test="shipId!=null">
            and c.ship_id = ${shipId}
        </if>
        <if test="deptId!=null">
            and a.dept_id = ${deptId}
        </if>
        <if test="teamId!=null">
            and a.TEAMGROUP_ID = ${teamId}
        </if>
        <if test="cabinId!=null">
            and a.cabin_id LIKE '%${cabinId}%'
        </if>
        <if test="type!=null and type!=''">
            and a.type = #{type}
        </if>
        <if test="name!=null and name!=''">
            and a.name LIKE '%${name}%'
        </if>
        group by a.id
    </select>
 
    <select id="getNodeStatusData" resultType="com.example.server.progressTrack.Dto.NetworkNodeStatusDto">
        select ID, REQUIRED_COMPLETION_TIME, ACTUAL_COMPLETION, CURRENT_STATUS
        from dj_jdgz_network_level3_list
        where IS_DELETE = 0
          and NETWORK_ID = #{id};
    </select>
    <select id="getByNodeId" resultType="com.example.server.progressTrack.model.DjJdgzNetworkLevel3">
        select *
        from dj_jdgz_network_level3
        where is_delete = 0
          and LEVEL2_NODE_ID = ${id}
    </select>
    <select id="getListByLevel1"
            resultType="com.example.client.dto.JComboBoxItem">
        select *
        from dj_jdgz_network_level3
        where is_delete = 0
          and LEVEL1_network_id = ${level1NetworkId}
    </select>
    <select id="getListByExport" resultType="com.example.client.dto.JComboBoxItem">
        SELECT
        a.*
        FROM `dj_jdgz_network_level3` a
        where
        a.is_delete = 0
        <if test="projectId!=null">
            and a.LEVEL1_network_id = ${projectId}
        </if>
        <if test="deptId!=null">
            and a.dept_id = ${deptId}
        </if>
        <if test="teamId!=null">
            and a.TEAMGROUP_ID = ${teamId}
        </if>
    </select>
    <select id="getNodeList" resultType="com.example.server.progressTrack.Dto.TableNodeDto">
        SELECT
        b.name,
        a.NETWORK_ID,
        a.process_name,
        a.ID, a.REQUIRED_COMPLETION_TIME, a.ACTUAL_COMPLETION, a.CURRENT_STATUS
        FROM `dj_jdgz_network_level3_list` a
        LEFT JOIN dj_jdgz_network_level3 b on b.ID = a.NETWORK_ID
        LEFT JOIN dj_jdgz_network_level1 c on c.ID = b.LEVEL1_NETWORK_ID
        where
        a.is_delete = 0
        and b.is_delete = 0
        and c.is_delete = 0
        <if test="shipId!=null">
            and c.ship_id = ${shipId}
        </if>
        <if test="deptId!=null">
            and b.dept_id = ${deptId}
        </if>
        <if test="teamId!=null">
            and b.TEAMGROUP_ID = ${teamId}
        </if>
        <if test="cabinId!=null">
            and b.cabin_id LIKE '%${cabinId}%'
        </if>
        <if test="type!=null and type!=''">
            and b.type = #{type}
        </if>
        <if test="name!=null and name!=''">
            and b.name LIKE '%${name}%'
        </if>
    </select>
 
 
</mapper>