ibatis批量插入实例

<insert id="deliver.deliverOwnerSetDTOListForAdd" parameterClass="java.util.Map">
<isEmpty property="deliverOwnerSetDTOListForAdd">select 1 from dual</isEmpty>
<isNotEmpty property="deliverOwnerSetDTOListForAdd">
begin
<iterate conjunction=";" property="deliverOwnerSetDTOListForAdd">
insert into t_deliver_owner_set(id,user_id,area_code,valid_flag,created_date,created_by,mail1,mail2)
values
(seq_deliver_owner_set_id.nextval,
#userId#,
#deliverOwnerSetDTOListForAdd[].areaCode#,
'1',
to_date(#deliverOwnerSetDTOListForAdd[].createdDate#,'YYYY-MM-DD HH24:MI:SS'),
#deliverOwnerSetDTOListForAdd[].createdBy#,
#deliverOwnerSetDTOListForAdd[].mail1#,
#deliverOwnerSetDTOListForAdd[].mail2#)
</iterate>
;end;
</isNotEmpty>
</insert>

你可能感兴趣的:(ibatis批量插入实例)