| | |
| | | (#{latitude} * 3.1415) / 180) * SIN((bu.lat * 3.1415) / 180) + |
| | | COS((#{latitude} * 3.1415) / 180) * COS((bu.lat * 3.1415) / 180) * COS((#{longitude} * 3.1415) / 180 |
| | | - (bu.lng * 3.1415) / 180)) * 6370.996 |
| | | ), 2) <= 0.5 |
| | | ), 2) <= 1 |
| | | and bu.role_id like concat('%','1727864411451359233','%') |
| | | and bu.is_deleted = 0 |
| | | </select> |
| | |
| | | public List<User> getPoliceUser(String longitude, String latitude, String houseCode) { |
| | | List<User> policeUser = baseMapper.getPoliceUser(longitude, latitude); |
| | | // todo 自动生成警单 |
| | | if (StringUtils.isNotBlank(houseCode)) { |
| | | IPoliceAlarmRecordsService policeAlarmRecordsService = SpringUtil.getBean(IPoliceAlarmRecordsService.class); |
| | | PoliceAlarmRecordsEntity policeAlarmRecordsEntity = new PoliceAlarmRecordsEntity(); |
| | | policeAlarmRecordsEntity.setHouseCode(houseCode); |
| | |
| | | policeAlarmRecordsEntity.setPoliceId(policeUser.get(0).getId()); |
| | | } |
| | | policeAlarmRecordsService.save(policeAlarmRecordsEntity); |
| | | } |
| | | return policeUser; |
| | | } |
| | | } |