- 1: BULK INSERT
- <insert id= "Insertbatch" parametertype= "Java.util.List" >
- Insert into Recipedetail (Rdid, ROID, TYPE,
- NAME, Mediweight, Medinum,
- Money, Operatetime, Chargenumber,
- REMARK, instruction, Amountevery,
- Mediunit, STATUS)
- <!--sequence Oracle Auto-Increase
- Select Seq_recipedetail.nextval,a.* from (
- <foreach collection= "List" item= "item" index= "index" separator= "union All" >
- Select #{item.roid,jdbctype=decimal}, #{item.type,jdbctype=decimal},
- #{item.name,jdbctype=nvarchar}, #{item.mediweight,jdbctype=decimal}, #{item.medinum,jdbctype=decimal},
- #{item.money,jdbctype=decimal}, #{item.operatetime,jdbctype=timestamp}, #{item.chargenumber,jdbctype=nvarchar},
- #{item.remark,jdbctype=nvarchar}, #{item.instruction,jdbctype=nvarchar}, #{item.amountevery,jdbctype=decimal},
- #{item.mediunit,jdbctype=nvarchar}, #{item.status,jdbctype=decimal}
- From DUAL
- </foreach>
- ) A
- </insert>
- 2: Batch Update
- <update id= "UpdateBatch" parametertype= "Java.util.List" >
- <foreach collection= "List" item= "item" index= "index" open= "Begin" close= "END;" separator= ";" >
- Update Recipedetail Set
- ROID = #{item.roid,jdbctype=decimal},
- TYPE = #{item.type,jdbctype=decimal},
- NAME = #{item.name,jdbctype=nvarchar},
- Mediweight = #{item.mediweight,jdbctype=decimal},
- Medinum = #{item.medinum,jdbctype=decimal},
- Money = #{item.money,jdbctype=decimal},
- Operatetime = #{item.operatetime,jdbctype=timestamp},
- Chargenumber = #{item.chargenumber,jdbctype=nvarchar},
- REMARK = #{item.remark,jdbctype=nvarchar},
- instruction = #{item.instruction,jdbctype=nvarchar},
- Amountevery = #{item.amountevery,jdbctype=decimal},
- Mediunit = #{item.mediunit,jdbctype=nvarchar},
- STATUS = #{item.status,jdbctype=decimal}
- where Rdid = #{item.rdid,jdbctype=decimal}
- </foreach>
- </update>
Oracle Bulk Operations Database