微信公众号:爱问CTO
专业编程问答社区
www.askcto.com
数据库是oracle
1.批量插入数据:
<insert id="insertData" parameterClass="java.util.List">
insert all
<iterate conjunction="">
into tableA(custom,flag) values
(#dataList[].custom#,#dataList[].flag#)
</iterate>
select * from dual
</insert>
2.批量删除数据
<delete id="insertData" parameterClass="java.util.List">
delete from tableA where custom in
<iterate conjunction="," open="(" close=")">
#dataList[].custom#
</iterate>
</delete>
一次传入list的数据不要超过1000,用的是in2.批量更新数据
3.批量更新数据
<update id="insertData" parameterClass="java.util.List">
update tableA set flag='1' where custom in
<iterate conjunction="," open="(" close=")">
#dataList[].custom#
</iterate>
</update>
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。