前景提要
【围观】麒麟芯片遭打压成绝版,华为亿元投入又砸向了哪里?>>>
@Select("select * from (select *,"
+ " ROUND(6378.138*2*ASIN(SQRT(POW(SIN((#{x}*PI()/180-x_axis*PI()/180)/2),2)+COS(#{x}*PI()/180)*COS(x_axis*PI()/180)*POW(SIN((#{y}*PI()/180-y_axis*PI()/180)/2),2)))*1000) AS distance"
+ " from t_hat_village order by distance ) as a where a.distance<=#{range}")
说明:
x_axis 为数据库商家地址 的经度
y_axis 为数据库中商家地址的纬度
x 传入参数的经度
y 传入参数的纬度
参考博客:
https://zhidao.baidu.com/question/1436432968231782379.html