mybatis 批量插入使用序列以及批量更新(Oracle数据库)

<!-- 批量 -->
<insert id="insertBatch" parameterType="java.util.List">
insert into MOBILE_RECIPIENT(ID, MOBILE_DETAIL_ID, MOBILE, ERROR, STATUS, CREATE_TIME,CONTENT)
 select SEQUENCE_MOBILE_RECIPIENT_ID.NEXTVAL ,A.* from (
  <foreach collection="list" item="item" index="index" separator="union all" >
      select  
         #{item.mobileDetailId,jdbcType=DECIMAL},
#{item.mobile,jdbcType=VARCHAR},
#{item.error,jdbcType=VARCHAR}, #{item.status,jdbcType=DECIMAL}, #{item.createTime,jdbcType=DATE},#{item.content,jdbcType=VARCHAR}
       from dual
    </foreach>) A

</insert>java

<!--批量更新- Oracle数据库->数据库

<update id="updateAfterSendByListTask" parameterType="java.util.List">
   begin
<foreach collection="list" item="item" index="index" open=""
close="" separator=";">
update MOBILE_RECIPIENT
<set>
<if test="item.status != null">
STATUS = #{item.status,jdbcType=DECIMAL},
</if>
<if test="item.error != null">
ERROR = #{item.error,jdbcType=VARCHAR},
</if>
</set>
where MOBILE = #{item.mobile,jdbcType=VARCHAR} and INFORMATION_NO =
#{item.informationNo,jdbcType=VARCHAR}
</foreach>
      ;end;
</update>
spa