| | |
| | | <select id="selectAttStBaseRadius" resultType="cn.gistack.sm.sjztmd.entity.AttStBase"> |
| | | select * |
| | | from (select a.*, |
| | | Get_Distance(a."station_latitude", a."station_longitude", #{attStBase.stationLatitude}, #{attStBase.stationLongitude}) * 2.2 as radius |
| | | Get_Distance(a."station_latitude", a."station_longitude", #{attStBase.stationLatitude}, #{attStBase.stationLongitude}) * 2.2 as radius, |
| | | Get_Distance(b."center_lat", b."center_long", #{attStBase.stationLatitude}, #{attStBase.stationLongitude}) * 2.2 as sk_radius |
| | | from "att_st_base" a |
| | | WHERE a."station_latitude" IS NOT NULL |
| | | AND a."station_longitude" IS NOT NULL AND (a."is_pptn" = 1 or a."is_rsvr" = 1) ) a |
| | | where a.radius between 0 and #{attStBase.radius} |
| | | left join "att_res_base" b on (a."res_guid" = b."guid") |
| | | --WHERE a."station_latitude" IS NOT NULL |
| | | -- AND a."station_longitude" IS NOT NULL AND (a."is_pptn" = 1 or a."is_rsvr" = 1) ) a |
| | | where a.radius between 0 and #{attStBase.radius} or b.sk_radius between 0 and #{attStBase.radius} |
| | | </select> |
| | | |
| | | </mapper> |