进行批量操作的时候,一定要事先判断数组非空

<insert id="batchInsert"parameterType="java.util.List">
insert into DATA (ID, TEXT, STAUTS)
<foreach close=")"collection="list"item="item"index="index"open="("separator="union">
select
#{item.id,jdbcType=VARCHAR},
#{item.text,jdbcType=VARCHAR},
#{item.stauts,jdbcType=VARCHAR}
from dual
</foreach>
</insert>
AND r.license_plate IN
<foreach collection="rdRiskEventInfoList" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>

  

update rd_risk_event_info SET truck_risk_id=#{id, jdbcType=VARCHAR} where id in
<foreach item="item" index="index" collection="idList" open="("
separator="," close=")">
#{item.id}
</foreach>

  

最新文章

  1. 这有一个flag
  2. CPU host-passthrough技术与应用
  3. mysql中char与varchar的区别分析(补充一句,int和integer没区别)
  4. C++编译错误cannot have cv-qualifier
  5. WebRTC录音(2)-录音文件转换成WAV格式
  6. MPAndroiddChart的使用
  7. 通过 ANE(Adobe Native Extension) 启动Andriod服务 推送消息(四)
  8. Hibernate一级缓存、二级缓存
  9. iOS、mac开源项目及库汇总
  10. PHP连续签到
  11. 第一个XAML程序
  12. hdu 1520Anniversary party(简单树形dp)
  13. 通过Elasticsearch使用的你的数据
  14. 结对编程-四则运算-GUI
  15. python 3 ---购物车练习
  16. JdbcTemplate实现CRUD操作
  17. eclipse+IDEA快捷键记录
  18. XP远程连接Win10,提示【远程计算机需要网络级别身份验证,而您的计算机不支持该验证】
  19. (2.10)Mysql之SQL基础——约束及主键重复处理
  20. 表单验证—js循环所有表单验证

热门文章

  1. ab压力测试工具的使用
  2. 【PyQt5-Qt Designer】添加图片+鼠标点击
  3. IIS进程回收导致定时器失效的一种解决办法
  4. winform创建快捷方式
  5. HTTP协议属于应用层,而SOCKS协议属于传输层
  6. Verilog如何从外部更改模块内参数
  7. 如何修改帝国cms文章点击量默认值和成倍增加
  8. Postman教程
  9. String扩展 让你在PadLeft和PadRight时不再受单双字节问题困扰
  10. js将一位数组分割成每三个一组