mybatis 对oracle数据库的merge批量插入数据怎么弄的吗
1个回答
展开全部
<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>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询