mybatis怎么给oracle批量插入数据
展开全部
<insert id="addTMsgSmsinfoForBatch" parameterType="java.util.List">
<selectKey resultType="long" keyProperty="id" order="BEFORE">
SELECT T_MSG_SMSINFO_SEQ.NEXTVAL AS id FROM dual
</selectKey>
INSERT INTO T_MSG_SMSINFO ( <include refid="columns_auotmsgsending" /> ) VALUES
<foreach collection="list" item="item" index="index"
separator=",">
( #{item.id},#{item.ecid},#{item.userid},#{item.sendermsisdn},#{item.receiverinfo},
#{item.totalrec},#{item.smsorigin},#{item.originid},#{item.smscontent},#{item.smstype},
#{item.scheduletime},#{item.auditstatus},#{item.inserttime},#{item.updatetime}
)
</foreach>
</insert>
就是在:
<selectKey resultType="long" keyProperty="id" order="BEFORE">
SELECT T_MSG_SMSINFO_SEQ.NEXTVAL AS id FROM dual
</selectKey>
<selectKey resultType="long" keyProperty="id" order="BEFORE">
SELECT T_MSG_SMSINFO_SEQ.NEXTVAL AS id FROM dual
</selectKey>
INSERT INTO T_MSG_SMSINFO ( <include refid="columns_auotmsgsending" /> ) VALUES
<foreach collection="list" item="item" index="index"
separator=",">
( #{item.id},#{item.ecid},#{item.userid},#{item.sendermsisdn},#{item.receiverinfo},
#{item.totalrec},#{item.smsorigin},#{item.originid},#{item.smscontent},#{item.smstype},
#{item.scheduletime},#{item.auditstatus},#{item.inserttime},#{item.updatetime}
)
</foreach>
</insert>
就是在:
<selectKey resultType="long" keyProperty="id" order="BEFORE">
SELECT T_MSG_SMSINFO_SEQ.NEXTVAL AS id FROM dual
</selectKey>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询