<?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.BusiConplanBasicMapper">
    <resultMap type="com.goldenwater.slaj.eme.domain.BusiConplanBasic" id="BusiConplanBasicResult">
        <result property="guid" column="guid"/>
        <result property="planName" column="plan_name"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="entryTime" column="entry_time"/>
        <result property="evaCycle" column="eva_cycle"/>
        <result property="revised" column="revised"/>
        <result property="planType" column="plan_type"/>
        <result property="creperGuid" column="creper_guid"/>
        <result property="createTime" column="create_time"/>
        <result property="updperGuid" column="updper_guid"/>
        <result property="updateTime" column="update_time"/>
        <result property="planStatus" column="plan_status"/>
        <result property="parentId" column="parent_id"/>
        <result property="revisionInfo" column="revision_info"/>
        <result property="parentName" column="parent_name"/>
        <result property="reviseTime" column="revise_time"/>
    </resultMap>
    <sql id="selectBusiConplanBasicVo">
        select guid, plan_name, org_guid, entry_time, eva_cycle, revised,
               plan_type, creper_guid, create_time, updper_guid, update_time,
               plan_status, parent_id, revision_info, parent_name, revise_time
        from t_busi_conplan_basic
    </sql>
    <select id="selectBusiConplanBasicByGuid" parameterType="String" resultMap="BusiConplanBasicResult">
        <include refid="selectBusiConplanBasicVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBusiConplanBasicList" parameterType="com.goldenwater.slaj.eme.domain.BusiConplanBasic" resultMap="BusiConplanBasicResult">
        <include refid="selectBusiConplanBasicVo"/>
        <where>
            <if test="planName != null and planName != ''">AND plan_name like concat('%', #{planName}, '%')</if>
            <if test="planType != null and planType != ''">AND plan_type = #{planType}</if>
            <if test="planStatus != null and planStatus != ''">AND plan_status = #{planStatus}</if>
        </where>
    </select>
    <insert id="insertBusiConplanBasic" parameterType="com.goldenwater.slaj.eme.domain.BusiConplanBasic">
        insert into t_busi_conplan_basic (
            guid, plan_name, org_guid, entry_time, eva_cycle, revised,
            plan_type, creper_guid, create_time, updper_guid, update_time,
            plan_status, parent_id, revision_info, parent_name, revise_time
        ) values (
            #{guid}, #{planName}, #{orgGuid}, #{entryTime}, #{evaCycle}, #{revised},
            #{planType}, #{creperGuid}, #{createTime}, #{updperGuid}, #{updateTime},
            #{planStatus}, #{parentId}, #{revisionInfo}, #{parentName}, #{reviseTime}
        )
    </insert>
    <update id="updateBusiConplanBasic" parameterType="com.goldenwater.slaj.eme.domain.BusiConplanBasic">
        update t_busi_conplan_basic
        <set>
            <if test="planName != null">plan_name = #{planName},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</if>
            <if test="entryTime != null">entry_time = #{entryTime},</if>
            <if test="evaCycle != null">eva_cycle = #{evaCycle},</if>
            <if test="revised != null">revised = #{revised},</if>
            <if test="planType != null">plan_type = #{planType},</if>
            <if test="creperGuid != null">creper_guid = #{creperGuid},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updperGuid != null">updper_guid = #{updperGuid},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="planStatus != null">plan_status = #{planStatus},</if>
            <if test="parentId != null">parent_id = #{parentId},</if>
            <if test="revisionInfo != null">revision_info = #{revisionInfo},</if>
            <if test="parentName != null">parent_name = #{parentName},</if>
            <if test="reviseTime != null">revise_time = #{reviseTime},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBusiConplanBasicByGuid" parameterType="String">
        delete from t_busi_conplan_basic where guid = #{guid}
    </delete>
    <delete id="deleteBusiConplanBasicByGuids" parameterType="String">
        delete from t_busi_conplan_basic where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
