郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
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
<?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.gk.hotwork.Mapper.EmergencyPlanFileMapper" >
  <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.EmergencyPlanFile" >
    <!--          -->
    <id column="id" property="id" jdbcType="BIGINT" />
    <result column="valid_flag" property="validFlag" jdbcType="TINYINT" />
    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
    <result column="create_by" property="createBy" jdbcType="VARCHAR" />
    <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
    <result column="update_by" property="updateBy" jdbcType="VARCHAR" />
 
    <result column="file_url" jdbcType="VARCHAR" property="fileUrl" />
    <result column="file_name" jdbcType="VARCHAR" property="fileName" />
    <result column="emergency_plan_id" jdbcType="BIGINT" property="emergencyPlanId" />
 
  </resultMap>
 
  <sql id="Base_Column_List" >
    <!--          -->
    id, risk_unit_id, risk_event_name, valid_flag, create_time, create_by, update_time,
    update_by, risk_uint_name
  </sql>
 
  <select id="getByEmergencyPlanId" resultMap="BaseResultMap">
    select * from emergency_plan_file where valid_flag = 1 and emergency_plan_id=#{emergencyPlanId}
  </select>
 
  <update id="deleteById">
    update emergency_plan_file set
    valid_flag=0,
    update_time=#{updateTime},
    update_by=#{updateBy}
    where id=#{id}
  </update>
 
  <update id="deleteByEmergencyPlanId">
    update emergency_plan_file set
    valid_flag=0,
    update_time=#{updateTime},
    update_by=#{updateBy}
    where emergency_plan_id=#{emergencyPlanId}
  </update>
 
 
</mapper>