MyBatis 允许您使用其每个批处理驱动程序删除多行。要使用这个功能,您需要使用 mapper XML 文件中的 <foreach>。例如,如下所示:
<delete id="batchDeleteAccountById" parameterType="java.util.List">
delete from ACCOUNT
where
ACC_ID in
<foreach item="AccountID" collection="list" open="(" close=")" separator=",">
#{AccountID}
</foreach>
</delete>
<delete id="batchDeleteAccountById" parameterType="java.util.List">
delete from ACCOUNT
where
ACC_ID in
<foreach item="AccountID" collection="list" open="(" close=")" separator=",">
#{AccountID}
</foreach>
</delete>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
from("direct:start")
.to("mybatis:batchDeleteAccount?statementType=DeleteList")
.to("mock:result");
from("direct:start")
.to("mybatis:batchDeleteAccount?statementType=DeleteList")
.to("mock:result");
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow