|
@@ -49,9 +49,28 @@
|
|
|
<select id="distanceTableWkt" resultType="String">
|
|
|
SELECT id
|
|
|
FROM "${tableName}" inTbale
|
|
|
- where public.ST_DWithin(
|
|
|
- inTbale.geom::public.geography,
|
|
|
- public.st_geomfromewkt(#{ewkt})::public.geography,#{distance})
|
|
|
+ where
|
|
|
+ <choose>
|
|
|
+ <when test="distanceType == 1">
|
|
|
+ public.st_distance(inTbale.geom::public.geography,
|
|
|
+ public.st_geomfromewkt(#{ewkt})::public.geography) > #{distance}
|
|
|
+ </when>
|
|
|
+ <when test="distanceType == 2">
|
|
|
+ public.st_distance(inTbale.geom::public.geography,
|
|
|
+ public.st_geomfromewkt(#{ewkt})::public.geography) >= #{distance}
|
|
|
+ </when>
|
|
|
+ <when test="distanceType == 3">
|
|
|
+ public.st_distance(inTbale.geom::public.geography,
|
|
|
+ public.st_geomfromewkt(#{ewkt})::public.geography) < #{distance}
|
|
|
+ </when>
|
|
|
+ <when test="distanceType == 4">
|
|
|
+ public.st_distance(inTbale.geom::public.geography,
|
|
|
+ public.st_geomfromewkt(#{ewkt})::public.geography) <= #{distance}
|
|
|
+ </when>
|
|
|
+ <otherwise>
|
|
|
+ 1=1
|
|
|
+ </otherwise>
|
|
|
+ </choose>
|
|
|
<if test="tableIds != null and tableIds.size()>0 ">
|
|
|
and (inTbale.id::VARCHAR) in
|
|
|
<foreach collection="tableIds" item="tableId" open="(" close=")" separator=",">#{tableId}</foreach>
|