123456789101112131415161718192021222324252627282930313233 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.dayou.mapper.HouseGuarantyAreaMapper">
- <select id="getByLngLat" resultType="com.dayou.entity.HouseGuarantyArea">
- SELECT * FROM house_guaranty_area
- WHERE ( lng <=( #{lng}+0.01 ) and lng >=( #{lng}-0.01 ))
- AND ( lat >=( #{lat}-0.01 ) and lat <=( #{lat}+0.01 ))
- and delete_status=0
- order by id desc limit 1
- </select>
- <select id="getAreasList" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseGuarantyArea">
- SELECT
- hga.*,
- hte.at_floor,
- hte.floor ,
- aim.act_address
- FROM
- house_guaranty_area hga
- LEFT JOIN (select doc_id,tid,tno,at_floor,floor from house_target_entity where delete_status = 0)hte ON (
- hga.doc_id = hte.doc_id
- AND hga.tid = hte.tid
- AND hga.tno = hte.tno)
- left join (select doc_id,tid,tno,act_address from house_guaranty_aim where delete_status = 0) aim on (
- hga.doc_id = aim.doc_id
- AND hga.tid = aim.tid
- AND hga.tno = aim.tno
- )
- where hga.delete_status = 0 and hga.doc_id = #{id} order by hga.id asc
- </select>
- </mapper>
|