双重预防项目-国泰新华二开定制版
SZH
2022-08-20 f9f0687195e0fe349185437d22c495d74c8d4a20
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
<?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.project.dc.emergencyExpert.mapper.EmergencyExpertMapper">
    
    <resultMap type="com.ruoyi.project.dc.emergencyExpert.domain.EmergencyExpert" id="EmergencyExpertResult">
        <result property="emergencyExpertId"    column="emergency_expert_id"    />
        <result property="companyId" column="company_id"/>
        <result property="createBy"    column="create_by"    />
        <result property="createUserId"    column="create_user_id"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateUserId"    column="update_user_id"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
        <result property="expertUnit"    column="expert_unit"    />
        <result property="expertName"    column="expert_name"    />
        <result property="expertPhone"    column="expert_phone"    />
        <result property="expertExpertise"    column="expert_expertise"    />
    </resultMap>
 
    <sql id="selectEmergencyExpertVo">
        select emergency_expert_id, company_id, create_by, create_user_id, create_time, update_by, update_user_id, update_time, remark, expert_unit, expert_name, expert_phone, expert_expertise from dc_emergency_expert
    </sql>
 
    <select id="selectEmergencyExpertList" parameterType="EmergencyExpert" resultMap="EmergencyExpertResult">
        <include refid="selectEmergencyExpertVo"/>
        <where>
            <if test="companyId != null "> and company_id = #{companyId}</if>
            <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
            <if test="updateUserId != null "> and update_user_id = #{updateUserId}</if>
            <if test="expertUnit != null  and expertUnit != ''"> and expert_unit = #{expertUnit}</if>
            <if test="expertName != null  and expertName != ''"> and expert_name like concat('%', #{expertName}, '%')</if>
            <if test="expertPhone != null  and expertPhone != ''"> and expert_phone = #{expertPhone}</if>
            <if test="expertExpertise != null  and expertExpertise != ''"> and expert_expertise = #{expertExpertise}</if>
        </where>
    </select>
    
    <select id="selectEmergencyExpertById" parameterType="Long" resultMap="EmergencyExpertResult">
        <include refid="selectEmergencyExpertVo"/>
        where emergency_expert_id = #{emergencyExpertId}
    </select>
        
    <insert id="insertEmergencyExpert" parameterType="EmergencyExpert" useGeneratedKeys="true" keyProperty="emergencyExpertId">
        insert into dc_emergency_expert
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="companyId != null ">company_id,</if>
            <if test="createBy != null  and createBy != ''">create_by,</if>
            <if test="createUserId != null ">create_user_id,</if>
            <if test="createTime != null ">create_time,</if>
            <if test="updateBy != null  and updateBy != ''">update_by,</if>
            <if test="updateUserId != null ">update_user_id,</if>
            <if test="updateTime != null ">update_time,</if>
            <if test="remark != null  and remark != ''">remark,</if>
            <if test="expertUnit != null  and expertUnit != ''">expert_unit,</if>
            <if test="expertName != null  and expertName != ''">expert_name,</if>
            <if test="expertPhone != null  and expertPhone != ''">expert_phone,</if>
            <if test="expertExpertise != null  and expertExpertise != ''">expert_expertise,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="companyId != null ">#{companyId},</if>
            <if test="createBy != null  and createBy != ''">#{createBy},</if>
            <if test="createUserId != null ">#{createUserId},</if>
            <if test="createTime != null ">#{createTime},</if>
            <if test="updateBy != null  and updateBy != ''">#{updateBy},</if>
            <if test="updateUserId != null ">#{updateUserId},</if>
            <if test="updateTime != null ">#{updateTime},</if>
            <if test="remark != null  and remark != ''">#{remark},</if>
            <if test="expertUnit != null  and expertUnit != ''">#{expertUnit},</if>
            <if test="expertName != null  and expertName != ''">#{expertName},</if>
            <if test="expertPhone != null  and expertPhone != ''">#{expertPhone},</if>
            <if test="expertExpertise != null  and expertExpertise != ''">#{expertExpertise},</if>
         </trim>
    </insert>
 
    <update id="updateEmergencyExpert" parameterType="EmergencyExpert">
        update dc_emergency_expert
        <trim prefix="SET" suffixOverrides=",">
            <if test="companyId != null ">company_id = #{companyId},</if>
            <if test="createBy != null  and createBy != ''">create_by = #{createBy},</if>
            <if test="createUserId != null ">create_user_id = #{createUserId},</if>
            <if test="createTime != null ">create_time = #{createTime},</if>
            <if test="updateBy != null  and updateBy != ''">update_by = #{updateBy},</if>
            <if test="updateUserId != null ">update_user_id = #{updateUserId},</if>
            <if test="updateTime != null ">update_time = #{updateTime},</if>
            <if test="remark != null  and remark != ''">remark = #{remark},</if>
            <if test="expertUnit != null  and expertUnit != ''">expert_unit = #{expertUnit},</if>
            <if test="expertName != null  and expertName != ''">expert_name = #{expertName},</if>
            <if test="expertPhone != null  and expertPhone != ''">expert_phone = #{expertPhone},</if>
            <if test="expertExpertise != null  and expertExpertise != ''">expert_expertise = #{expertExpertise},</if>
        </trim>
        where emergency_expert_id = #{emergencyExpertId}
    </update>
 
    <delete id="deleteEmergencyExpertById" parameterType="Long">
        delete from dc_emergency_expert where emergency_expert_id = #{emergencyExpertId}
    </delete>
 
    <delete id="deleteEmergencyExpertByIds" parameterType="String">
        delete from dc_emergency_expert where emergency_expert_id in 
        <foreach item="emergencyExpertId" collection="array" open="(" separator="," close=")">
            #{emergencyExpertId}
        </foreach>
    </delete>
    
</mapper>