<?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.eutr.mapper.BisEutrOfflRecMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrOfflRec" id="BisEutrOfflRecResult">
        <result property="guid" column="guid"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="eutrThem" column="eutr_them"/>
        <result property="eutrType" column="eutr_type"/>
        <result property="eutrNum" column="eutr_num"/>
        <result property="eutrStartDate" column="eutr_start_date"/>
        <result property="eutrEndDate" column="eutr_end_date"/>
        <result property="eutrHuor" column="eutr_huor"/>
        <result property="eutrLoc" column="eutr_loc"/>
        <result property="eutrCont" column="eutr_cont"/>
        <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="selectBisEutrOfflRecVo">
        select guid, org_guid, eutr_them, eutr_type, eutr_num, eutr_start_date,
               eutr_end_date, eutr_huor, eutr_loc, eutr_cont, note,
               coll_time, upd_time, rec_pers
        from bis_eutr_offl_rec
    </sql>
    <select id="selectBisEutrOfflRecByGuid" parameterType="String" resultMap="BisEutrOfflRecResult">
        <include refid="selectBisEutrOfflRecVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrOfflRecList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrOfflRec" resultMap="BisEutrOfflRecResult">
        <include refid="selectBisEutrOfflRecVo"/>
        <where>
            <if test="eutrThem != null and eutrThem != ''">AND eutr_them like '%' || #{eutrThem} || '%'</if>
            <if test="eutrType != null and eutrType != ''">AND eutr_type = #{eutrType}</if>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
        </where>
    </select>
    <insert id="insertBisEutrOfflRec" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrOfflRec">
        insert into bis_eutr_offl_rec (
            guid, org_guid, eutr_them, eutr_type, eutr_num, eutr_start_date,
            eutr_end_date, eutr_huor, eutr_loc, eutr_cont, note,
            coll_time, upd_time, rec_pers
        ) values (
            #{guid}, #{orgGuid}, #{eutrThem}, #{eutrType}, #{eutrNum}, #{eutrStartDate},
            #{eutrEndDate}, #{eutrHuor}, #{eutrLoc}, #{eutrCont}, #{note},
            #{collTime}, #{updTime}, #{recPers}
        )
    </insert>
    <update id="updateBisEutrOfflRec" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrOfflRec">
        update bis_eutr_offl_rec
        <set>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="eutrThem != null">eutr_them = #{eutrThem},</if>
            <if test="eutrType != null">eutr_type = #{eutrType},</if>
            <if test="eutrNum != null">eutr_num = #{eutrNum},</if>
            <if test="eutrStartDate != null">eutr_start_date = #{eutrStartDate},</if>
            <if test="eutrEndDate != null">eutr_end_date = #{eutrEndDate},</if>
            <if test="eutrHuor != null">eutr_huor = #{eutrHuor},</if>
            <if test="eutrLoc != null">eutr_loc = #{eutrLoc},</if>
            <if test="eutrCont != null">eutr_cont = #{eutrCont},</if>
            <if test="note != null">note = #{note},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisEutrOfflRecByGuid" parameterType="String">
        delete from bis_eutr_offl_rec where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrOfflRecByGuids" parameterType="String">
        delete from bis_eutr_offl_rec where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
