|
@@ -95,38 +95,46 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
- <!--<select id="queryNearbyList" resultMap="storeMap">-->
|
|
|
|
- <!--select * from-->
|
|
|
|
- <!--( select-->
|
|
|
|
- <!--`id`,-->
|
|
|
|
- <!--`store_name`,-->
|
|
|
|
- <!--`store_number`,-->
|
|
|
|
- <!--`store_address`,-->
|
|
|
|
- <!--`province_name`,-->
|
|
|
|
- <!--`city_name`,-->
|
|
|
|
- <!--`county_name`,-->
|
|
|
|
- <!--`latitude`,-->
|
|
|
|
- <!--`longitude`,-->
|
|
|
|
- <!--`cover_radius`,-->
|
|
|
|
- <!--`remark`,-->
|
|
|
|
- <!--round(6378.138*2*asin(sqrt(pow(sin( (a.latitude*pi()/180-#{latitude}*pi()/180)/2),2)-->
|
|
|
|
- <!--+cos(a.latitude*pi()/180)*cos(#{latitude}*pi()/180)* pow(sin(-->
|
|
|
|
- <!--(a.longitude*pi()/180-#{longitude}*pi()/180)/2),2)))*1000) as distance-->
|
|
|
|
- <!--from mall_store a-->
|
|
|
|
- <!--WHERE 1=1-->
|
|
|
|
- <!--<if test="province_name != null and province_name.trim() != ''">-->
|
|
|
|
- <!--AND province_name = #{province_name}-->
|
|
|
|
- <!--</if>-->
|
|
|
|
- <!--<if test="city_name != null and city_name.trim() != ''">-->
|
|
|
|
- <!--AND city_name = #{city_name}-->
|
|
|
|
- <!--</if>-->
|
|
|
|
- <!--<if test="county_name != null and county_name.trim() != ''">-->
|
|
|
|
- <!--AND county_name = #{county_name}-->
|
|
|
|
- <!--</if>-->
|
|
|
|
- <!--) tmp-->
|
|
|
|
- <!--where cover_radius * 1000 > distance-->
|
|
|
|
- <!--order by distance asc-->
|
|
|
|
- <!--</select>-->
|
|
|
|
|
|
+ <!-- 在配送范围之内查找店铺 -->
|
|
|
|
+ <!--<select id="queryNearbyList" resultMap="storeMap">
|
|
|
|
+ select * from
|
|
|
|
+ ( select
|
|
|
|
+ `id`,
|
|
|
|
+ `store_name`,
|
|
|
|
+ `store_number`,
|
|
|
|
+ `store_address`,
|
|
|
|
+ `province_name`,
|
|
|
|
+ `city_name`,
|
|
|
|
+ `county_name`,
|
|
|
|
+ `latitude`,
|
|
|
|
+ `longitude`,
|
|
|
|
+ `cover_radius`,
|
|
|
|
+ `remark`,
|
|
|
|
+ round(6378.138*2*asin(sqrt(pow(sin((a.latitude*pi()/180-#{latitude}*pi()/180)/2),2)
|
|
|
|
+ +cos(a.latitude*pi()/180)*cos(#{latitude}*pi()/180)
|
|
|
|
+ *pow(sin((a.longitude*pi()/180-#{longitude}*pi()/180)/2),2)))*1000) as distance,
|
|
|
|
+ merch_sn,
|
|
|
|
+ merch_name,
|
|
|
|
+ creater_sn,
|
|
|
|
+ create_time,
|
|
|
|
+ moder_sn,
|
|
|
|
+ mod_time,
|
|
|
|
+ tstm
|
|
|
|
+ from mall_store a
|
|
|
|
+ WHERE 1=1
|
|
|
|
+ <if test="province_name != null and province_name.trim() != ''">
|
|
|
|
+ AND province_name = #{province_name}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="city_name != null and city_name.trim() != ''">
|
|
|
|
+ AND city_name = #{city_name}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="county_name != null and county_name.trim() != ''">
|
|
|
|
+ AND county_name = #{county_name}
|
|
|
|
+ </if>
|
|
|
|
+ ) tmp
|
|
|
|
+ where cover_radius * 1000 > distance
|
|
|
|
+ order by distance asc
|
|
|
|
+ </select>-->
|
|
|
|
|
|
<!--删除距离限制-->
|
|
<!--删除距离限制-->
|
|
<select id="queryNearbyList" resultMap="storeMap">
|
|
<select id="queryNearbyList" resultMap="storeMap">
|
|
@@ -144,9 +152,15 @@
|
|
`cover_radius`,
|
|
`cover_radius`,
|
|
`remark`,
|
|
`remark`,
|
|
round(6378.138*2*asin(sqrt(pow(sin( (a.latitude*pi()/180-#{latitude}*pi()/180)/2),2)
|
|
round(6378.138*2*asin(sqrt(pow(sin( (a.latitude*pi()/180-#{latitude}*pi()/180)/2),2)
|
|
- +cos(a.latitude*pi()/180)*cos(#{latitude}*pi()/180)* pow(sin(
|
|
|
|
- (a.longitude*pi()/180-#{longitude}*pi()/180)/2),2)))*1000) as distance,merch_sn, merch_name, creater_sn, create_time,
|
|
|
|
- moder_sn, mod_time, tstm
|
|
|
|
|
|
+ +cos(a.latitude*pi()/180)*cos(#{latitude}*pi()/180)
|
|
|
|
+ *pow(sin((a.longitude*pi()/180-#{longitude}*pi()/180)/2),2)))*1000) as distance,
|
|
|
|
+ merch_sn,
|
|
|
|
+ merch_name,
|
|
|
|
+ creater_sn,
|
|
|
|
+ create_time,
|
|
|
|
+ moder_sn,
|
|
|
|
+ mod_time,
|
|
|
|
+ tstm
|
|
from mall_store a
|
|
from mall_store a
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
<if test="province_name != null and province_name.trim() != ''">
|
|
<if test="province_name != null and province_name.trim() != ''">
|
|
@@ -160,5 +174,6 @@
|
|
</if>
|
|
</if>
|
|
) tmp
|
|
) tmp
|
|
order by distance asc
|
|
order by distance asc
|
|
|
|
+ limit 0, 10
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|