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>

 

posted @ 2013-06-05 11:47  王若伊_恩赐解脱  阅读(515)  评论(0编辑  收藏  举报