From 2b8df9f5452218cad1f012a008acea724de81fff Mon Sep 17 00:00:00 2001 From: 13693261870 <252740454@qq.com> Date: 星期三, 05 七月 2023 10:45:56 +0800 Subject: [PATCH] 1 --- src/main/resources/mapping/LocationMapper.xml | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/src/main/resources/mapping/LocationMapper.xml b/src/main/resources/mapping/LocationMapper.xml index a54d0d7..b99aa66 100644 --- a/src/main/resources/mapping/LocationMapper.xml +++ b/src/main/resources/mapping/LocationMapper.xml @@ -12,6 +12,15 @@ <sql id="locationSql"> SELECT id, name, type, format(lon, 6) lon, format(lat, 6) lat FROM location </sql> + + <select id="selectByXY" resultMap="locationResult"> + <include refid="locationSql"></include> + <where> + lon between (#{x} - 0.000027) and (#{x} + 0.000027) + and + lat between (#{y} - 0.000027) and (#{y} + 0.000027) + </where> + </select> <select id="query" resultMap="locationResult"> <include refid="locationSql"></include> -- Gitblit v1.9.3