<!--批量新增-->
<insert id="addBatch" parameterType="java.util.List">
insert into stati_alarm_amount_month (id,stati_year_month,stor_conf_id,alarm_amount,out_amount,in_amount) values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.id},#{item.statiYearMonth},#{item.storConfId},#{item.alarmAmount},#{item.outAmount},#{item.inAmount})
</foreach>
</insert>
<!--批量更新-->
<update id="updateBatch" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" separator=";">
update stati_alarm_amount_month
set stor_conf_id=#{item.storConfId},alarm_amount=#{item.alarmAmount},out_amount=#{item.outAmount},in_amount=#{item.inAmount}
where id=#{item.id}
</foreach>
</update>
<!--批量更新 先删除后插入-->
<update id="updateBatch" parameterType="java.util.List">
delete from stati_duration_item_amount_month where stati_year_month=#{statiYearMonth};
insert into stati_duration_item_amount_month (id,duration_id,stati_year_month,stor_conf_id,item_amount) values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.id},#{item.durationId},#{item.statiYearMonth},#{item.storConfId},#{item.itemAmount})
</foreach>
ON DUPLICATE KEY UPDATE
stati_year_month= values(stati_year_month),duration_id=values(duration_id),stor_conf_id=values(stor_conf_id),item_amount=values(item_amount)
</update>