jinlin
2025-03-01 86f02fee03614fef275c6e0c355d73318ca3025e
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
131
132
133
<?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.teamGroup.dao.SysTeamGroupClassDao">
 
    <select id="getAll" resultType="com.example.server.teamGroup.model.SysTeamGroupClass">
        SELECT
            a.*
        FROM
            DJ_SYS_TEAMGROUP_CLASS a
        WHERE
            a.is_delete = 0
            <if test="localArea!=null and (localArea=='sy' or localArea=='qd' or localArea=='hld')">
                and a.area=#{localArea}
            </if>
        ORDER BY
            a.area desc, a.sort
    </select>
 
    <select id="getMapAll" resultType="com.example.client.entity.MapData">
        SELECT
            a.id,a.name
        FROM
            DJ_SYS_TEAMGROUP_CLASS a
        WHERE
            a.is_delete = 0
        <if test="localArea!=null and (localArea=='sy' or localArea=='qd')">
            and a.area=#{localArea}
        </if>
        ORDER BY
        a.area desc, a.sort
    </select>
    <select id="getAllByCriteria" resultType="com.example.server.teamGroup.model.SysTeamGroupClass">
        SELECT
        a.*,c.name AS productName
        from
        DJ_SYS_TEAMGROUP_CLASS a
        left join view_zt_boat_tree c on concat(a.product_id) = c.product_id
        WHERE
        a.is_delete = 0
        <if test="dictType!=null and dictType!=''">
            and a.dict_type=#{dictType}
        </if>
        <if test="model!=null and model!=''">
            and a.product_id=#{model}
        </if>
        <if test="localArea!=null and (localArea=='sy' or localArea=='qd')">
            and a.area=#{localArea}
        </if>
        ORDER BY
        a.area desc, a.sort
    </select>
 
    <select id="getTeamGroupIdByNames" resultType="java.lang.Long">
        SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE  a.is_delete=0 AND a.name IN
        <foreach item="item" index="index" collection="list"
                 open="(" separator="," close=")">
            #{item}
        </foreach>
        <if test="localArea!=null and (localArea=='sy' or localArea=='qd')">
            and a.area=#{localArea}
        </if>
    </select>
 
    <select id="getTeamGroupIdByName" resultType="java.lang.Long">
        SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE  a.is_delete=0 AND a.name = #{name}
        <if test="localArea!=null and (localArea=='sy' or localArea=='qd')">
            and a.area=#{localArea}
        </if>
    </select>
    <select id="getBzTeamGroupIdByName" resultType="java.lang.Long">
         SELECT a.id FROM DJ_SYS_TEAMGROUP_CLASS a WHERE  a.is_delete=0 AND a.name = #{name}
        <if test="localArea!=null and (localArea=='sy' or localArea=='qd')">
            and a.area=#{localArea}
        </if>
    </select>
 
    <select id="getTeamGroupClassList" resultType="com.example.server.teamGroup.model.SysTeamGroupClass">
         SELECT
            a.id,a.name
        FROM
            DJ_SYS_TEAMGROUP_CLASS a
        WHERE
            a.is_delete = 0
            and area = 'sy'
            and pid != 0
            order by sort
    </select>
    <select id="getList" resultType="com.example.client.dto.JComboBoxItem">
        SELECT
            a.id,
            CASE
                WHEN a.pid != 0  THEN  b.name || '/' || a.name
                ELSE a.name
                END AS name
        FROM
            DJ_SYS_TEAMGROUP_CLASS a
                LEFT JOIN
            DJ_SYS_TEAMGROUP_CLASS b ON a.pid = b.id
        WHERE
            a.is_delete = 0
          AND a.pid != 0
        ORDER BY
            a.sort;
    </select>
    <select id="getTeamList" resultType="com.example.client.dto.JComboBoxItem">
        SELECT
            a.id,
            a.name
        FROM
            DJ_SYS_TEAMGROUP_CLASS a
        WHERE
            a.is_delete = 0
          AND a.pid != 0
        <if test="pid!=null">
            AND a.pid = ${pid}
        </if>
        ORDER BY
            a.sort;
    </select>
    <select id="getDeptList" resultType="com.example.client.dto.JComboBoxItem">
        SELECT
            a.id,
            a.name
        FROM
            DJ_SYS_TEAMGROUP_CLASS a
        WHERE
            a.is_delete = 0
          AND a.pid = 0
        ORDER BY
            a.sort;
    </select>
</mapper>