HouseGuarantyAreaMapper.xml 1.4 KB

123456789101112131415161718192021222324252627282930313233
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.dayou.mapper.HouseGuarantyAreaMapper">
  4. <select id="getByLngLat" resultType="com.dayou.entity.HouseGuarantyArea">
  5. SELECT * FROM house_guaranty_area
  6. WHERE ( lng &lt;=( #{lng}+0.01 ) and lng &gt;=( #{lng}-0.01 ))
  7. AND ( lat &gt;=( #{lat}-0.01 ) and lat &lt;=( #{lat}+0.01 ))
  8. and delete_status=0
  9. order by id desc limit 1
  10. </select>
  11. <select id="getAreasList" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseGuarantyArea">
  12. SELECT
  13. hga.*,
  14. hte.at_floor,
  15. hte.floor ,
  16. aim.act_address
  17. FROM
  18. house_guaranty_area hga
  19. LEFT JOIN (select doc_id,tid,tno,at_floor,floor from house_target_entity where delete_status = 0)hte ON (
  20. hga.doc_id = hte.doc_id
  21. AND hga.tid = hte.tid
  22. AND hga.tno = hte.tno)
  23. left join (select doc_id,tid,tno,act_address from house_guaranty_aim where delete_status = 0) aim on (
  24. hga.doc_id = aim.doc_id
  25. AND hga.tid = aim.tid
  26. AND hga.tno = aim.tno
  27. )
  28. where hga.delete_status = 0 and hga.doc_id = #{id} order by hga.id asc
  29. </select>
  30. </mapper>