package com.hfkj.dao;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * mapper扩展类
 */
public interface BsGasOilPriceWeekMapperExt {

    /**
     * 更新价格
     * @param week 周期
     */
    @Update(" update (select weeks,mer_id,oil_no,price_official,price_gun,price_vip from bs_gas_oil_price_week where weeks = #{week}) a " +
            " LEFT JOIN bs_gas_oil_price b on b.mer_id = a.mer_id and b.oil_no = a.oil_no " +
            " set b.price_official = a.price_official,b.price_gun = a.price_gun, b.price_vip = a.price_vip, b.gas_station_drop = (a.price_official - a.price_gun)")
    void updatePrice(@Param("week") Integer week);
}
