- 数据库表结构
2.最关键的就是这条sql
SELECT address_, longitude_, latitude_, ROUND(6378.138 * 2 * ASIN(SQRT(POW(SIN((? * PI() / 180 - latitude_ * PI() / 180) / 2), 2) + COS(? * PI() / 180) * COS(latitude_ * PI() / 180) * POW(SIN((? * PI() / 180 - longitude_ * PI() / 180) / 2), 2))) * 1000) AS distance_um FROM xf_lfhz_health_roll_addires where business_id = ? ORDER BY distance_um ASC LIMIT 0, 1
sql截图
这条sql 返回4 条信息 , (1)地址(2)经度(3)纬度(4)距离 单位m
java程序
时间: 2024-10-10 01:24:17