嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/dao/HighGasOilPriceMapperExt.java

41 lines
1.5 KiB

4 years ago
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," +
4 years ago
" a.oil_no," +
4 years ago
" a.price_gun," +
" a.price_vip," +
4 years ago
" a.price_official," +
4 years ago
" b.* " +
" FROM" +
" high_gas_oil_price a," +
" high_merchant_store b " +
" WHERE" +
" a.merchant_store_id = b.id " +
3 years ago
" AND b.`status` = 1 " +
3 years ago
" AND a.`status` = 1 " +
4 years ago
" 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);
3 years ago
3 years ago
@Select({" SELECT a.store_key storeKey,ROUND((st_distance_sphere(point(a.longitude, a.latitude) , point(${longitude},${latitude}))/1000),2) as distance" +
3 years ago
" 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 GROUP BY a.id" +
" ORDER BY distance asc LIMIT 1 "})
3 years ago
Map<String,Object> recentGasStation(@Param("longitude") String longitude,@Param("latitude") String latitude);
3 years ago
}