<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="cn.gistack.sm.sjztmd.mapper.AttStBaseMapper">
|
|
<select id="selectAttStBaseRadius" resultType="cn.gistack.sm.sjztmd.entity.AttStBase">
|
select *
|
from (select a.*,b."center_lat", b."center_long",
|
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
|
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 a.sk_radius between 0 and #{attStBase.radius}
|
</select>
|
|
</mapper>
|