SQL批量添加并修改语句

原创
2018/09/21 11:11
阅读数 15
<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 收藏
分享
加载中
666666😄
2019/05/08 20:33
回复
举报
更多评论
打赏
1 评论
1 收藏
1
分享
返回顶部
顶部