shenyijian
2024-06-21 f20611265f7d34fd4fbcdfdaff6cb9cccd0b25fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?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>