|
@@ -26,19 +26,32 @@
|
|
|
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
- <insert id="batchUpdate">
|
|
|
|
- <foreach collection="itemDoList" item="itemDo" index="index" open="" close="" separator=";">
|
|
|
|
- update nav
|
|
|
|
- <set>
|
|
|
|
- nav = #{itemDo.nav},
|
|
|
|
- cumulative_nav_withdrawal = #{itemDo.cumulativeNavWithdrawal},
|
|
|
|
- updatetime=#{itemDo.updateTime}
|
|
|
|
- </set>
|
|
|
|
- where isvalid = 1
|
|
|
|
- and fund_id = #{itemDo.fundId}
|
|
|
|
- and price_date = #{itemDo.priceDate}
|
|
|
|
|
|
+ <update id="batchUpdate" parameterType="java.util.List">
|
|
|
|
+ UPDATE nav
|
|
|
|
+ <set>
|
|
|
|
+ nav = CASE
|
|
|
|
+ <foreach collection="itemDoList" item="itemDo" separator=" ">
|
|
|
|
+ WHEN fund_id = #{itemDo.fundId} AND price_date = #{itemDo.priceDate} THEN #{itemDo.nav}
|
|
|
|
+ </foreach>
|
|
|
|
+ ELSE nav END,
|
|
|
|
+ cumulative_nav_withdrawal = CASE
|
|
|
|
+ <foreach collection="itemDoList" item="itemDo" separator=" ">
|
|
|
|
+ WHEN fund_id = #{itemDo.fundId} AND price_date = #{itemDo.priceDate} THEN #{itemDo.cumulativeNavWithdrawal}
|
|
|
|
+ </foreach>
|
|
|
|
+ ELSE cumulative_nav_withdrawal END,
|
|
|
|
+ updatetime = CASE
|
|
|
|
+ <foreach collection="itemDoList" item="itemDo" separator=" ">
|
|
|
|
+ WHEN fund_id = #{itemDo.fundId} AND price_date = #{itemDo.priceDate} THEN #{itemDo.updateTime}
|
|
|
|
+ </foreach>
|
|
|
|
+ ELSE updatetime END
|
|
|
|
+ </set>
|
|
|
|
+ WHERE isvalid = 1
|
|
|
|
+ AND (fund_id, price_date) IN
|
|
|
|
+ <foreach collection="itemDoList" item="itemDo" open="(" close=")" separator=",">
|
|
|
|
+ (#{itemDo.fundId}, #{itemDo.priceDate})
|
|
</foreach>
|
|
</foreach>
|
|
- </insert>
|
|
|
|
|
|
+ </update>
|
|
|
|
+
|
|
<insert id="saveNav" parameterType="com.simuwang.base.pojo.dos.NavDO">
|
|
<insert id="saveNav" parameterType="com.simuwang.base.pojo.dos.NavDO">
|
|
insert into nav(fund_id,price_date,nav,cumulative_nav,cumulative_nav_withdrawal,
|
|
insert into nav(fund_id,price_date,nav,cumulative_nav,cumulative_nav_withdrawal,
|
|
isvalid, creatorid, createtime, updaterid, updatetime)
|
|
isvalid, creatorid, createtime, updaterid, updatetime)
|