<?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.sins.mapper.BisWiunBereBadMapper">
    <resultMap type="com.goldenwater.slaj.sins.domain.BisWiunBereBad" id="BisWiunBereBadResult">
        <result property="guid" column="guid"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="boodBehType" column="bood_beh_type"/>
        <result property="retePeri" column="rete_peri"/>
        <result property="credGrad" column="cred_grad"/>
        <result property="lakeId" column="lake_id"/>
        <result property="entrPers" column="entr_pers"/>
        <result property="dispTime" column="disp_time"/>
        <result property="badBehDesc" column="bad_beh_desc"/>
        <result property="dispDeci" column="disp_deci"/>
        <result property="dispOrg" column="disp_org"/>
        <result property="dispBasis" column="disp_basis"/>
        <result property="dispDisc" column="disp_disc"/>
        <result property="stat" column="stat"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
        <result property="dateScou" column="date_scou"/>
        <result property="boodBehGroup" column="bood_beh_group"/>
        <result property="adminOrgGuid" column="admin_org_guid"/>
        <result property="startTime" column="start_time"/>
        <result property="endTime" column="end_time"/>
        <result property="behavCode" column="behav_code"/>
        <result property="isIllegal" column="is_illegal"/>
        <result property="suenGuid" column="suen_guid"/>
    </resultMap>

    <sql id="selectBisWiunBereBadVo">
        select guid, org_guid, bood_beh_type, rete_peri, cred_grad, lake_id, entr_pers, disp_time, bad_beh_desc, disp_deci, disp_org, disp_basis, disp_disc, stat, note, coll_time, upd_time, rec_pers, date_scou, bood_beh_group, admin_org_guid, start_time, end_time, behav_code, is_illegal, suen_guid from bis_wiun_bere_bad
    </sql>

    <select id="selectBisWiunBereBadByGuid" parameterType="String" resultMap="BisWiunBereBadResult">
        <include refid="selectBisWiunBereBadVo"/> where guid = #{guid}
    </select>

    <select id="selectBisWiunBereBadList" parameterType="com.goldenwater.slaj.sins.domain.BisWiunBereBad" resultMap="BisWiunBereBadResult">
        <include refid="selectBisWiunBereBadVo"/>
        <where>
            <if test="orgGuid != null and orgGuid != ''">
                and org_guid = #{orgGuid}
            </if>
            <if test="boodBehType != null and boodBehType != ''">
                and bood_beh_type = #{boodBehType}
            </if>
            <if test="stat != null and stat != ''">
                and stat = #{stat}
            </if>
            <if test="behavCode != null and behavCode != ''">
                and behav_code = #{behavCode}
            </if>
        </where>
    </select>

    <insert id="insertBisWiunBereBad" parameterType="com.goldenwater.slaj.sins.domain.BisWiunBereBad">
        insert into bis_wiun_bere_bad (guid, org_guid, bood_beh_type, rete_peri, cred_grad, lake_id, entr_pers, disp_time, bad_beh_desc, disp_deci, disp_org, disp_basis, disp_disc, stat, note, coll_time, upd_time, rec_pers, date_scou, bood_beh_group, admin_org_guid, start_time, end_time, behav_code, is_illegal, suen_guid)
        values (#{guid}, #{orgGuid}, #{boodBehType}, #{retePeri}, #{credGrad}, #{lakeId}, #{entrPers}, #{dispTime}, #{badBehDesc}, #{dispDeci}, #{dispOrg}, #{dispBasis}, #{dispDisc}, #{stat}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{dateScou}, #{boodBehGroup}, #{adminOrgGuid}, #{startTime}, #{endTime}, #{behavCode}, #{isIllegal}, #{suenGuid})
    </insert>

    <update id="updateBisWiunBereBad" parameterType="com.goldenwater.slaj.sins.domain.BisWiunBereBad">
        update bis_wiun_bere_bad
        <set>
            <if test="orgGuid != null and orgGuid != ''">org_guid = #{orgGuid},</if>
            <if test="boodBehType != null and boodBehType != ''">bood_beh_type = #{boodBehType},</if>
            <if test="retePeri != null and retePeri != ''">rete_peri = #{retePeri},</if>
            <if test="credGrad != null and credGrad != ''">cred_grad = #{credGrad},</if>
            <if test="lakeId != null and lakeId != ''">lake_id = #{lakeId},</if>
            <if test="entrPers != null and entrPers != ''">entr_pers = #{entrPers},</if>
            <if test="dispTime != null">disp_time = #{dispTime},</if>
            <if test="badBehDesc != null and badBehDesc != ''">bad_beh_desc = #{badBehDesc},</if>
            <if test="dispDeci != null and dispDeci != ''">disp_deci = #{dispDeci},</if>
            <if test="dispOrg != null and dispOrg != ''">disp_org = #{dispOrg},</if>
            <if test="dispBasis != null and dispBasis != ''">disp_basis = #{dispBasis},</if>
            <if test="dispDisc != null and dispDisc != ''">disp_disc = #{dispDisc},</if>
            <if test="stat != null and stat != ''">stat = #{stat},</if>
            <if test="note != null and note != ''">note = #{note},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null and recPers != ''">rec_pers = #{recPers},</if>
            <if test="dateScou != null">date_scou = #{dateScou},</if>
            <if test="boodBehGroup != null and boodBehGroup != ''">bood_beh_group = #{boodBehGroup},</if>
            <if test="adminOrgGuid != null and adminOrgGuid != ''">admin_org_guid = #{adminOrgGuid},</if>
            <if test="startTime != null">start_time = #{startTime},</if>
            <if test="endTime != null">end_time = #{endTime},</if>
            <if test="behavCode != null and behavCode != ''">behav_code = #{behavCode},</if>
            <if test="isIllegal != null and isIllegal != ''">is_illegal = #{isIllegal},</if>
            <if test="suenGuid != null and suenGuid != ''">suen_guid = #{suenGuid},</if>
        </set>
        where guid = #{guid}
    </update>

    <delete id="deleteBisWiunBereBadByGuid" parameterType="String">
        delete from bis_wiun_bere_bad where guid = #{guid}
    </delete>

    <delete id="deleteBisWiunBereBadByGuids" parameterType="String">
        delete from bis_wiun_bere_bad where guid in
        <foreach item="guid" collection="array" open="(" separator="," close=")">#{guid}</foreach>
    </delete>
</mapper>
