ibatis xml 数据库 批量新增 与批量删除
上边自己写的 下边是汪涛写的
<insert id="InsertMulti" parameterClass="ArrayList">
INSERT INTO [AdjustmentDetail] (
[SysNo]
,[AdjustmentSysNo]
,[ExternAdjustmentNum]
,[DetailNum]
,[Status]
,[InvChangePlanSysNo]
,[SKUSysNo]
,[SKUCode]
,[SKUDesc]
,[QTY]
,[LocationSysNo]
,[LocationCode]
,[LotNumber]
,[LPN]
,[RowCreateDate]
,[CreateUserID]
,[CreateUserName]
,[RowModifyDate]
,[ModifyUserID]
,[ModifyUserName]) VALUES
<iterate conjunction="," open="" close="">
(#[].SysNo#
,#[].AdjustmentSysNo#
,#[].ExternAdjustmentNum#
,#[].DetailNum#
,#[].Status#
,#[].InvChangePlanSysNo#
,#[].SKU.SysNo#
,#[].SKU.Code#
,#[].SKU.Description#
,#[].QTY#
,#[].Location.SysNo#
,#[].Location.Code#
,#[].LotNumber#
,#[].LPN#
,GETDATE()
,#[].CreateUserID#
,#[].CreateUserName#
,GETDATE()
,#[].CreateUserID#
,#[].CreateUserName#)
<delete id="DeleteMulti" parameterClass="ArrayList">
DELETE FROM [AdjustmentDetail]
WHERE [SysNo] IN
<iterate open="(" close=")" conjunction=",">
#[]#
</iterate>
</delete>
如果你觉得写的不错,欢迎转载和点赞。 转载时请保留作者署名jilodream/王若伊_恩赐解脱(博客链接:http://www.cnblogs.com/jilodream/