<?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.goldenwater.slaj.acci.mapper.BisAcciRepMapper">
    <resultMap type="com.goldenwater.slaj.acci.domain.BisAcciRep" id="BisAcciRepResult">
        <result property="guid" column="guid"/>
        <result property="acciGuid" column="acci_guid"/>
        <result property="repTime" column="rep_time"/>
        <result property="repPers" column="rep_pers"/>
        <result property="repPersTel" column="rep_pers_tel"/>
        <result property="missNum" column="miss_num"/>
        <result property="serInjNum" column="ser_inj_num"/>
        <result property="casNum" column="cas_num"/>
        <result property="econLoss" column="econ_loss"/>
        <result property="acciSitu" column="acci_situ"/>
        <result property="rescTreaMeas" column="resc_trea_meas"/>
        <result property="repStat" column="rep_stat"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
    </resultMap>
    <sql id="selectBisAcciRepVo">
        select guid, acci_guid, rep_time, rep_pers, rep_pers_tel, miss_num,
               ser_inj_num, cas_num, econ_loss, acci_situ, resc_trea_meas,
               rep_stat, note, coll_time, upd_time, rec_pers
        from bis_acci_rep
    </sql>
    <select id="selectBisAcciRepByGuid" parameterType="String" resultMap="BisAcciRepResult">
        <include refid="selectBisAcciRepVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisAcciRepList" parameterType="com.goldenwater.slaj.acci.domain.BisAcciRep" resultMap="BisAcciRepResult">
        <include refid="selectBisAcciRepVo"/>
        <where>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
            <if test="acciGuid != null and acciGuid != ''">AND acci_guid = #{acciGuid}</if>
            <if test="repPers != null and repPers != ''">AND rep_pers = #{repPers}</if>
            <if test="repStat != null and repStat != ''">AND rep_stat = #{repStat}</if>
            <if test="recPers != null and recPers != ''">AND rec_pers = #{recPers}</if>
        </where>
    </select>
    <insert id="insertBisAcciRep" parameterType="com.goldenwater.slaj.acci.domain.BisAcciRep">
        insert into bis_acci_rep (
            guid, acci_guid, rep_time, rep_pers, rep_pers_tel, miss_num,
            ser_inj_num, cas_num, econ_loss, acci_situ, resc_trea_meas,
            rep_stat, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{acciGuid}, #{repTime}, #{repPers}, #{repPersTel}, #{missNum},
            #{serInjNum}, #{casNum}, #{econLoss}, #{acciSitu}, #{rescTreaMeas},
            #{repStat}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisAcciRep" parameterType="com.goldenwater.slaj.acci.domain.BisAcciRep">
        update bis_acci_rep
        <set>
            <if test="acciGuid != null">acci_guid = #{acciGuid},</if>
            <if test="repTime != null">rep_time = #{repTime},</if>
            <if test="repPers != null">rep_pers = #{repPers},</if>
            <if test="repPersTel != null">rep_pers_tel = #{repPersTel},</if>
            <if test="missNum != null">miss_num = #{missNum},</if>
            <if test="serInjNum != null">ser_inj_num = #{serInjNum},</if>
            <if test="casNum != null">cas_num = #{casNum},</if>
            <if test="econLoss != null">econ_loss = #{econLoss},</if>
            <if test="acciSitu != null">acci_situ = #{acciSitu},</if>
            <if test="rescTreaMeas != null">resc_trea_meas = #{rescTreaMeas},</if>
            <if test="repStat != null">rep_stat = #{repStat},</if>
            <if test="note != null">note = #{note},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisAcciRepByGuid" parameterType="String">
        delete from bis_acci_rep where guid = #{guid}
    </delete>
    <delete id="deleteBisAcciRepByGuids" parameterType="String">
        delete from bis_acci_rep where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
