You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/11/26 12:56:50 UTC

[GitHub] [shardingsphere] Jaskey edited a comment on issue #1756: INSERT ON DUPLICATE KEY UPDATE with dynamic parameters

Jaskey edited a comment on issue #1756:
URL: https://github.com/apache/shardingsphere/issues/1756#issuecomment-734234745


   ```  
   <insert id="insertOnDuplicateKeyUpdateSelective" parameterType="com.xxxxxx.yyyyyy.duhbepay.dao.entity.HeytapPayOrderInfoExt">
       insert into heytap_pay_order_info_ext
       <trim prefix="(" suffix=")" suffixOverrides=",">
         <if test="id != null">
           id,
         </if>
         <if test="tradeNo != null">
           trade_no,
         </if>
         <if test="tradeProvince != null">
           trade_province,
         </if>
         <if test="tradeCity != null">
           trade_city,
         </if>
         <if test="tradeDistrict != null">
           trade_district,
         </if>
         <if test="recipientProvince != null">
           recipient_province,
         </if>
         <if test="recipientCity != null">
           recipient_city,
         </if>
         <if test="recipientDistrict != null">
           recipient_district,
         </if>
       </trim>
       <trim prefix="values (" suffix=")" suffixOverrides=",">
         <if test="id != null">
           #{id,jdbcType=INTEGER},
         </if>
         <if test="tradeNo != null">
           #{tradeNo,jdbcType=VARCHAR},
         </if>
         <if test="tradeProvince != null">
           #{tradeProvince,jdbcType=VARCHAR},
         </if>
         <if test="tradeCity != null">
           #{tradeCity,jdbcType=VARCHAR},
         </if>
         <if test="tradeDistrict != null">
           #{tradeDistrict,jdbcType=VARCHAR},
         </if>
         <if test="recipientProvince != null">
           #{recipientProvince,jdbcType=VARCHAR},
         </if>
         <if test="recipientCity != null">
           #{recipientCity,jdbcType=VARCHAR},
         </if>
         <if test="recipientDistrict != null">
           #{recipientDistrict,jdbcType=VARCHAR},
         </if>
       </trim>
       ON DUPLICATE KEY UPDATE
       <trim suffixOverrides=",">
         <if test="tradeNo != null">
           trade_no = #{tradeNo,jdbcType=VARCHAR},
         </if>
         <if test="tradeProvince != null">
           trade_province = #{tradeProvince,jdbcType=VARCHAR},
         </if>
         <if test="tradeCity != null">
           trade_city = #{tradeCity,jdbcType=VARCHAR},
         </if>
         <if test="tradeDistrict != null">
           trade_district = #{tradeDistrict,jdbcType=VARCHAR},
         </if>
         <if test="recipientProvince != null">
           recipient_province = #{recipientProvince,jdbcType=VARCHAR},
         </if>
         <if test="recipientCity != null">
           recipient_city = #{recipientCity,jdbcType=VARCHAR},
         </if>
         <if test="recipientDistrict != null">
           recipient_district = #{recipientDistrict,jdbcType=VARCHAR},
         </if>
       </trim>
     </insert>
   ```
   
   But the actual sql seems the `<if test="recipientCity != null">` does not work now
   
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org