<?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.BnlMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Bnl">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="fqcyjg" column="fqcyjg" jdbcType="VARCHAR"/>
        <result property="jigulb" column="jigulb" jdbcType="VARCHAR"/>
        <result property="hanbdm" column="hanbdm" jdbcType="VARCHAR"/>
        <result property="fqzjjg" column="fqzjjg" jdbcType="VARCHAR"/>
        <result property="frdbmc" column="frdbmc" jdbcType="VARCHAR"/>
        <result property="bhsjcy" column="bhsjcy" jdbcType="VARCHAR"/>
        <result property="cjjghh" column="cjjghh" jdbcType="VARCHAR"/>
        <result property="gxrhhh" column="gxrhhh" jdbcType="VARCHAR"/>
        <result property="jieddm" column="jieddm" jdbcType="VARCHAR"/>
        <result property="rhdqdm" column="rhdqdm" jdbcType="VARCHAR"/>
        <result property="fukrhm" column="fukrhm" jdbcType="VARCHAR"/>
        <result property="canssj" column="canssj" jdbcType="VARCHAR"/>
        <result property="canybz" column="canybz" jdbcType="VARCHAR"/>
        <result property="canjcc" column="canjcc" jdbcType="VARCHAR"/>
        <result property="dihdig" column="dihdig" jdbcType="VARCHAR"/>
        <result property="benqqs" column="benqqs" jdbcType="NUMERIC"/>
        <result property="beiyrq" column="beiyrq" jdbcType="VARCHAR"/>
        <result property="bybz01" column="bybz01" jdbcType="VARCHAR"/>
        <result property="xinx01" column="xinx01" jdbcType="VARCHAR"/>
        <result property="weihgy" column="weihgy" jdbcType="VARCHAR"/>
        <result property="weihrq" column="weihrq" jdbcType="VARCHAR"/>
        <result property="shjnch" column="shjnch" jdbcType="NUMERIC"/>
        <result property="jiluzt" column="jiluzt" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,fqcyjg,jigulb,hanbdm,fqzjjg,frdbmc,bhsjcy,cjjghh,gxrhhh,jieddm,rhdqdm,fukrhm,canssj,canybz,canjcc,dihdig,benqqs,beiyrq,bybz01,xinx01,weihgy,weihrq,shjnch,jiluzt
    </sql>

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

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

    <insert id="insert">
        insert into bnl (<include refid="Base_Column_List" />)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{fqcyjg,jdbcType=VARCHAR},
            #{jigulb,jdbcType=VARCHAR},
            #{hanbdm,jdbcType=VARCHAR},
            #{fqzjjg,jdbcType=VARCHAR},
            #{frdbmc,jdbcType=VARCHAR},
            #{bhsjcy,jdbcType=VARCHAR},
            #{cjjghh,jdbcType=VARCHAR},
            #{gxrhhh,jdbcType=VARCHAR},
            #{jieddm,jdbcType=VARCHAR},
            #{rhdqdm,jdbcType=VARCHAR},
            #{fukrhm,jdbcType=VARCHAR},
            #{canssj,jdbcType=VARCHAR},
            #{canybz,jdbcType=VARCHAR},
            #{canjcc,jdbcType=VARCHAR},
            #{dihdig,jdbcType=VARCHAR},
            #{benqqs,jdbcType=NUMERIC},
            #{beiyrq,jdbcType=VARCHAR},
            #{bybz01,jdbcType=VARCHAR},
            #{xinx01,jdbcType=VARCHAR},
            #{weihgy,jdbcType=VARCHAR},
            #{weihrq,jdbcType=VARCHAR},
            #{shjnch,jdbcType=NUMERIC},
            #{jiluzt,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into bnl
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="fqcyjg != null">fqcyjg,</if>
            <if test="jigulb != null">jigulb,</if>
            <if test="hanbdm != null">hanbdm,</if>
            <if test="fqzjjg != null">fqzjjg,</if>
            <if test="frdbmc != null">frdbmc,</if>
            <if test="bhsjcy != null">bhsjcy,</if>
            <if test="cjjghh != null">cjjghh,</if>
            <if test="gxrhhh != null">gxrhhh,</if>
            <if test="jieddm != null">jieddm,</if>
            <if test="rhdqdm != null">rhdqdm,</if>
            <if test="fukrhm != null">fukrhm,</if>
            <if test="canssj != null">canssj,</if>
            <if test="canybz != null">canybz,</if>
            <if test="canjcc != null">canjcc,</if>
            <if test="dihdig != null">dihdig,</if>
            <if test="benqqs != null">benqqs,</if>
            <if test="beiyrq != null">beiyrq,</if>
            <if test="bybz01 != null">bybz01,</if>
            <if test="xinx01 != null">xinx01,</if>
            <if test="weihgy != null">weihgy,</if>
            <if test="weihrq != null">weihrq,</if>
            <if test="shjnch != null">shjnch,</if>
            <if test="jiluzt != null">jiluzt,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR}, </if>
            <if test="fqcyjg != null">#{fqcyjg,jdbcType=VARCHAR}, </if>
            <if test="jigulb != null">#{jigulb,jdbcType=VARCHAR}, </if>
            <if test="hanbdm != null">#{hanbdm,jdbcType=VARCHAR}, </if>
            <if test="fqzjjg != null">#{fqzjjg,jdbcType=VARCHAR}, </if>
            <if test="frdbmc != null">#{frdbmc,jdbcType=VARCHAR}, </if>
            <if test="bhsjcy != null">#{bhsjcy,jdbcType=VARCHAR}, </if>
            <if test="cjjghh != null">#{cjjghh,jdbcType=VARCHAR}, </if>
            <if test="gxrhhh != null">#{gxrhhh,jdbcType=VARCHAR}, </if>
            <if test="jieddm != null">#{jieddm,jdbcType=VARCHAR}, </if>
            <if test="rhdqdm != null">#{rhdqdm,jdbcType=VARCHAR}, </if>
            <if test="fukrhm != null">#{fukrhm,jdbcType=VARCHAR}, </if>
            <if test="canssj != null">#{canssj,jdbcType=VARCHAR}, </if>
            <if test="canybz != null">#{canybz,jdbcType=VARCHAR}, </if>
            <if test="canjcc != null">#{canjcc,jdbcType=VARCHAR}, </if>
            <if test="dihdig != null">#{dihdig,jdbcType=VARCHAR}, </if>
            <if test="benqqs != null">#{benqqs,jdbcType=NUMERIC}, </if>
            <if test="beiyrq != null">#{beiyrq,jdbcType=VARCHAR}, </if>
            <if test="bybz01 != null">#{bybz01,jdbcType=VARCHAR}, </if>
            <if test="xinx01 != null">#{xinx01,jdbcType=VARCHAR}, </if>
            <if test="weihgy != null">#{weihgy,jdbcType=VARCHAR}, </if>
            <if test="weihrq != null">#{weihrq,jdbcType=VARCHAR}, </if>
            <if test="shjnch != null">#{shjnch,jdbcType=NUMERIC}, </if>
            <if test="jiluzt != null">#{jiluzt,jdbcType=VARCHAR}, </if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update bnl
        <set>
            <if test="fqcyjg != null">fqcyjg = #{fqcyjg,jdbcType=VARCHAR},</if>
            <if test="jigulb != null">jigulb = #{jigulb,jdbcType=VARCHAR},</if>
            <if test="hanbdm != null">hanbdm = #{hanbdm,jdbcType=VARCHAR},</if>
            <if test="fqzjjg != null">fqzjjg = #{fqzjjg,jdbcType=VARCHAR},</if>
            <if test="frdbmc != null">frdbmc = #{frdbmc,jdbcType=VARCHAR},</if>
            <if test="bhsjcy != null">bhsjcy = #{bhsjcy,jdbcType=VARCHAR},</if>
            <if test="cjjghh != null">cjjghh = #{cjjghh,jdbcType=VARCHAR},</if>
            <if test="gxrhhh != null">gxrhhh = #{gxrhhh,jdbcType=VARCHAR},</if>
            <if test="jieddm != null">jieddm = #{jieddm,jdbcType=VARCHAR},</if>
            <if test="rhdqdm != null">rhdqdm = #{rhdqdm,jdbcType=VARCHAR},</if>
            <if test="fukrhm != null">fukrhm = #{fukrhm,jdbcType=VARCHAR},</if>
            <if test="canssj != null">canssj = #{canssj,jdbcType=VARCHAR},</if>
            <if test="canybz != null">canybz = #{canybz,jdbcType=VARCHAR},</if>
            <if test="canjcc != null">canjcc = #{canjcc,jdbcType=VARCHAR},</if>
            <if test="dihdig != null">dihdig = #{dihdig,jdbcType=VARCHAR},</if>
            <if test="benqqs != null">benqqs = #{benqqs,jdbcType=NUMERIC},</if>
            <if test="beiyrq != null">beiyrq = #{beiyrq,jdbcType=VARCHAR},</if>
            <if test="bybz01 != null">bybz01 = #{bybz01,jdbcType=VARCHAR},</if>
            <if test="xinx01 != null">xinx01 = #{xinx01,jdbcType=VARCHAR},</if>
            <if test="weihgy != null">weihgy = #{weihgy,jdbcType=VARCHAR},</if>
            <if test="weihrq != null">weihrq = #{weihrq,jdbcType=VARCHAR},</if>
            <if test="shjnch != null">shjnch = #{shjnch,jdbcType=NUMERIC},</if>
            <if test="jiluzt != null">jiluzt = #{jiluzt,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update bnl
        <set>
            fqcyjg = #{fqcyjg,jdbcType=VARCHAR},
            jigulb = #{jigulb,jdbcType=VARCHAR},
            hanbdm = #{hanbdm,jdbcType=VARCHAR},
            fqzjjg = #{fqzjjg,jdbcType=VARCHAR},
            frdbmc = #{frdbmc,jdbcType=VARCHAR},
            bhsjcy = #{bhsjcy,jdbcType=VARCHAR},
            cjjghh = #{cjjghh,jdbcType=VARCHAR},
            gxrhhh = #{gxrhhh,jdbcType=VARCHAR},
            jieddm = #{jieddm,jdbcType=VARCHAR},
            rhdqdm = #{rhdqdm,jdbcType=VARCHAR},
            fukrhm = #{fukrhm,jdbcType=VARCHAR},
            canssj = #{canssj,jdbcType=VARCHAR},
            canybz = #{canybz,jdbcType=VARCHAR},
            canjcc = #{canjcc,jdbcType=VARCHAR},
            dihdig = #{dihdig,jdbcType=VARCHAR},
            benqqs = #{benqqs,jdbcType=NUMERIC},
            beiyrq = #{beiyrq,jdbcType=VARCHAR},
            bybz01 = #{bybz01,jdbcType=VARCHAR},
            xinx01 = #{xinx01,jdbcType=VARCHAR},
            weihgy = #{weihgy,jdbcType=VARCHAR},
            weihrq = #{weihrq,jdbcType=VARCHAR},
            shjnch = #{shjnch,jdbcType=NUMERIC},
            jiluzt = #{jiluzt,jdbcType=VARCHAR},
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <delete id="deleteByIds">
        delete from act where inr in
        <foreach item="item" index="index" collection="collection" open="(" separator="," close=")">
            #{item}
        </foreach>
    </delete>

    <update id="dyncUpdate">
        update bnl
        <set>
            <if test="module.fqcyjg != null">fqcyjg = #{module.fqcyjg,jdbcType=VARCHAR},</if>
            <if test="module.jigulb != null">jigulb = #{module.jigulb,jdbcType=VARCHAR},</if>
            <if test="module.hanbdm != null">hanbdm = #{module.hanbdm,jdbcType=VARCHAR},</if>
            <if test="module.fqzjjg != null">fqzjjg = #{module.fqzjjg,jdbcType=VARCHAR},</if>
            <if test="module.frdbmc != null">frdbmc = #{module.frdbmc,jdbcType=VARCHAR},</if>
            <if test="module.bhsjcy != null">bhsjcy = #{module.bhsjcy,jdbcType=VARCHAR},</if>
            <if test="module.cjjghh != null">cjjghh = #{module.cjjghh,jdbcType=VARCHAR},</if>
            <if test="module.gxrhhh != null">gxrhhh = #{module.gxrhhh,jdbcType=VARCHAR},</if>
            <if test="module.jieddm != null">jieddm = #{module.jieddm,jdbcType=VARCHAR},</if>
            <if test="module.rhdqdm != null">rhdqdm = #{module.rhdqdm,jdbcType=VARCHAR},</if>
            <if test="module.fukrhm != null">fukrhm = #{module.fukrhm,jdbcType=VARCHAR},</if>
            <if test="module.canssj != null">canssj = #{module.canssj,jdbcType=VARCHAR},</if>
            <if test="module.canybz != null">canybz = #{module.canybz,jdbcType=VARCHAR},</if>
            <if test="module.canjcc != null">canjcc = #{module.canjcc,jdbcType=VARCHAR},</if>
            <if test="module.dihdig != null">dihdig = #{module.dihdig,jdbcType=VARCHAR},</if>
            <if test="module.benqqs != null">benqqs = #{module.benqqs,jdbcType=NUMERIC},</if>
            <if test="module.beiyrq != null">beiyrq = #{module.beiyrq,jdbcType=VARCHAR},</if>
            <if test="module.bybz01 != null">bybz01 = #{module.bybz01,jdbcType=VARCHAR},</if>
            <if test="module.xinx01 != null">xinx01 = #{module.xinx01,jdbcType=VARCHAR},</if>
            <if test="module.weihgy != null">weihgy = #{module.weihgy,jdbcType=VARCHAR},</if>
            <if test="module.weihrq != null">weihrq = #{module.weihrq,jdbcType=VARCHAR},</if>
            <if test="module.shjnch != null">shjnch = #{module.shjnch,jdbcType=NUMERIC},</if>
            <if test="module.jiluzt != null">jiluzt = #{module.jiluzt,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

    <delete id="dyncDelete">
        ${sql}
    </delete>

    <select id="dyncRead" resultMap="BaseResultMap">
        ${sql}
    </select>

    <select id="selectByHhMc" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from bnl
        <where>
            <if test="fqcyjg != null and fqcyjg != ''">
                and fqcyjg like concat('%', #{fqcyjg}, '%')
            </if>
            <if test="fukrhm != null and fukrhm != ''">
                and fukrhm like concat('%', #{fukrhm}, '%')
            </if>
        </where>
    </select>

    <select id="selectByCondition" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from bnl
        <where>
            <if test="fqcyjg != null and fqcyjg != ''">
                and fqcyjg like concat('%', #{fqcyjg}, '%')
            </if>
            <if test="fukrhm != null and fukrhm != ''">
                and fukrhm like concat('%', #{fukrhm}, '%')
            </if>
            <if test="jigulb != null and jigulb != ''">
                and jigulb = #{jigulb}
            </if>
            <if test="canjcc != null and canjcc != ''">
                and canjcc = #{canjcc}
            </if>
        </where>
    </select>

    <select id="selectByFqcyjg" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from bnl
        where fqcyjg = #{fqcyjg,jdbcType=VARCHAR}
    </select>

    <select id="getBnlByBankno" resultType="com.brilliance.isc.vo.PtaInfosVo">
        select inr,fqcyjg,fukrhm from bnl where fqcyjg like concat('%', #{fqcyjg}, '%') or fukrhm like concat('%', #{fqcyjg}, '%') order by length(fqcyjg) asc
    </select>

    <select id="getPtsptaInfo5" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" /> from bnl where fqcyjg = #{fqcyjg,jdbcType=VARCHAR}
    </select>

    <select id="selectHhMc" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"></include>
        from bnl
        <where>
            <if test="fqcyjg != null and fqcyjg != ''">
                or fqcyjg like concat('%', #{fqcyjg}, '%')
            </if>
            <if test="fukrhm != null and fukrhm != ''">
                or fukrhm like concat('%', #{fukrhm}, '%')
            </if>
        </where>
    </select>
    
    <select id="selectFukrhmByFqcyjg" resultType="java.lang.String">
        select fukrhm from bnl where fqcyjg = #{fqcyjg,jdbcType=VARCHAR}
    </select>
</mapper>