package com.hai.dao;

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

import java.util.List;
import java.util.Map;

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

    @Select("<script>" +
            " SELECT" +
            " a.oil_no_name," +
            " a.oil_no," +
            " a.price_gun," +
            " a.price_vip," +
            " a.price_official," +
            " b.* " +
            " FROM" +
            " high_gas_oil_price a," +
            " high_merchant_store b " +
            " WHERE" +
            " a.merchant_store_id = b.id " +
            " AND b.`status` = 1 " +
            " AND a.`status` = 1 " +
            " AND b.region_id = #{regionId} " +
            " AND a.oil_no_name = #{oilNoName}" +
            "<if test='storeName != null'> and b.store_name like '%${storeName}%'</if>" +
            " </script>" )
    List<Map<String,Object>> selectStoreListByOilNo(@Param("storeName") String storeName, @Param("regionId") Long regionId, @Param("oilNoName") String oilNoName);

}
