select
st_distance_sphere (
point ( s.longitude, s.latitude ),
point ( #{longitudes}, #{latitudes} )) distance
from camping_goods g
left join camping_shop_info s on s.phone = g.shop_id
where g.goods_type = 3
and g.is_add = 0
<if test="searchValue != ''">
and g.goods_name like concat('%',#{searchValue},'%')
</if>
ORDER BY distance
MySQL空间函数 根据经纬度计算距离
最新推荐文章于 2024-06-13 20:33:33 发布