| | |
| | | SELECT id, name, type, format(lon, 6) lon, format(lat, 6) lat FROM location |
| | | </sql> |
| | | |
| | | <select id="selectByXY" resultMap="locationResult"> |
| | | <include refid="locationSql"></include> |
| | | <select id="selectByXY" resultType="com.yssh.entity.Location"> |
| | | select id, name, type, lon, lat from location |
| | | <where> |
| | | lon between (#{x} - 0.00009) and (#{x} + 0.00009) |
| | | lon between (#{x} - 0.0009) and (#{x} + 0.0009) |
| | | and |
| | | lat between (#{y} - 0.00009) and (#{y} + 0.00009) |
| | | lat between (#{y} - 0.0009) and (#{y} + 0.0009) |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="selectVocAddrs" resultMap="locationResult"> |
| | | <select id="selectVocAddrs" resultType="com.yssh.entity.Location"> |
| | | select id, x "lon", y "lat", addr "name" |
| | | from voc_addr |
| | | where length(addr) > 0; |
| | | </select> |
| | | |
| | | <select id="query" resultMap="locationResult"> |
| | | <select id="query" resultType="com.yssh.entity.Location"> |
| | | <include refid="locationSql"></include> |
| | | <where> |
| | | <if test="name != null and name != ''"> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="getAll" resultMap="locationResult"> |
| | | <include refid="locationSql"></include> |
| | | |
| | | <!--include refid="locationSql"></include--> |
| | | <select id="getAll" resultType="com.yssh.entity.Location"> |
| | | select id, name, type, lon, lat from location; |
| | | </select> |
| | | |
| | | <insert id="insertLocation" parameterType="com.yssh.entity.Location"> |