1. 程式人生 > 資料庫 >Mybatis 資料庫Oracle (批量update)雙迴圈,多欄位,多條件操作以及多條sql寫法

Mybatis 資料庫Oracle (批量update)雙迴圈,多欄位,多條件操作以及多條sql寫法

批量更新多欄位,多條件

<update id="update" parameterType="java.util.List">
begin
<foreach item="item" collection="list" index="index" separator=";">
	update
		A
	SET 
		SJ = TO_DATE(#{item.sj},'yyyy-MM-dd hh24:mi:ss')
	WHERE
		zx 
	IN
	<foreach item="xxx" collection="item.xxx" index="index" separator=";">
		#{xxx}
	</foreach>
</foreach>
;
<****此處略*****>
;end;