<?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.brilliance.isc.mda.dao.VpbscfgMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Vpbscfg">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="vptype" column="vptype" jdbcType="VARCHAR"/>
        <result property="ver" column="ver" jdbcType="VARCHAR"/>
        <result property="branch" column="branch" jdbcType="VARCHAR"/>
        <result property="bchnam" column="bchnam" jdbcType="VARCHAR"/>
        <result property="keyword" column="keyword" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,vptype,ver,branch,bchnam,keyword
    </sql>


    <select id="selectByPrimaryKey" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from vpbscfg
        where inr = #{inr,jdbcType=VARCHAR}
    </select>

    <delete id="deleteByPrimaryKey">
        delete from vpbscfg
        where inr = #{inr,jdbcType=VARCHAR}
    </delete>

    <update id="updateByPrimaryKeySelective" parameterType="com.brilliance.isc.bo.Vpbscfg">
        update vpbscfg
        <set>
            <if test="inr != null">
                inr = #{inr,jdbcType=VARCHAR},
            </if>
            <if test="vptype != null">
                vptype = #{vptype,jdbcType=VARCHAR},
            </if>
            <if test="ver != null">
                ver = #{ver,jdbcType=VARCHAR},
            </if>
            <if test="branch != null">
                branch = #{branch,jdbcType=VARCHAR},
            </if>
            <if test="bchnam != null">
                bchnam = #{bchnam,jdbcType=VARCHAR},
            </if>
            <if test="keyword != null">
                keyword = #{keyword,jdbcType=VARCHAR},
            </if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <select id="listByRecord" parameterType="com.brilliance.isc.vo.manager.VpbscfgVo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from vpbscfg
        <where>
            <if test="branchList != null and branchList.size() !=0">
                branch in
                <foreach collection="branchList" item="item" index="index" open="(" close=")" separator=",">
                    #{item}
                </foreach>
            </if>
            <if test="vptype != null and vptype != ''">
                AND vptype = #{vptype}
            </if>
            <if test="keyword != null and keyword != ''">
                AND keyword = #{keyword}
            </if>
        </where>
    </select>


    <insert id="insert">
        insert into vpbscfg
        (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{vptype,jdbcType=VARCHAR},
            #{ver,jdbcType=VARCHAR},
            #{branch,jdbcType=VARCHAR},
            #{bchnam,jdbcType=VARCHAR},
            #{keyword,jdbcType=VARCHAR}
        </trim>
    </insert>

    <delete id="deleteByPrimaryKey">
        delete from vpbscfg
        where inr = #{inr,jdbcType=VARCHAR}
    </delete>

    <select id="selectByPrimaryKeySelective" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from vpbscfg
        <where>
            <if test="inr != null">
                and inr = #{inr,jdbcType=VARCHAR}
            </if>
            <if test="vptype != null">
                and vptype = #{vptype,jdbcType=VARCHAR}
            </if>
            <if test="ver != null">
                and ver = #{ver,jdbcType=VARCHAR}
            </if>
            <if test="branch != null">
                and branch = #{branch,jdbcType=VARCHAR}
            </if>
            <if test="bchnam != null">
                and bchnam = #{bchnam,jdbcType=VARCHAR}
            </if>
            <if test="keyword != null">
                and keyword = #{keyword,jdbcType=VARCHAR}
            </if>
        </where>
    </select>
</mapper>