| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 通过警情位置查询附近安保人员 |
| | | * @return |
| | | */ |
| | | @PostMapping("/selectfj") |
| | | @ApiOperation(value = "通过警情位置查询附近安保人员", notes = "经纬度") |
| | | public R selectry(String jd,String wd) { |
| | | return R.data(positionService.selectfj(jd, wd)); |
| | | } |
| | | |
| | | } |
| | |
| | | int selectc(String snumber); |
| | | |
| | | List<Map<String, Object>> selectry(String coordinate); |
| | | List<Map<String, Object>> selectfj(String jd,String wd); |
| | | |
| | | } |
| | |
| | | SELECT count(*) FROM sys_position WHERE snumber=#{snumber} |
| | | </select> |
| | | |
| | | <select id="selectfj" resultType="java.util.HashMap"> |
| | | SELECT |
| | | snumber, `sname`,( |
| | | 6371 * acos ( |
| | | cos ( radians(wd) ) |
| | | * cos( radians(#{wd}) ) |
| | | * cos( radians(jd) - radians(#{jd}) ) |
| | | + sin ( radians(#{wd}) ) |
| | | * sin( radians(wd)) |
| | | ) |
| | | ) AS distance |
| | | FROM sys_position |
| | | HAVING distance <=5 |
| | | ORDER BY distance |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | List<Map<String, Object>> selectry(String coordinate); |
| | | void updateb(String snumber, String sname, String jd, String wd, String stime); |
| | | int selectc(String snumber); |
| | | List<Map<String, Object>> selectfj(String jd,String wd); |
| | | } |
| | |
| | | return baseMapper.selectc(snumber); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> selectfj(String jd, String wd) { |
| | | return baseMapper.selectfj(jd, wd); |
| | | } |
| | | |
| | | } |