wang-hao-jie
2022-08-25 57dcc73636bb7d8dce89c808eb8cc988a7512264
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
<?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.ruoyi.station.mapper.MjTeamMapper">
    
    <resultMap type="MjTeam" id="MjTeamResult">
        <result property="id"    column="id"    />
        <result property="teamName"    column="team_name"    />
        <result property="teamNumber"    column="team_number"    />
        <result property="areaNumber"    column="area_number"    />
        <result property="descriptions"    column="descriptions"    />
        <result property="equipmentUpdateStatus"    column="equipment_update_status"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateBy"    column="update_by"    />
        <result property="delFlag"    column="del_flag"    />
    </resultMap>
 
    <sql id="selectMjTeamVo">
        select id, team_name, team_number, area_number, descriptions, equipment_update_status, create_time, update_time, create_by, update_by, del_flag from mj_team
    </sql>
 
    <select id="selectMjTeamList" parameterType="MjTeam" resultMap="MjTeamResult">
        <include refid="selectMjTeamVo"/>
        <where>
            <if test="id != null and id != ''">id  = #{id}</if>
            <if test="teamName != null  and teamName != ''"> and team_name like concat('%', #{teamName}, '%')</if>
            <if test="teamNumber != null "> and team_number = #{teamNumber}</if>
            <if test="areaNumber != null "> and area_number = #{areaNumber}</if>
            <if test="descriptions != null  and descriptions != ''"> and descriptions = #{descriptions}</if>
            <if test="equipmentUpdateStatus != null "> and equipment_update_status = #{equipmentUpdateStatus}</if>
        </where>
    </select>
    
    <select id="selectMjTeamById" parameterType="String" resultMap="MjTeamResult">
        <include refid="selectMjTeamVo"/>
        where id = #{id}
    </select>
 
    <select id="getName" resultType="java.lang.String">
        select team_name from mj_team where id = #{orderId}
    </select>
 
    <insert id="insertMjTeam" parameterType="MjTeam">
        insert into mj_team
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="teamName != null">team_name,</if>
            <if test="teamNumber != null">team_number,</if>
            <if test="areaNumber != null">area_number,</if>
            <if test="descriptions != null">descriptions,</if>
            <if test="equipmentUpdateStatus != null">equipment_update_status,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="createBy != null">create_by,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="delFlag != null">del_flag,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="teamName != null">#{teamName},</if>
            <if test="teamNumber != null">#{teamNumber},</if>
            <if test="areaNumber != null">#{areaNumber},</if>
            <if test="descriptions != null">#{descriptions},</if>
            <if test="equipmentUpdateStatus != null">#{equipmentUpdateStatus},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="delFlag != null">#{delFlag},</if>
         </trim>
    </insert>
 
    <update id="updateMjTeam" parameterType="MjTeam">
        update mj_team
        <trim prefix="SET" suffixOverrides=",">
            <if test="teamName != null">team_name = #{teamName},</if>
            <if test="teamNumber != null">team_number = #{teamNumber},</if>
            <if test="areaNumber != null">area_number = #{areaNumber},</if>
            <if test="descriptions != null">descriptions = #{descriptions},</if>
            <if test="equipmentUpdateStatus != null">equipment_update_status = #{equipmentUpdateStatus},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteMjTeamById" parameterType="String">
        delete from mj_team where id = #{id}
    </delete>
 
    <delete id="deleteMjTeamByIds" parameterType="String">
        delete from mj_team where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>