<?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.BisEutrRecMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.BisEutrRec" id="BisEutrRecResult">
        <result property="guid" column="guid"/>
        <result property="courGuid" column="cour_guid"/>
        <result property="planGuid" column="plan_guid"/>
        <result property="trTime" column="tr_time"/>
        <result property="trAddr" column="tr_addr"/>
        <result property="trCont" column="tr_cont"/>
        <result property="trType" column="tr_type"/>
        <result property="trStat" column="tr_stat"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="teacName" column="teac_name"/>
        <result property="trPersNum" column="tr_pers_num"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
        <result property="toDate" column="to_date"/>
    </resultMap>
    <sql id="selectBisEutrRecVo">
        select guid, cour_guid, plan_guid, tr_time, tr_addr, tr_cont,
               tr_type, tr_stat, org_guid, teac_name, tr_pers_num, note,
               coll_time, upd_time, rec_pers, to_date
        from bis_eutr_rec
    </sql>
    <select id="selectBisEutrRecByGuid" parameterType="String" resultMap="BisEutrRecResult">
        <include refid="selectBisEutrRecVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisEutrRecList" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrRec" resultMap="BisEutrRecResult">
        <include refid="selectBisEutrRecVo"/>
        <where>
            <if test="courGuid != null and courGuid != ''">AND cour_guid = #{courGuid}</if>
            <if test="trType != null and trType != ''">AND tr_type = #{trType}</if>
            <if test="trStat != null and trStat != ''">AND tr_stat = #{trStat}</if>
        </where>
    </select>
    <insert id="insertBisEutrRec" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrRec">
        insert into bis_eutr_rec (
            guid, cour_guid, plan_guid, tr_time, tr_addr, tr_cont,
            tr_type, tr_stat, org_guid, teac_name, tr_pers_num, note,
            coll_time, upd_time, rec_pers, to_date
        ) values (
            #{guid}, #{courGuid}, #{planGuid}, #{trTime}, #{trAddr}, #{trCont},
            #{trType}, #{trStat}, #{orgGuid}, #{teacName}, #{trPersNum}, #{note},
            #{collTime}, #{updTime}, #{recPers}, #{toDate}
        )
    </insert>
    <update id="updateBisEutrRec" parameterType="com.goldenwater.slaj.eutr.domain.BisEutrRec">
        update bis_eutr_rec
        <set>
            <if test="courGuid != null">cour_guid = #{courGuid},</if>
            <if test="planGuid != null">plan_guid = #{planGuid},</if>
            <if test="trTime != null">tr_time = #{trTime},</if>
            <if test="trAddr != null">tr_addr = #{trAddr},</if>
            <if test="trCont != null">tr_cont = #{trCont},</if>
            <if test="trType != null">tr_type = #{trType},</if>
            <if test="trStat != null">tr_stat = #{trStat},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="teacName != null">teac_name = #{teacName},</if>
            <if test="trPersNum != null">tr_pers_num = #{trPersNum},</if>
            <if test="note != null">note = #{note},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
            <if test="toDate != null">to_date = #{toDate},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisEutrRecByGuid" parameterType="String">
        delete from bis_eutr_rec where guid = #{guid}
    </delete>
    <delete id="deleteBisEutrRecByGuids" parameterType="String">
        delete from bis_eutr_rec where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
