基于数据库计算两个经纬度之间的距离

SELECT
6370 * acos(
cos(
radians(#{lat})) * cos(radians(weidu)) * cos(radians(jingdu) - radians(#{lng})) + sin(radians(#{lat})) * sin(radians(weidu))) AS distance,
qiyemingcheng,jingdu,weidu,id
from ${tableId}
posted @ 2020-03-25 17:20  滴滴滴滴哒  阅读(400)  评论(0编辑  收藏  举报