SQL批量添加并修改语句

原创
2018/09/21 11:11
阅读数 137
<update id="udate" parameterType="java.util.List">
      INSERT INTO hcoin_invite_data_summary(
      uid,
      phone,
      invite_code_num,
      invite_use_num,
      kyc1_scale,
      kyc2_scale,
      invite_rake_back,
      created_date,
      modify_date
      ) VALUES
      <foreach collection="list" item="item"  separator="," >
          ( #{item.uid},
              #{item.phone},
              #{item.inviteCodeNum},
              #{item.inviteUseNum},
              #{item.kyc1Scale},
              #{item.kyc2Scale},
              #{item.inviteRakeBack},
              #{item.createdDate},
              #{item.modifyDate})
      </foreach>
          ON DUPLICATE KEY UPDATE
               phone = VALUES(phone),
               invite_code_num = VALUES(invite_code_num),
               invite_use_num = VALUES(invite_use_num),
               kyc1_scale = VALUES(kyc1_scale),
               kyc2_scale = VALUES(kyc2_scale),
               invite_rake_back = VALUES(invite_rake_back),
               modify_date = VALUES(modify_date)
</update>
展开阅读全文
加载中
点击加入讨论🔥(1) 发布并加入讨论🔥
1 评论
1 收藏
1
分享
返回顶部
顶部