package com.hai.dao; import com.hai.entity.HighGasOilPrice; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Result; import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.type.JdbcType; import java.util.List; import java.util.Map; /** * mapper扩展类 */ public interface HighGasOilPriceMapperExt { @Select("" ) List> selectStoreListByOilNo(@Param("storeName") String storeName, @Param("regionId") Long regionId, @Param("oilNoName") String oilNoName); @Select({" SELECT a.store_key storeKey,ROUND((st_distance_sphere(point(a.longitude, a.latitude) , point(${longitude},${latitude}))/1000),2) as distance" + " FROM high_merchant_store a,high_gas_oil_price b where a.type = 1 and a.`status` = 1 and a.id = b.merchant_store_id and b.`status` = 1 " + " and a.longitude is not null and a.latitude is not null GROUP BY a.id" + " ORDER BY distance asc LIMIT 1 "}) Map recentGasStation(@Param("longitude") String longitude,@Param("latitude") String latitude); @Select({" select b.* from high_merchant_store a, high_gas_oil_price b " + " where a.id = b.merchant_store_id " + " and a.`status` = 1 " + " and a.region_id = #{regionId} " + " and b.oil_no = #{oilNo} "}) @Results({ @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT), @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER), @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), @Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL), @Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL), @Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL), @Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL), @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) }) List selectPriceListByRegionAndOilNo(@Param("regionId") Long regionId, @Param("oilNo") String oilNo); }