The parameter passed in as long as the parameter of the list type is OK ...
1, BULK Insert
<insert id= "Insertbatch" parametertype= "java.util.List";
insert into T_city_index (
I D,city_code
)
Select Seq_city_index. nextval,cd.* from (
<foreach collection= "list" item= "item" index= "index" close= ")" open= "(" Separator= "union" ;
Select
#{item.citycode,jdbctype=varchar},
#{item.cityname,jdbctype=varchar}
F Rom dual
</foreach>
) CD
</insert>
2, batch with new
<update id= "UpdateBatch" Paramete Rtype= "Java.util.List";
<foreach collection= "List" item= "item" index= "index" open= "Begin" close= "; end;" Separator= ";"
Update T_city_index T
Set
t.city_name= #{item.cityname,jdbctype=varchar},
T.district_name= #{item.districtname,jdbctype=varchar},
where t.id = #{item.id,jdbctype=numeric}
< /foreach>
</update>
MyBatis Oracle Bulk INSERT, batch update