<?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.hidd.mapper.BisMajHiddSupMapper">
    <resultMap type="com.goldenwater.slaj.hidd.domain.BisMajHiddSup" id="BisMajHiddSupResult">
        <result property="guid" column="guid"/>
        <result property="hiddGuid" column="hidd_guid"/>
        <result property="isList" column="is_list"/>
        <result property="rectPeri" column="rect_peri"/>
        <result property="supLareId" column="sup_lare_id"/>
        <result property="supDate" column="sup_date"/>
        <result property="supWiunCode" column="sup_wiun_code"/>
        <result property="supLegPers" column="sup_leg_pers"/>
        <result property="supOpin" column="sup_opin"/>
        <result property="supStat" column="sup_stat"/>
        <result property="hiddName" column="hidd_name"/>
        <result property="hiddGrad" column="hidd_grad"/>
        <result property="hiddStat" column="hidd_stat"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
    </resultMap>
    <sql id="selectBisMajHiddSupVo">
        select s.guid, s.hidd_guid, s.is_list, s.rect_peri, s.sup_lare_id, s.sup_date, s.sup_wiun_code, s.sup_leg_pers, s.sup_opin, s.sup_stat, s.note, s.coll_time, s.upd_time, s.rec_pers,
               h.hidd_name, h.hidd_grad, h.hidd_stat
        from bis_maj_hidd_sup s
        left join obj_hidd h on h.guid = s.hidd_guid
    </sql>
    <select id="selectBisMajHiddSupByGuid" parameterType="String" resultMap="BisMajHiddSupResult">
        <include refid="selectBisMajHiddSupVo"/>
        where guid = #{guid}
    </select>
    <select id="selectBisMajHiddSupList" parameterType="com.goldenwater.slaj.hidd.domain.BisMajHiddSup" resultMap="BisMajHiddSupResult">
        <include refid="selectBisMajHiddSupVo"/>
        <where>
            <if test="hiddGuid != null and hiddGuid != ''">AND hidd_guid = #{hiddGuid}</if>
            <if test="supStat != null and supStat != ''">AND sup_stat = #{supStat}</if>
            <if test="guid != null and guid != ''">AND guid = #{guid}</if>
        </where>
    </select>
    <insert id="insertBisMajHiddSup" parameterType="com.goldenwater.slaj.hidd.domain.BisMajHiddSup">
        insert into bis_maj_hidd_sup (guid, hidd_guid, is_list, rect_peri, sup_lare_id, sup_date, sup_wiun_code, sup_leg_pers, sup_opin, sup_stat, note, coll_time, upd_time, rec_pers)
        values (#{guid}, #{hiddGuid}, #{isList}, #{rectPeri}, #{supLareId}, #{supDate}, #{supWiunCode}, #{supLegPers}, #{supOpin}, #{supStat}, #{note}, #{collTime}, #{updTime}, #{recPers})
    </insert>
    <update id="updateBisMajHiddSup" parameterType="com.goldenwater.slaj.hidd.domain.BisMajHiddSup">
        update bis_maj_hidd_sup
        <set>
            <if test="hiddGuid != null">hidd_guid = #{hiddGuid},</if>
            <if test="isList != null">is_list = #{isList},</if>
            <if test="rectPeri != null">rect_peri = #{rectPeri},</if>
            <if test="supLareId != null">sup_lare_id = #{supLareId},</if>
            <if test="supDate != null">sup_date = #{supDate},</if>
            <if test="supWiunCode != null">sup_wiun_code = #{supWiunCode},</if>
            <if test="supLegPers != null">sup_leg_pers = #{supLegPers},</if>
            <if test="supOpin != null">sup_opin = #{supOpin},</if>
            <if test="supStat != null">sup_stat = #{supStat},</if>
            <if test="note != null">note = #{note},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null">rec_pers = #{recPers},</if>
        </set>
        where guid = #{guid}
    </update>
    <delete id="deleteBisMajHiddSupByGuid" parameterType="String">
        delete from bis_maj_hidd_sup where guid = #{guid}
    </delete>
    <delete id="deleteBisMajHiddSupByGuids" parameterType="String">
        delete from bis_maj_hidd_sup where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">
            #{guid}
        </foreach>
    </delete>
</mapper>
