oracle在mybatis的批量更新操作
·
Integer updateLineSequence(@Param("list")List<LoadingPlanDVO> loadingPlanDList,
@Param("ownerID") String ownerID,
@Param("projectCode") String projectCode,
@Param("fixroute")String fixroute);
<update id="updateLineSequence" parameterType="java.util.List">
<!-- 使用PL/SQL块执行批量更新 -->
begin
<foreach collection="list" item="item" separator=";">
UPDATE linepoint l
SET l.serialnumber = #{item.loadingSeq}
WHERE l.OWNERID = #{ownerID}
AND l.PROJECTCODE = #{projectCode}
AND l.linecode = #{fixroute}
AND l.pointcode = #{item.unloadingPlace}
</foreach>
; -- 最后一个语句的分号,确保PL/SQL块正确结束
end;
</update>
更多推荐

所有评论(0)