kongzy
2024-09-23 d015cc0b48ca51a2b93b6c60c91dc352a104b1e7
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<?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.gkhy.safePlatform.emergency.repository.EmergencyDrillEvaluationInfoRepository">
 
    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfoPageDO"
               id="emergencyDrillEvaluationInfoPageDOResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="drill_execute_id" property="drillExecuteId"/>
    </resultMap>
 
    <select id="selectEmergencyDrillEvaluationList" resultMap="emergencyDrillEvaluationInfoPageDOResult">
        SELECT
            a.id,
            a.drill_execute_id,
            c.drill_name AS drillName,
            c.drill_address AS drillAddress,
            c.drill_way AS drillWay,
            c.drill_level AS drillLevel,
            c.drill_plan_date AS drillPlanDate,
            b.`drill_record_date` AS drillRecordDate,
            d.`name` AS emergencyPlanName
        FROM
            emergency_drill_evaluation a
            LEFT JOIN emergency_drill_execute b ON a.drill_execute_id = b.id
            LEFT JOIN emergency_drill_plan c ON b.drill_plan_id = c.id
            LEFT JOIN emergency_plan d ON c.plan_id = d.id
        WHERE
            a.del_flag = 0
 
    </select>
 
    <insert id="addEmergencyDrillEvaluation" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfo"
            keyProperty="id" useGeneratedKeys="true">
        insert into emergency_drill_evaluation
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null ">id,</if>
            <if test="delFlag != null ">del_flag,</if>
            <if test="gmtCreate != null ">gmt_create,</if>
            <if test="gmtModitify != null ">gmt_moditify,</if>
            <if test="createUid != null ">create_uid,</if>
            <if test="updateUid != null ">update_uid,</if>
            <if test="drillExecuteId != null ">drill_execute_id,</if>
            <if test="suitable != null and suitable != ''">`suitable`,</if>
            <if test="sufficient != null and sufficient != ''">`sufficient`,</if>
            <if test="arrival != null and arrival != ''">`arrival`,</if>
            <if test="supplies != null and supplies != ''">`supplies`,</if>
            <if test="protection != null and protection != ''">`protection`,</if>
            <if test="whole != null and whole != ''">`whole`,</if>
            <if test="division != null and division != ''">`division`,</if>
            <if test="effect != null and effect != ''">`effect`,</if>
            <if test="report != null and report != ''">`report`,</if>
            <if test="safety != null and safety != ''">`safety`,</if>
            <if test="rescue != null and rescue != ''">`rescue`,</if>
            <if test="evacuate != null and evacuate != ''">`evacuate`,</if>
            <if test="needModify != null ">`need_modify`,</if>
            <if test="questionAndImprove != null and questionAndImprove != ''">`question_and_improve`,</if>
            <if test="modifyContent != null and modifyContent != ''">`modify_content`,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null ">#{id},</if>
            <if test="delFlag != null ">#{delFlag},</if>
            <if test="gmtCreate != null ">#{gmtCreate},</if>
            <if test="gmtModitify != null ">#{gmtModitify},</if>
            <if test="createUid != null ">#{createUid},</if>
            <if test="updateUid != null ">#{updateUid},</if>
            <if test="drillExecuteId != null ">#{drillExecuteId},</if>
            <if test="suitable != null and suitable != ''">#{suitable},</if>
            <if test="sufficient != null and sufficient != ''">#{sufficient},</if>
            <if test="arrival != null and arrival != ''">#{arrival},</if>
            <if test="supplies != null and supplies != ''">#{supplies},</if>
            <if test="protection != null and protection != ''">#{protection},</if>
            <if test="whole != null and whole != ''">#{whole},</if>
            <if test="division != null and division != ''">#{division},</if>
            <if test="effect != null and effect != ''">#{effect},</if>
            <if test="report != null and report != ''">#{report},</if>
            <if test="safety != null and safety != ''">#{safety},</if>
            <if test="rescue != null and rescue != ''">#{rescue},</if>
            <if test="evacuate != null and evacuate != ''">#{evacuate},</if>
            <if test="needModify != null ">#{needModify},</if>
            <if test="questionAndImprove != null and questionAndImprove != ''">#{questionAndImprove},</if>
            <if test="modifyContent != null and modifyContent != ''">#{modifyContent},</if>
        </trim>
    </insert>
 
 
    <resultMap type="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfoDetailDO" id="emergencyDrillEvaluationInfoDetailDOResult">
        <id column="id" property="id" jdbcType="BIGINT"/>
        <result column="drill_execute_id" property="drillExecuteId"/>
        <result column="suitable" property="suitable"/>
        <result column="sufficient" property="sufficient"/>
        <result column="arrival" property="arrival"/>
        <result column="supplies" property="supplies"/>
        <result column="protection" property="protection"/>
        <result column="whole" property="whole"/>
        <result column="division" property="division"/>
        <result column="effect" property="effect"/>
        <result column="report" property="report"/>
        <result column="safety" property="safety"/>
        <result column="rescue" property="rescue"/>
        <result column="evacuate" property="evacuate"/>
        <result column="need_modify" property="needModify"/>
        <result column="question_and_improve" property="questionAndImprove"/>
        <result column="modify_content" property="modifyContent"/>
    </resultMap>
 
    <select id="selectEmergencyDrillEvaluationByExecuteId" resultMap="emergencyDrillEvaluationInfoDetailDOResult">
    SELECT
        a.id,
        a.`drill_execute_id`,
        a.`suitable`,
        a.`sufficient`,
        a.`arrival`,
        a.supplies,
        a.protection,
        a.whole,
        a.division,
        a.effect,
        a.report,
        a.safety,
        a.rescue,
        a.evacuate,
        a.need_modify,
        a.question_and_improve,
        a.modify_content,
        b.drill_record_date AS drillRecordDate,
        b.record_user_uid AS recordUserUid,
        b.record_user_name AS recordUserName,
        b.process_desc AS processDesc,
        b.drill_plan_id AS drillPlanId,
        c.making_plan_date AS makingPlanDate,
        c.drill_plan_date AS drillPlanDate,
        c.making_user_uid AS makingUserUid,
        c.making_user_name AS makingUserName,
        c.making_department_id AS makingDepartmentId,
        c.department_id AS departmentId,
        c.drill_expense AS drillExpense,
        c.drill_level AS drillLevel,
        c.drill_address AS drillAddress,
        c.drill_name AS drillName,
        c.drill_way AS drillWay,
        c.insurance_measures AS insuranceMeasures,
        c.remark AS remark,
        c.purpose AS purpose,
        d.`name` AS emergencyPlanName
    FROM
        emergency_drill_evaluation a
        LEFT JOIN emergency_drill_execute b ON a.drill_execute_id = b.id
        LEFT JOIN emergency_drill_plan c ON b.drill_plan_id = c.id
        LEFT JOIN emergency_plan d ON c.plan_id = d.id
    WHERE
        a.del_flag = 0
        AND a.drill_execute_id = #{id}
    </select>
 
    <update id="updateEmergencyDrillEvaluation" parameterType="com.gkhy.safePlatform.emergency.entity.EmergencyDrillEvaluationInfo">
        update emergency_drill_evaluation
        <trim prefix="SET" suffixOverrides=",">
            <if test="gmtModitify != null ">gmt_moditify = #{gmtModitify},</if>
            <if test="updateUid != null ">update_uid = #{updateUid},</if>
            <if test="drillExecuteId != null ">drill_execute_id = #{drillExecuteId},</if>
            <if test="suitable != null and suitable != ''">suitable = #{suitable},</if>
            <if test="sufficient != null and sufficient != ''">sufficient = #{sufficient},</if>
            <if test="arrival != null and arrival != ''">arrival = #{arrival},</if>
            <if test="supplies != null and supplies != ''">supplies = #{supplies},</if>
            <if test="protection != null and protection != ''">protection = #{protection},</if>
            <if test="whole != null and whole != ''">whole = #{whole},</if>
            <if test="division != null and division != ''">division = #{division},</if>
            <if test="effect != null and effect != ''">effect = #{effect},</if>
            <if test="report != null and report != ''">report = #{report},</if>
            <if test="safety != null and safety != ''">safety = #{safety},</if>
            <if test="rescue != null and rescue != ''">rescue = #{rescue},</if>
            <if test="evacuate != null and evacuate != ''">evacuate = #{evacuate},</if>
            <if test="needModify != null ">need_modify = #{needModify},</if>
            <if test="questionAndImprove != null and questionAndImprove != ''">question_and_improve = #{questionAndImprove},</if>
            <if test="modifyContent != null and modifyContent != ''">modify_content = #{modifyContent},</if>
        </trim>
        where id = #{id}
    </update>
 
    <update id="deleteEmergencyDrillEvaluation">
        update emergency_drill_evaluation set del_flag = 1 where id = #{id}
    </update>
</mapper>