<?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.eme.mapper.BusiPlanEvaMapper">
    <resultMap type="com.goldenwater.slaj.eme.domain.BusiPlanEva" id="BusiPlanEvaResult">
        <result property="guid" column="guid"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="createTime" column="create_time"/>
        <result property="startDate" column="start_date"/>
        <result property="endDate" column="end_date"/>
        <result property="orgNum" column="org_num"/>
        <result property="zh" column="zh"/>
        <result property="zx" column="zx"/>
        <result property="xc" column="xc"/>
        <result property="plan" column="plan"/>
        <result property="sbl" column="sbl"/>
        <result property="yl" column="yl"/>
        <result property="yll" column="yll"/>
        <result property="dateType" column="date_type"/>
        <result property="dateYear" column="date_year"/>
        <result property="dateQuarter" column="date_quarter"/>
        <result property="planFx" column="plan_fx"/>
    </resultMap>
    <sql id="selectBusiPlanEvaVo">
        select guid, org_guid, create_time, start_date, end_date, org_num,
               zh, zx, xc, plan, sbl, yl, yll,
               date_type, date_year, date_quarter, plan_fx
        from t_busi_plan_eva
    </sql>
    <select id="selectBusiPlanEvaByGuid" parameterType="String" resultMap="BusiPlanEvaResult">
        <include refid="selectBusiPlanEvaVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBusiPlanEvaList" parameterType="com.goldenwater.slaj.eme.domain.BusiPlanEva" resultMap="BusiPlanEvaResult">
        <include refid="selectBusiPlanEvaVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">AND org_guid = #{orgGuid}</if>
            <if test="dateType != null and dateType != ''">AND date_type = #{dateType}</if>
            <if test="dateYear != null and dateYear != ''">AND date_year = #{dateYear}</if>
        </where>
    </select>
    <insert id="insertBusiPlanEva" parameterType="com.goldenwater.slaj.eme.domain.BusiPlanEva">
        insert into t_busi_plan_eva (
            guid, org_guid, create_time, start_date, end_date, org_num,
            zh, zx, xc, plan, sbl, yl, yll,
            date_type, date_year, date_quarter, plan_fx
        ) values (
            #{guid}, #{orgGuid}, #{createTime}, #{startDate}, #{endDate}, #{orgNum},
            #{zh}, #{zx}, #{xc}, #{plan}, #{sbl}, #{yl}, #{yll},
            #{dateType}, #{dateYear}, #{dateQuarter}, #{planFx}
        )
    </insert>
    <update id="updateBusiPlanEva" parameterType="com.goldenwater.slaj.eme.domain.BusiPlanEva">
        update t_busi_plan_eva
        <set>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="startDate != null">start_date = #{startDate},</if>
            <if test="endDate != null">end_date = #{endDate},</if>
            <if test="orgNum != null">org_num = #{orgNum},</if>
            <if test="zh != null">zh = #{zh},</if>
            <if test="zx != null">zx = #{zx},</if>
            <if test="xc != null">xc = #{xc},</if>
            <if test="plan != null">plan = #{plan},</if>
            <if test="sbl != null">sbl = #{sbl},</if>
            <if test="yl != null">yl = #{yl},</if>
            <if test="yll != null">yll = #{yll},</if>
            <if test="dateType != null">date_type = #{dateType},</if>
            <if test="dateYear != null">date_year = #{dateYear},</if>
            <if test="dateQuarter != null">date_quarter = #{dateQuarter},</if>
            <if test="planFx != null">plan_fx = #{planFx},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBusiPlanEvaByGuid" parameterType="String">
        delete from t_busi_plan_eva where guid = #{guid}
    </delete>
    <delete id="deleteBusiPlanEvaByGuids" parameterType="String">
        delete from t_busi_plan_eva where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
