mysql中replace into用法

复制代码
<insert id="saveOrUpdatePayinfo" parameterType="com.bill.invoice.entity.BusBillPayinfo">
        replace into bus_bill_payinfo
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id!=null"> ID, </if>
            <if test="sysOrgCode!=null"> SYS_ORG_CODE, </if>
            <if test="billinfoid!=null"> BILLINFOID, </if>
            <if test="bankcode!=null"> BANKCODE, </if>
            <if test="billcode!=null"> BILLCODE, </if>
            <if test="trandamt!=null"> TRANDAMT, </if>
            <if test="tranddate!=null"> TRANDDATE, </if>
            <if test="returnamt!=null"> RETURNAMT, </if>
            <if test="returndate!=null"> RETURNDATE, </if>
            <if test="whendate!=null"> WHENDATE, </if>
            <if test="createBy!=null"> CREATE_BY, </if>
            <if test="createTime!=null"> CREATE_TIME, </if>
            <if test="updateBy!=null"> UPDATE_BY, </if>
            <if test="updateTime!=null"> UPDATE_TIME, </if>
        </trim>
        VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id!=null"> #{id}, </if>
            <if test="sysOrgCode!=null"> #{sysOrgCode}, </if>
            <if test="billinfoid!=null"> #{billinfoid}, </if>
            <if test="bankcode!=null">  #{bankcode}, </if>
            <if test="billcode!=null">  #{billcode}, </if>
            <if test="trandamt!=null">  #{trandamt}, </if>
            <if test="tranddate!=null">  #{tranddate}, </if>
            <if test="returnamt!=null">  #{returnamt}, </if>
            <if test="returndate!=null">  #{returndate}, </if>
            <if test="whendate!=null">  #{whendate}, </if>
            <if test="createBy!=null">  #{createBy}, </if>
            <if test="createTime!=null">  #{createTime}, </if>
            <if test="updateBy!=null">  #{updateBy}, </if>
            <if test="updateTime!=null">  #{updateTime}, </if>
        </trim>
    </insert>
复制代码

 

posted @   花田007  阅读(41)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· .NET Core 中如何实现缓存的预热?
· 三行代码完成国际化适配,妙~啊~
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
点击右上角即可分享
微信分享提示