双重预防项目-国泰新华二开定制版
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
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
<?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.accidentInformation.mapper.AccidentInformationMapper">
    
    <resultMap type="com.ruoyi.project.dc.accidentInformation.domain.AccidentInformation" id="AccidentInformationResult">
        <result property="accidentId"    column="accident_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="accidentTimeOfOccurrence"    column="accident_time_of_occurrence"    />
        <result property="accidentNumberOfMinorInjuries"    column="accident_number_of_minor_injuries"    />
        <result property="accidentNumberOfSeriouslyInjured"    column="accident_number_of_seriously_injured"    />
        <result property="accidentDeathToll"    column="accident_death_toll"    />
        <result property="accidentNumberOfPeoplePoisoned"    column="accident_number_of_people_poisoned"    />
        <result property="accidentTypeOfAccident"    column="accident_type_of_accident"    />
        <result property="accidentAccidentDetails"    column="accident_accident_details"    />
        <result property="accidentOwnedFile"    column="accident_owned_file"    />
        <result property="accidentOwnedPicture"    column="accident_owned_picture"    />
    </resultMap>
 
    <sql id="selectAccidentInformationVo">
        select accident_id,company_id, create_by, create_user_id, create_time, update_by, update_user_id, update_time, remark, accident_time_of_occurrence, accident_number_of_minor_injuries, accident_number_of_seriously_injured, accident_death_toll, accident_number_of_people_poisoned, accident_type_of_accident, accident_accident_details, accident_owned_file, accident_owned_picture from dc_accident_information
    </sql>
 
    <select id="selectAccidentInformationList" parameterType="AccidentInformation" resultMap="AccidentInformationResult">
        <include refid="selectAccidentInformationVo"/>
        <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="params.beginAccidentTimeOfOccurrence != null and params.beginAccidentTimeOfOccurrence != '' and params.endAccidentTimeOfOccurrence != null and params.endAccidentTimeOfOccurrence != ''"> and accident_time_of_occurrence between #{params.beginAccidentTimeOfOccurrence} and #{params.endAccidentTimeOfOccurrence}</if>
            <if test="accidentNumberOfMinorInjuries != null "> and accident_number_of_minor_injuries = #{accidentNumberOfMinorInjuries}</if>
            <if test="accidentNumberOfSeriouslyInjured != null "> and accident_number_of_seriously_injured = #{accidentNumberOfSeriouslyInjured}</if>
            <if test="accidentDeathToll != null "> and accident_death_toll = #{accidentDeathToll}</if>
            <if test="accidentNumberOfPeoplePoisoned != null "> and accident_number_of_people_poisoned = #{accidentNumberOfPeoplePoisoned}</if>
            <if test="accidentTypeOfAccident != null  and accidentTypeOfAccident != ''"> and accident_type_of_accident = #{accidentTypeOfAccident}</if>
            <if test="accidentAccidentDetails != null  and accidentAccidentDetails != ''"> and accident_accident_details = #{accidentAccidentDetails}</if>
            <if test="accidentOwnedFile != null  and accidentOwnedFile != ''"> and accident_owned_file = #{accidentOwnedFile}</if>
            <if test="accidentOwnedPicture != null  and accidentOwnedPicture != ''"> and accident_owned_picture = #{accidentOwnedPicture}</if>
        </where>
    </select>
    
    <select id="selectAccidentInformationById" parameterType="Long" resultMap="AccidentInformationResult">
        <include refid="selectAccidentInformationVo"/>
        where accident_id = #{accidentId}
    </select>
        
    <insert id="insertAccidentInformation" parameterType="AccidentInformation" useGeneratedKeys="true" keyProperty="accidentId">
        insert into dc_accident_information
        <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="accidentTimeOfOccurrence != null ">accident_time_of_occurrence,</if>
            <if test="accidentNumberOfMinorInjuries != null ">accident_number_of_minor_injuries,</if>
            <if test="accidentNumberOfSeriouslyInjured != null ">accident_number_of_seriously_injured,</if>
            <if test="accidentDeathToll != null ">accident_death_toll,</if>
            <if test="accidentNumberOfPeoplePoisoned != null ">accident_number_of_people_poisoned,</if>
            <if test="accidentTypeOfAccident != null  and accidentTypeOfAccident != ''">accident_type_of_accident,</if>
            <if test="accidentAccidentDetails != null  and accidentAccidentDetails != ''">accident_accident_details,</if>
            <if test="accidentOwnedFile != null  and accidentOwnedFile != ''">accident_owned_file,</if>
            <if test="accidentOwnedPicture != null  and accidentOwnedPicture != ''">accident_owned_picture,</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="accidentTimeOfOccurrence != null ">#{accidentTimeOfOccurrence},</if>
            <if test="accidentNumberOfMinorInjuries != null ">#{accidentNumberOfMinorInjuries},</if>
            <if test="accidentNumberOfSeriouslyInjured != null ">#{accidentNumberOfSeriouslyInjured},</if>
            <if test="accidentDeathToll != null ">#{accidentDeathToll},</if>
            <if test="accidentNumberOfPeoplePoisoned != null ">#{accidentNumberOfPeoplePoisoned},</if>
            <if test="accidentTypeOfAccident != null  and accidentTypeOfAccident != ''">#{accidentTypeOfAccident},</if>
            <if test="accidentAccidentDetails != null  and accidentAccidentDetails != ''">#{accidentAccidentDetails},</if>
            <if test="accidentOwnedFile != null  and accidentOwnedFile != ''">#{accidentOwnedFile},</if>
            <if test="accidentOwnedPicture != null  and accidentOwnedPicture != ''">#{accidentOwnedPicture},</if>
         </trim>
    </insert>
 
    <update id="updateAccidentInformation" parameterType="AccidentInformation">
        update dc_accident_information
        <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="accidentTimeOfOccurrence != null ">accident_time_of_occurrence = #{accidentTimeOfOccurrence},</if>
            <if test="accidentNumberOfMinorInjuries != null ">accident_number_of_minor_injuries = #{accidentNumberOfMinorInjuries},</if>
            <if test="accidentNumberOfSeriouslyInjured != null ">accident_number_of_seriously_injured = #{accidentNumberOfSeriouslyInjured},</if>
            <if test="accidentDeathToll != null ">accident_death_toll = #{accidentDeathToll},</if>
            <if test="accidentNumberOfPeoplePoisoned != null ">accident_number_of_people_poisoned = #{accidentNumberOfPeoplePoisoned},</if>
            <if test="accidentTypeOfAccident != null  and accidentTypeOfAccident != ''">accident_type_of_accident = #{accidentTypeOfAccident},</if>
            <if test="accidentAccidentDetails != null  and accidentAccidentDetails != ''">accident_accident_details = #{accidentAccidentDetails},</if>
            <if test="accidentOwnedFile != null  and accidentOwnedFile != ''">accident_owned_file = #{accidentOwnedFile},</if>
            <if test="accidentOwnedPicture != null  and accidentOwnedPicture != ''">accident_owned_picture = #{accidentOwnedPicture},</if>
        </trim>
        where accident_id = #{accidentId}
    </update>
 
    <delete id="deleteAccidentInformationById" parameterType="Long">
        delete from dc_accident_information where accident_id = #{accidentId}
    </delete>
 
    <delete id="deleteAccidentInformationByIds" parameterType="String">
        delete from dc_accident_information where accident_id in 
        <foreach item="accidentId" collection="array" open="(" separator="," close=")">
            #{accidentId}
        </foreach>
    </delete>
    
</mapper>