<?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.BisAcciExpRepMapper">
    <resultMap type="com.goldenwater.slaj.acci.domain.BisAcciExpRep" id="BisAcciExpRepResult">
        <result property="guid" column="guid"/>
        <result property="repOrgGuid" column="rep_org_guid"/>
        <result property="acciGuid" column="acci_guid"/>
        <result property="repTime" column="rep_time"/>
        <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="selectBisAcciExpRepVo">
        select guid, rep_org_guid, acci_guid, rep_time, note, coll_time, upd_time, rec_pers
        from bis_acci_exp_rep
    </sql>
    <select id="selectBisAcciExpRepByGuid" parameterType="String" resultMap="BisAcciExpRepResult">
        <include refid="selectBisAcciExpRepVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisAcciExpRepList" parameterType="com.goldenwater.slaj.acci.domain.BisAcciExpRep" resultMap="BisAcciExpRepResult">
        <include refid="selectBisAcciExpRepVo"/>
        <where>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
            <if test="repOrgGuid != null and repOrgGuid != ''">AND rep_org_guid = #{repOrgGuid}</if>
            <if test="acciGuid != null and acciGuid != ''">AND acci_guid = #{acciGuid}</if>
            <if test="recPers != null and recPers != ''">AND rec_pers = #{recPers}</if>
        </where>
    </select>
    <insert id="insertBisAcciExpRep" parameterType="com.goldenwater.slaj.acci.domain.BisAcciExpRep">
        insert into bis_acci_exp_rep (
            guid, rep_org_guid, acci_guid, rep_time, note, coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{repOrgGuid}, #{acciGuid}, #{repTime}, #{note}, #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisAcciExpRep" parameterType="com.goldenwater.slaj.acci.domain.BisAcciExpRep">
        update bis_acci_exp_rep
        <set>
            <if test="repOrgGuid != null">rep_org_guid = #{repOrgGuid},</if>
            <if test="acciGuid != null">acci_guid = #{acciGuid},</if>
            <if test="repTime != null">rep_time = #{repTime},</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="deleteBisAcciExpRepByGuid" parameterType="String">
        delete from bis_acci_exp_rep where guid = #{guid}
    </delete>
    <delete id="deleteBisAcciExpRepByGuids" parameterType="String">
        delete from bis_acci_exp_rep where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
