xml中SQL批量更新的写法


<update id="batchUpdateReqDetail" parameterType="list">
<foreach collection="list" item="item">
update PROJECT_PLAN_REQ_DETAIL set
PLAN_PURCHASE_ID = #{item.planPurchaseId},
PLAN_STATUS = #{item.planStatus}
where 1=1 and PLAN_DETAIL_ID = #{item.planDetailId};
</foreach>
</update>

原文地址:https://www.cnblogs.com/gslgb/p/13747366.html