1、批量删除
<delete id="deleteLanguageBatch"> delete from user where <foreach collection="list" item="item" separator="or"> id = #{item.id} name = #{item.name} </foreach> </delete>
2、批量插入
<!-- 批量插入 --> <insert id="batchInsert" parameterType="java.util.List"> INSERT INTO ORDER_GOODS
(
OG_ID, ORDER_ID, GOODS_DBID
)VALUE
<foreach collection="orderGoodsList" item="item" separator=",">
(
#{item.ogId},
#{item.orderId},
#{item.goodsDbid}
)
</foreach>
</insert>
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/279808.html