Oracle+mybatis实现批量插入
Oracle+mybatis实现批量插入
1.采用union all
<insert id="insertByBatch"parameterType="java.util.List"> insert into table( name, user_id, age ) <foreach collection="ist" item="item" index="index"separator="UNION ALL"> select ( #fitem.name} #fitem.user_id} #fitem.age from dual ) </foreach> </insert>
posted on 2024-01-02 21:34 VincentYew 阅读(638) 评论(0) 收藏 举报