MyBatis中对List<Object> 对象List的批处理插入操作
来源:互联网 发布:人工智能经济学 编辑:程序博客网 时间:2024/06/07 02:10
<insert id="insertAddressPosition" parameterType="java.util.List">
<selectKey keyProperty="p1" order="BEFORE" resultType="int">
select seq_app_addresslist.nextval from dual
</selectKey>
insert into appuser.ADDRESS_POSITION_BACKUP
(row_id,pos_id,pos_name,create_date,update_date)
<foreach collection="list" item="pop" separator="union all"
open="(" close=")">
select
#{p1},#{pop.ROLE_ID,jdbcType=VARCHAR},#{pop.ROLE_NAME,jdbcType=VARCHAR},
sysdate,sysdate
from dual
</foreach>
</insert>
<selectKey keyProperty="p1" order="BEFORE" resultType="int">
select seq_app_addresslist.nextval from dual
</selectKey>
insert into appuser.ADDRESS_POSITION_BACKUP
(row_id,pos_id,pos_name,create_date,update_date)
<foreach collection="list" item="pop" separator="union all"
open="(" close=")">
select
#{p1},#{pop.ROLE_ID,jdbcType=VARCHAR},#{pop.ROLE_NAME,jdbcType=VARCHAR},
sysdate,sysdate
from dual
</foreach>
</insert>
参照此篇文章 http://ask.csdn.net/questions/155651
这篇文章也不错 http://blog.csdn.net/moneyshi/article/details/22807239
阅读全文
0 0
- MyBatis中对List<Object> 对象List的批处理插入操作
- MyBatis中对List<Object> 对象List的批处理插入操作
- MyBatis中对List<Object> 对象List的批处理插入操作
- MyBatis中对List<Object> 对象List的批处理插入操作
- MyBatis中对List<Object> 对象List的批处理插入操作
- MyBatis中对List<Object> 对象List的批处理插入操作: 首先需要定义对象的<resultMap type="com.travelsky.domain.Order" id="ord
- MyBatis插入List对象
- mybatis 批量插入 list<object> in oracle
- 根据对象的某个字段对List<Object>排序
- mybatis 批量插入list对象集合
- 对List的操作
- java中对集合List的操作
- mybatis 返回 list<object>
- 对List中对象排序
- MyBatis返回类型List<Object>的设置
- Mybatis 之 foreach 批处理 map 中的键值 为list 的操作
- 【笔记】对遍历List,对List里的对象做删除操作
- mybatis的foreach插入List,Array,Map
- 1066. 图像过滤(15)——C语言
- mybatis xml写法
- Linux命令整理(一)
- 一张图看懂JavaScript中数组的迭代方法:forEach、map、filter、reduce、every、some
- 【云星数据---大数据集群部署系列006】:spark2.2部署方案
- MyBatis中对List<Object> 对象List的批处理插入操作
- [leetcode]455. Assign Cookies
- 面试会遇到的一些问题
- 视频驱动程序概念整理
- hbase架构原理之region、memstore、hfile、hlog、columm-family、colum、cell
- 安卓图片处理技术
- js复制文本内容到右键粘贴
- [51nod1824]染色游戏
- sqlserver中触发器