<?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.incidentManage.repository.AccidentExpressFileInfoRepository">
|
|
<insert id="addAccidentExpressFile">
|
insert into accident_express_file
|
<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="accidentExpressId != null ">accident_express_id,</if>
|
<if test="fileUrl != null and fileUrl != ''">file_url,</if>
|
<if test="fileName != null and fileName != ''">file_name</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="accidentExpressId != null ">#{accidentExpressId},</if>
|
<if test="fileUrl != null and fileUrl != ''">#{fileUrl},</if>
|
<if test="fileName != null and fileName != ''">#{fileName}</if>
|
</trim>
|
</insert>
|
|
<resultMap type="com.gkhy.safePlatform.incidentManage.entity.AccidentExpressFileInfoDO" id="AccidentExpressFileInfoDOResult">
|
<id column="id" property="id" jdbcType="BIGINT"/>
|
<result column="accident_express_id" property="accidentExpressId" />
|
<result column="file_url" property="fileUrl" />
|
<result column="file_name" property="fileName" />
|
</resultMap>
|
|
<select id="selectByAccidentExpressId" resultMap="AccidentExpressFileInfoDOResult">
|
select id,`accident_express_id`,`file_url`,`file_name` from accident_express_file where del_flag = 0 and accident_express_id = #{accidentExpressId}
|
</select>
|
|
<update id = "deleteAccidentExpressFileByIds" >
|
update accident_express_file set del_flag = 1 where id in
|
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</update>
|
|
<update id="deleteAccidentExpressFileByAccidentExpressId">
|
update accident_express_file set del_flag = 1 where accident_express_id = #{accidentExpressId}
|
</update>
|
|
</mapper>
|