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>