<?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.BusiPlanDisclosureMapper">
    <resultMap type="com.goldenwater.slaj.eme.domain.BusiPlanDisclosure" id="BusiPlanDisclosureResult">
        <result property="diGuid" column="di_guid"/>
        <result property="basicId" column="basic_id"/>
        <result property="publicTime" column="public_time"/>
        <result property="publicType" column="public_type"/>
        <result property="publicScope" column="public_scope"/>
        <result property="orgGuid" column="org_guid"/>
        <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="publicStatus" column="public_status"/>
    </resultMap>
    <sql id="selectBusiPlanDisclosureVo">
        select di_guid, basic_id, public_time, public_type, public_scope,
               org_guid, creper_guid, create_time, updper_guid, update_time, public_status
        from t_busi_plan_disclosure
    </sql>
    <select id="selectBusiPlanDisclosureByGuid" parameterType="String" resultMap="BusiPlanDisclosureResult">
        <include refid="selectBusiPlanDisclosureVo"/>
        where di_guid = #{diGuid}
    </select>
    <select id="selectBusiPlanDisclosureList" parameterType="com.goldenwater.slaj.eme.domain.BusiPlanDisclosure" resultMap="BusiPlanDisclosureResult">
        <include refid="selectBusiPlanDisclosureVo"/>
        <where>
            <if test="basicId != null and basicId != ''">AND basic_id = #{basicId}</if>
            <if test="publicStatus != null and publicStatus != ''">AND public_status = #{publicStatus}</if>
        </where>
    </select>
    <insert id="insertBusiPlanDisclosure" parameterType="com.goldenwater.slaj.eme.domain.BusiPlanDisclosure">
        insert into t_busi_plan_disclosure (
            di_guid, basic_id, public_time, public_type, public_scope,
            org_guid, creper_guid, create_time, updper_guid, update_time, public_status
        ) values (
            #{diGuid}, #{basicId}, #{publicTime}, #{publicType}, #{publicScope},
            #{orgGuid}, #{creperGuid}, #{createTime}, #{updperGuid}, #{updateTime}, #{publicStatus}
        )
    </insert>
    <update id="updateBusiPlanDisclosure" parameterType="com.goldenwater.slaj.eme.domain.BusiPlanDisclosure">
        update t_busi_plan_disclosure
        <set>
            <if test="basicId != null">basic_id = #{basicId},</if>
            <if test="publicTime != null">public_time = #{publicTime},</if>
            <if test="publicType != null">public_type = #{publicType},</if>
            <if test="publicScope != null">public_scope = #{publicScope},</if>
            <if test="orgGuid != null">org_guid = #{orgGuid},</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="publicStatus != null">public_status = #{publicStatus},</if>
        </set>
        where di_guid = #{diGuid}
    </update>
    <delete id="deleteBusiPlanDisclosureByGuid" parameterType="String">
        delete from t_busi_plan_disclosure where di_guid = #{diGuid}
    </delete>
    <delete id="deleteBusiPlanDisclosureByGuids" parameterType="String">
        delete from t_busi_plan_disclosure where di_guid in
        <foreach item="diGuid" collection="array" open="(" separator="," close=")">
            #{diGuid}
        </foreach>
    </delete>
</mapper>
