确保查询的点都在行政区内

This commit is contained in:
wzy-warehouse
2026-04-18 18:10:55 +08:00
parent 26c2c4a5b9
commit ac60d1b541
5 changed files with 57 additions and 23 deletions
@@ -37,8 +37,10 @@
disaster_type IN('滑坡', '泥石流')
</otherwise>
</choose>
AND is_delete = 0
<!-- 确定落在西安境内 -->
AND ST_Within(geom, (SELECT geom FROM xian_district WHERE id = 1))
</where>
AND is_delete = 0
</select>
<!-- 根据id获取隐患点详情 -->
@@ -75,6 +75,8 @@
SELECT id, lon, lat FROM xian_hospitals
<where>
is_delete = 0
<!-- 确定落在西安境内 -->
AND ST_Within(point, (SELECT geom FROM xian_district WHERE id = 1))
</where>
</select>
@@ -34,6 +34,8 @@
SELECT id, lon, lat FROM xian_risk_spots
<where>
is_delete = 0
<!-- 确定落在西安境内 -->
AND ST_Within(geom, (SELECT geom FROM xian_district WHERE id = 1))
</where>
</select>