<?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.ObjEutrCourMapper">
    <resultMap type="com.goldenwater.slaj.eutr.domain.ObjEutrCour" id="ObjEutrCourResult">
        <result property="guid" column="guid"/>
        <result property="eutrCourCode" column="eutr_cour_code"/>
        <result property="eutrCourName" column="eutr_cour_name"/>
        <result property="cateGuid" column="cate_guid"/>
        <result property="trainCont" column="train_cont"/>
        <result property="eutrCourHour" column="eutr_cour_hour"/>
        <result property="courType" column="cour_type"/>
        <result property="courApplPers" column="cour_appl_pers"/>
        <result property="subOrgGuid" column="sub_org_guid"/>
        <result property="subTime" column="sub_time"/>
        <result property="veriOrgGuid" column="veri_org_guid"/>
        <result property="veriTime" column="veri_time"/>
        <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="veriResu" column="veri_resu"/>
        <result property="browseVolume" column="browse_volume"/>
        <result property="likeVolume" column="like_volume"/>
        <result property="courCome" column="cour_come"/>
        <result property="push" column="push"/>
    </resultMap>
    <sql id="selectObjEutrCourVo">
        select guid, eutr_cour_code, eutr_cour_name, cate_guid, train_cont, eutr_cour_hour,
               cour_type, cour_appl_pers, sub_org_guid, sub_time, veri_org_guid, veri_time,
               note, coll_time, upd_time, rec_pers, veri_resu, browse_volume, like_volume,
               cour_come, push
        from obj_eutr_cour
    </sql>
    <select id="selectObjEutrCourByGuid" parameterType="String" resultMap="ObjEutrCourResult">
        <include refid="selectObjEutrCourVo"/>
        where guid = #{guid}
    </select>
    <select id="selectObjEutrCourList" parameterType="com.goldenwater.slaj.eutr.domain.ObjEutrCour" resultMap="ObjEutrCourResult">
        <include refid="selectObjEutrCourVo"/>
        <where>
            <if test="eutrCourName != null and eutrCourName != ''">AND eutr_cour_name like '%' || #{eutrCourName} || '%'</if>
            <if test="cateGuid != null and cateGuid != ''">AND cate_guid = #{cateGuid}</if>
            <if test="courType != null and courType != ''">AND cour_type = #{courType}</if>
            <if test="veriResu != null and veriResu != ''">AND veri_resu = #{veriResu}</if>
        </where>
    </select>
    <insert id="insertObjEutrCour" parameterType="com.goldenwater.slaj.eutr.domain.ObjEutrCour">
        insert into obj_eutr_cour (
            guid, eutr_cour_code, eutr_cour_name, cate_guid, train_cont, eutr_cour_hour,
            cour_type, cour_appl_pers, sub_org_guid, sub_time, veri_org_guid, veri_time,
            note, coll_time, upd_time, rec_pers, veri_resu, browse_volume, like_volume,
            cour_come, push
        ) values (
            #{guid}, #{eutrCourCode}, #{eutrCourName}, #{cateGuid}, #{trainCont}, #{eutrCourHour},
            #{courType}, #{courApplPers}, #{subOrgGuid}, #{subTime}, #{veriOrgGuid}, #{veriTime},
            #{note}, #{collTime}, #{updTime}, #{recPers}, #{veriResu}, #{browseVolume}, #{likeVolume},
            #{courCome}, #{push}
        )
    </insert>
    <update id="updateObjEutrCour" parameterType="com.goldenwater.slaj.eutr.domain.ObjEutrCour">
        update obj_eutr_cour
        <set>
            <if test="eutrCourCode != null">eutr_cour_code = #{eutrCourCode},</if>
            <if test="eutrCourName != null">eutr_cour_name = #{eutrCourName},</if>
            <if test="cateGuid != null">cate_guid = #{cateGuid},</if>
            <if test="trainCont != null">train_cont = #{trainCont},</if>
            <if test="eutrCourHour != null">eutr_cour_hour = #{eutrCourHour},</if>
            <if test="courType != null">cour_type = #{courType},</if>
            <if test="courApplPers != null">cour_appl_pers = #{courApplPers},</if>
            <if test="subOrgGuid != null">sub_org_guid = #{subOrgGuid},</if>
            <if test="subTime != null">sub_time = #{subTime},</if>
            <if test="veriOrgGuid != null">veri_org_guid = #{veriOrgGuid},</if>
            <if test="veriTime != null">veri_time = #{veriTime},</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="veriResu != null">veri_resu = #{veriResu},</if>
            <if test="browseVolume != null">browse_volume = #{browseVolume},</if>
            <if test="likeVolume != null">like_volume = #{likeVolume},</if>
            <if test="courCome != null">cour_come = #{courCome},</if>
            <if test="push != null">push = #{push},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteObjEutrCourByGuid" parameterType="String">
        delete from obj_eutr_cour where guid = #{guid}
    </delete>
    <delete id="deleteObjEutrCourByGuids" parameterType="String">
        delete from obj_eutr_cour where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
