<insert id="insertStockQuotaionByBatch" parameterType="java.util.List" useGeneratedKeys="false">
BEGIN
<foreach collection="list" item="item" index="index" separator=";">
merge into STOCK_QUOTATION a
using dual
on (a.stockno=#{item.stockno,jdbcType=VARCHAR} and a.TRADING_DAY = #{tradingDay,jdbcType=DATE})
when not matched then
insert into stock_quotation
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="stockno != null" >
STOCKNO,
</if>
<if test="tradingDay != null" >
TRADING_DAY,
</if>
<if test="stockName != null" >
STOCK_NAME,
</if>
<if test="openPrice != null" >
OPEN_PRICE,
</if>
<if test="closePrice != null" >
CLOSE_PRICE,
</if>
<if test="highestPrice != null" >
HIGHEST_PRICE,
</if>
<if test="lowestPrice != null" >
LOWEST_PRICE,
</if>
<if test="volume != null" >
VOLUME,
</if>
<if test="obv != null" >
OBV,
</if>
<if test="turnoverRate != null" >
turnover_rate,
</if>
<if test="amo != null" >
amo,
</if>
<if test="totalValue != null" >
total_value,
</if>
<if test="circulationMarketValue != null" >
circulation_market_value,
</if>
<if test="createdBy != null" >
CREATED_BY,
</if>
<if test="createdDate != null" >
CREATED_DATE,
</if>
<if test="updatedBy != null" >
UPDATED_BY,
</if>
<if test="updatedDate != null" >
UPDATED_DATE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="stockno != null" >
#{stockno,jdbcType=VARCHAR},
</if>
<if test="tradingDay != null" >
#{tradingDay,jdbcType=DATE},
</if>
<if test="stockName != null" >
#{stockName,jdbcType=VARCHAR},
</if>
<if test="openPrice != null" >
#{openPrice,jdbcType=DOUBLE},
</if>
<if test="closePrice != null" >
#{closePrice,jdbcType=DOUBLE},
</if>
<if test="highestPrice != null" >
#{highestPrice,jdbcType=DOUBLE},
</if>
<if test="lowestPrice != null" >
#{lowestPrice,jdbcType=DOUBLE},
</if>
<if test="volume != null" >
#{volume,jdbcType=INTEGER},
</if>
<if test="obv != null" >
#{obv,jdbcType=DOUBLE},
</if>
<if test="turnoverRate != null" >
#{turnoverRate,jdbcType=DOUBLE},
</if>
<if test="amo != null" >
#{amo,jdbcType=DOUBLE},
</if>
<if test="obv != null" >
#{totalValue,jdbcType=DOUBLE},
</if>
<if test="obv != null" >
#{circulationMarketValue,jdbcType=DOUBLE},
</if>
<if test="createdBy != null" >
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdDate != null" >
#{createdDate,jdbcType=DATE},
</if>
<if test="updatedBy != null" >
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedDate != null" >
#{updatedDate,jdbcType=DATE},
</if>
</trim>
</foreach>
;END;
</insert>
转载于:https://my.oschina.net/hfq/blog/1475501