tbkmapper.xml 13.9 KB
<?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.TbkMapper">

    <resultMap id="BaseResultMap" type="com.brilliance.isc.common.rmbbop.entity.Tbk">
        <result property="inr" column="inr" jdbcType="VARCHAR"/>
        <result property="ver" column="ver" jdbcType="VARCHAR"/>
        <result property="sta" column="sta" jdbcType="VARCHAR"/>
        <result property="objtyp" column="objtyp" jdbcType="VARCHAR"/>
        <result property="objinr" column="objinr" jdbcType="VARCHAR"/>
        <result property="listopertype" column="listopertype" jdbcType="VARCHAR"/>
        <result property="csta" column="csta" jdbcType="VARCHAR"/>
        <result property="seqno" column="seqno" jdbcType="VARCHAR"/>
        <result property="balofpaycode" column="balofpaycode" jdbcType="VARCHAR"/>
        <result property="payamt" column="payamt" jdbcType="DECIMAL"/>
        <result property="bustypecode" column="bustypecode" jdbcType="VARCHAR"/>
        <result property="bustypelist" column="bustypelist" jdbcType="VARCHAR"/>
        <result property="actualpayercode" column="actualpayercode" jdbcType="VARCHAR"/>
        <result property="actualpayername" column="actualpayername" jdbcType="VARCHAR"/>
        <result property="ifprepayment" column="ifprepayment" jdbcType="VARCHAR"/>
        <result property="prepayerscale" column="prepayerscale" jdbcType="DECIMAL"/>
        <result property="accountperiod" column="accountperiod" jdbcType="VARCHAR"/>
        <result property="custstate" column="custstate" jdbcType="VARCHAR"/>
        <result property="certificateno" column="certificateno" jdbcType="VARCHAR"/>
        <result property="contractno" column="contractno" jdbcType="VARCHAR"/>
        <result property="addword" column="addword" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        inr,ver,sta,objtyp,objinr,listopertype,csta,seqno,balofpaycode,payamt,bustypecode,bustypelist,actualpayercode,actualpayername,ifprepayment,prepayerscale,accountperiod,custstate,certificateno,contractno,addword
    </sql>

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

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

    <!--批量新增-->
    <insert id="insertBatch" keyProperty="" useGeneratedKeys="true">
        insert into tbk (<include refid="Base_Column_List"/>)
        values
        <foreach collection="entities" item="entity" separator=",">
            (
            #{entity.inr,jdbcType=VARCHAR},
            #{entity.ver,jdbcType=VARCHAR},
            #{entity.sta,jdbcType=VARCHAR},
            #{entity.objtyp,jdbcType=VARCHAR},
            #{entity.objinr,jdbcType=VARCHAR},
            #{entity.listopertype,jdbcType=VARCHAR},
            #{entity.csta,jdbcType=VARCHAR},
            #{entity.seqno,jdbcType=VARCHAR},
            #{entity.balofpaycode,jdbcType=VARCHAR},
            #{entity.payamt,jdbcType=DECIMAL},
            #{entity.bustypecode,jdbcType=VARCHAR},
            #{entity.bustypelist,jdbcType=VARCHAR},
            #{entity.actualpayercode,jdbcType=VARCHAR},
            #{entity.actualpayername,jdbcType=VARCHAR},
            #{entity.ifprepayment,jdbcType=VARCHAR},
            #{entity.prepayerscale,jdbcType=DECIMAL},
            #{entity.accountperiod,jdbcType=VARCHAR},
            #{entity.custstate,jdbcType=VARCHAR},
            #{entity.certificateno,jdbcType=VARCHAR},
            #{entity.contractno,jdbcType=VARCHAR},
            #{entity.addword,jdbcType=VARCHAR}
            )
        </foreach>
    </insert>


    <insert id="insert">
        insert into tbk (<include refid="Base_Column_List"/>)
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            #{inr,jdbcType=VARCHAR},
            #{ver,jdbcType=VARCHAR},
            #{sta,jdbcType=VARCHAR},
            #{objtyp,jdbcType=VARCHAR},
            #{objinr,jdbcType=VARCHAR},
            #{listopertype,jdbcType=VARCHAR},
            #{csta,jdbcType=VARCHAR},
            #{seqno,jdbcType=VARCHAR},
            #{balofpaycode,jdbcType=VARCHAR},
            #{payamt,jdbcType=DECIMAL},
            #{bustypecode,jdbcType=VARCHAR},
            #{bustypelist,jdbcType=VARCHAR},
            #{actualpayercode,jdbcType=VARCHAR},
            #{actualpayername,jdbcType=VARCHAR},
            #{ifprepayment,jdbcType=VARCHAR},
            #{prepayerscale,jdbcType=DECIMAL},
            #{accountperiod,jdbcType=VARCHAR},
            #{custstate,jdbcType=VARCHAR},
            #{certificateno,jdbcType=VARCHAR},
            #{contractno,jdbcType=VARCHAR},
            #{addword,jdbcType=VARCHAR},
        </trim>
    </insert>

    <insert id="insertSelective">
        insert into tbk
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="inr != null">inr,</if>
            <if test="ver != null">ver,</if>
            <if test="sta != null">sta,</if>
            <if test="objtyp != null">objtyp,</if>
            <if test="objinr != null">objinr,</if>
            <if test="listopertype != null">listopertype,</if>
            <if test="csta != null">csta,</if>
            <if test="seqno != null">seqno,</if>
            <if test="balofpaycode != null">balofpaycode,</if>
            <if test="payamt != null">payamt,</if>
            <if test="bustypecode != null">bustypecode,</if>
            <if test="bustypelist != null">bustypelist,</if>
            <if test="actualpayercode != null">actualpayercode,</if>
            <if test="actualpayername != null">actualpayername,</if>
            <if test="ifprepayment != null">ifprepayment,</if>
            <if test="prepayerscale != null">prepayerscale,</if>
            <if test="accountperiod != null">accountperiod,</if>
            <if test="custstate != null">custstate,</if>
            <if test="certificateno != null">certificateno,</if>
            <if test="contractno != null">contractno,</if>
            <if test="addword != null">addword,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="inr != null">#{inr,jdbcType=VARCHAR},</if>
            <if test="ver != null">#{ver,jdbcType=VARCHAR},</if>
            <if test="sta != null">#{sta,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">#{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">#{objinr,jdbcType=VARCHAR},</if>
            <if test="listopertype != null">#{listopertype,jdbcType=VARCHAR},</if>
            <if test="csta != null">#{csta,jdbcType=VARCHAR},</if>
            <if test="seqno != null">#{seqno,jdbcType=VARCHAR},</if>
            <if test="balofpaycode != null">#{balofpaycode,jdbcType=VARCHAR},</if>
            <if test="payamt != null">#{payamt,jdbcType=DECIMAL},</if>
            <if test="bustypecode != null">#{bustypecode,jdbcType=VARCHAR},</if>
            <if test="bustypelist != null">#{bustypelist,jdbcType=VARCHAR},</if>
            <if test="actualpayercode != null">#{actualpayercode,jdbcType=VARCHAR},</if>
            <if test="actualpayername != null">#{actualpayername,jdbcType=VARCHAR},</if>
            <if test="ifprepayment != null">#{ifprepayment,jdbcType=VARCHAR},</if>
            <if test="prepayerscale != null">#{prepayerscale,jdbcType=DECIMAL},</if>
            <if test="accountperiod != null">#{accountperiod,jdbcType=VARCHAR},</if>
            <if test="custstate != null">#{custstate,jdbcType=VARCHAR},</if>
            <if test="certificateno != null">#{certificateno,jdbcType=VARCHAR},</if>
            <if test="contractno != null">#{contractno,jdbcType=VARCHAR},</if>
            <if test="addword != null">#{addword,jdbcType=VARCHAR},</if>
        </trim>
    </insert>

    <update id="updateByPrimaryKeySelective">
        update tbk
        <set>
            <if test="ver != null">ver = #{ver,jdbcType=VARCHAR},</if>
            <if test="sta != null">sta = #{sta,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">objinr = #{objinr,jdbcType=VARCHAR},</if>
            <if test="listopertype != null">listopertype = #{listopertype,jdbcType=VARCHAR},</if>
            <if test="csta != null">csta = #{csta,jdbcType=VARCHAR},</if>
            <if test="seqno != null">seqno = #{seqno,jdbcType=VARCHAR},</if>
            <if test="balofpaycode != null">balofpaycode = #{balofpaycode,jdbcType=VARCHAR},</if>
            <if test="payamt != null">payamt = #{payamt,jdbcType=DECIMAL},</if>
            <if test="bustypecode != null">bustypecode = #{bustypecode,jdbcType=VARCHAR},</if>
            <if test="bustypelist != null">bustypelist = #{bustypelist,jdbcType=VARCHAR},</if>
            <if test="actualpayercode != null">actualpayercode = #{actualpayercode,jdbcType=VARCHAR},</if>
            <if test="actualpayername != null">actualpayername = #{actualpayername,jdbcType=VARCHAR},</if>
            <if test="ifprepayment != null">ifprepayment = #{ifprepayment,jdbcType=VARCHAR},</if>
            <if test="prepayerscale != null">prepayerscale = #{prepayerscale,jdbcType=DECIMAL},</if>
            <if test="accountperiod != null">accountperiod = #{accountperiod,jdbcType=VARCHAR},</if>
            <if test="custstate != null">custstate = #{custstate,jdbcType=VARCHAR},</if>
            <if test="certificateno != null">certificateno = #{certificateno,jdbcType=VARCHAR},</if>
            <if test="contractno != null">contractno = #{contractno,jdbcType=VARCHAR},</if>
            <if test="addword != null">addword = #{addword,jdbcType=VARCHAR},</if>
        </set>
        where inr = #{inr,jdbcType=VARCHAR}
    </update>

    <update id="updateByPrimaryKey">
        update tbk
        <set>
            ver = #{ver,jdbcType=VARCHAR},
            sta = #{sta,jdbcType=VARCHAR},
            objtyp = #{objtyp,jdbcType=VARCHAR},
            objinr = #{objinr,jdbcType=VARCHAR},
            listopertype = #{listopertype,jdbcType=VARCHAR},
            csta = #{csta,jdbcType=VARCHAR},
            seqno = #{seqno,jdbcType=VARCHAR},
            balofpaycode = #{balofpaycode,jdbcType=VARCHAR},
            payamt = #{payamt,jdbcType=DECIMAL},
            bustypecode = #{bustypecode,jdbcType=VARCHAR},
            bustypelist = #{bustypelist,jdbcType=VARCHAR},
            actualpayercode = #{actualpayercode,jdbcType=VARCHAR},
            actualpayername = #{actualpayername,jdbcType=VARCHAR},
            ifprepayment = #{ifprepayment,jdbcType=VARCHAR},
            prepayerscale = #{prepayerscale,jdbcType=DECIMAL},
            accountperiod = #{accountperiod,jdbcType=VARCHAR},
            custstate = #{custstate,jdbcType=VARCHAR},
            certificateno = #{certificateno,jdbcType=VARCHAR},
            contractno = #{contractno,jdbcType=VARCHAR},
            addword = #{addword,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 tbk
        <set>
            <if test="ver != null">ver = #{ver,jdbcType=VARCHAR},</if>
            <if test="sta != null">sta = #{sta,jdbcType=VARCHAR},</if>
            <if test="objtyp != null">objtyp = #{objtyp,jdbcType=VARCHAR},</if>
            <if test="objinr != null">objinr = #{objinr,jdbcType=VARCHAR},</if>
            <if test="listopertype != null">listopertype = #{listopertype,jdbcType=VARCHAR},</if>
            <if test="csta != null">csta = #{csta,jdbcType=VARCHAR},</if>
            <if test="seqno != null">seqno = #{seqno,jdbcType=VARCHAR},</if>
            <if test="balofpaycode != null">balofpaycode = #{balofpaycode,jdbcType=VARCHAR},</if>
            <if test="payamt != null">payamt = #{payamt,jdbcType=DECIMAL},</if>
            <if test="bustypecode != null">bustypecode = #{bustypecode,jdbcType=VARCHAR},</if>
            <if test="bustypelist != null">bustypelist = #{bustypelist,jdbcType=VARCHAR},</if>
            <if test="actualpayercode != null">actualpayercode = #{actualpayercode,jdbcType=VARCHAR},</if>
            <if test="actualpayername != null">actualpayername = #{actualpayername,jdbcType=VARCHAR},</if>
            <if test="ifprepayment != null">ifprepayment = #{ifprepayment,jdbcType=VARCHAR},</if>
            <if test="prepayerscale != null">prepayerscale = #{prepayerscale,jdbcType=DECIMAL},</if>
            <if test="accountperiod != null">accountperiod = #{accountperiod,jdbcType=VARCHAR},</if>
            <if test="custstate != null">custstate = #{custstate,jdbcType=VARCHAR},</if>
            <if test="certificateno != null">certificateno = #{certificateno,jdbcType=VARCHAR},</if>
            <if test="contractno != null">contractno = #{contractno,jdbcType=VARCHAR},</if>
            <if test="addword != null">addword = #{addword,jdbcType=VARCHAR},</if>
        </set>
        ${conditions}
    </update>

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

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

    <select id="selectByObjInfo" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tbk
        where objinr = #{objinr,jdbcType=VARCHAR} and objtyp = #{objtyp,jdbcType=VARCHAR} and seqno =
        #{seqno,jdbcType=VARCHAR}
    </select>

    <select id="selectByObjtypAndObjinr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tbk
        where 1=1 and objinr = #{objinr,jdbcType=VARCHAR} and objtyp = #{objtyp,jdbcType=VARCHAR}
    </select>

    <delete id="deleteByobjtypAndobjinr">
        delete from tbk
        where objtyp = #{objtyp,jdbcType=VARCHAR} and objinr = #{objinr,jdbcType=VARCHAR}
    </delete>

</mapper>