|
@@ -18,6 +18,17 @@
|
|
|
order by distance asc limit #{size}
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="listNearbyMerchantPaging" resultType="com.chelvc.cloud.vehicle.client.dto.MerchantDTO">
|
|
|
+ select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,mt.business_status,
|
|
|
+ round(st_distance_sphere(
|
|
|
+ point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
|
+ )) distance
|
|
|
+ from `merchant` mt
|
|
|
+ where mt.region = #{param.region} and mt.status = 'ONLINE'
|
|
|
+ order by distance asc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="listRecommendMerchants" resultType="com.chelvc.cloud.vehicle.client.dto.MerchantDTO">
|
|
|
select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,mt.business_status,
|
|
|
round(st_distance_sphere(
|
|
@@ -28,6 +39,17 @@
|
|
|
order by distance asc limit #{size}
|
|
|
</select>
|
|
|
|
|
|
+
|
|
|
+ <select id="listRecommendMerchantPaging" resultType="com.chelvc.cloud.vehicle.client.dto.MerchantDTO">
|
|
|
+ select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,mt.business_status,
|
|
|
+ round(st_distance_sphere(
|
|
|
+ point(mt.longitude, mt.latitude), point(#{param.longitude}, #{param.latitude})
|
|
|
+ )) distance
|
|
|
+ from `merchant` mt
|
|
|
+ where mt.region = #{param.region} and mt.status = 'ONLINE' and mt.recommend = 1
|
|
|
+ order by distance asc
|
|
|
+ </select>
|
|
|
+
|
|
|
<select id="listSimpleMerchants" resultType="com.chelvc.cloud.vehicle.client.dto.MerchantDTO">
|
|
|
select mt.id, mt.name, mt.logo, mt.score, mt.sale, mt.address,mt.business_status,
|
|
|
round(st_distance_sphere(
|