<?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.BusiReviewInfoMapper">
    <resultMap type="com.goldenwater.slaj.eme.domain.BusiReviewInfo" id="BusiReviewInfoResult">
        <result property="riGuid" column="ri_guid"/>
        <result property="basicId" column="basic_id"/>
        <result property="reviTime" column="revi_time"/>
        <result property="reviOrg" column="revi_org"/>
        <result property="reviPers" column="revi_pers"/>
        <result property="reviOpin" column="revi_opin"/>
        <result property="reviResu" column="revi_resu"/>
        <result property="reviType" column="revi_type"/>
        <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"/>
    </resultMap>
    <sql id="selectBusiReviewInfoVo">
        select ri_guid, basic_id, revi_time, revi_org, revi_pers, revi_opin,
               revi_resu, revi_type, org_guid, creper_guid, create_time,
               updper_guid, update_time
        from t_busi_review_info
    </sql>
    <select id="selectBusiReviewInfoByGuid" parameterType="String" resultMap="BusiReviewInfoResult">
        <include refid="selectBusiReviewInfoVo"/>
        where ri_guid = #{riGuid}
    </select>
    <select id="selectBusiReviewInfoList" parameterType="com.goldenwater.slaj.eme.domain.BusiReviewInfo" resultMap="BusiReviewInfoResult">
        <include refid="selectBusiReviewInfoVo"/>
        <where>
            <if test="basicId != null and basicId != ''">AND basic_id = #{basicId}</if>
            <if test="reviType != null and reviType != ''">AND revi_type = #{reviType}</if>
            <if test="reviResu != null and reviResu != ''">AND revi_resu = #{reviResu}</if>
        </where>
    </select>
    <insert id="insertBusiReviewInfo" parameterType="com.goldenwater.slaj.eme.domain.BusiReviewInfo">
        insert into t_busi_review_info (
            ri_guid, basic_id, revi_time, revi_org, revi_pers, revi_opin,
            revi_resu, revi_type, org_guid, creper_guid, create_time,
            updper_guid, update_time
        ) values (
            #{riGuid}, #{basicId}, #{reviTime}, #{reviOrg}, #{reviPers}, #{reviOpin},
            #{reviResu}, #{reviType}, #{orgGuid}, #{creperGuid}, #{createTime},
            #{updperGuid}, #{updateTime}
        )
    </insert>
    <update id="updateBusiReviewInfo" parameterType="com.goldenwater.slaj.eme.domain.BusiReviewInfo">
        update t_busi_review_info
        <set>
            <if test="basicId != null">basic_id = #{basicId},</if>
            <if test="reviTime != null">revi_time = #{reviTime},</if>
            <if test="reviOrg != null">revi_org = #{reviOrg},</if>
            <if test="reviPers != null">revi_pers = #{reviPers},</if>
            <if test="reviOpin != null">revi_opin = #{reviOpin},</if>
            <if test="reviResu != null">revi_resu = #{reviResu},</if>
            <if test="reviType != null">revi_type = #{reviType},</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>
        </set>
        where ri_guid = #{riGuid}
    </update>
    <delete id="deleteBusiReviewInfoByGuid" parameterType="String">
        delete from t_busi_review_info where ri_guid = #{riGuid}
    </delete>
    <delete id="deleteBusiReviewInfoByGuids" parameterType="String">
        delete from t_busi_review_info where ri_guid in
        <foreach item="riGuid" collection="array" open="(" separator="," close=")">
            #{riGuid}
        </foreach>
    </delete>
</mapper>
