<insert id="insertAopTradeForReq" >
insert into AOP_TRADE (
LOG_ID,
APPCODE,
BIZKEY ,
METHODCODE,
APPTX,
PROVINCE,
CITY,
CHANNEL_ID,
REQTIMES,
UPDATE_TIME
)
<foreach collection="list" item="item" index="index" separator="union all" >
(select
#{item.txid,jdbcType=VARCHAR},
#{item.appCode,jdbcType=VARCHAR},
#{item.bizkey,jdbcType=VARCHAR},
#{item.methodCode,jdbcType=VARCHAR},
#{item.apptx,jdbcType=VARCHAR},
#{item.province,jdbcType=VARCHAR},
#{item.city,jdbcType=VARCHAR},
#{item.channelId,jdbcType=VARCHAR},
#{item.reqTs,jdbcType=NUMERIC},
sysdate
from dual)
</foreach>
</insert>
由于oracle数据库不支持values,所以只能使用sparator='UNION'。。
如果是mysql数据库,第一种方式没有问题。