HouseTargetEntityMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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.HouseTargetEntityMapper">
  4. <select id="getListById" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseTargetEntity">
  5. SELECT
  6. hte.*,
  7. clu.location as landLocation,
  8. clu.acreage as landAcreage,
  9. clu.use_to as landUseTo,
  10. clu.use_type as landUseType,
  11. clu.expire_date as landExpireDate,
  12. clu.certificate_no as landCertificateNo,
  13. cfa.location as assetsLocation,
  14. cfa.acreage_desc as assetsAcreage,
  15. cfa.use_to as assetsUseTo,
  16. cfa.own_ship_nature as assetsUseType,
  17. cfa.certificate_no as assetsCertificateNo,
  18. cfa.expire_date_desc as assetsExpireDate,
  19. hgt.land_use_to as targetLandUseTo,
  20. hgt.land_use_type as targetLandUseType
  21. FROM
  22. house_target_entity hte
  23. LEFT JOIN (select business_id,tid,tno,certificate_no,location,acreage,use_to,use_type,expire_date from certificate_land_use where delete_status = 0) clu ON (
  24. hte.business_id = clu.business_id
  25. AND hte.tid = clu.tid
  26. AND hte.tno = clu.tno)
  27. left join (select business_id,tid,tno,certificate_no,location,acreage_desc,use_to,own_ship_nature,expire_date_desc from certificate_fixed_assets where delete_status = 0) cfa on (
  28. hte.business_id = cfa.business_id
  29. AND hte.tid = cfa.tid
  30. AND hte.tno = cfa.tno
  31. )
  32. left join (select t_id,doc_id,land_use_to ,land_use_type from house_guaranty_target where delete_status = 0) hgt on (hgt.doc_id = hte.business_id and hgt.t_id = hte.tid)
  33. where hte.delete_status=0 and hte.business_id = #{docId}
  34. order by hte.tid asc ,hte.tno asc
  35. </select>
  36. <select id="getHouseRightsDTOList" parameterType="java.lang.Long" resultType="com.dayou.dto.HouseRightsDTO">
  37. SELECT
  38. hte.business_id,
  39. hte.tid,
  40. hte.tno,
  41. hte.use_info,
  42. hte.cert_combination as certType,
  43. hgt.*
  44. FROM
  45. house_target_entity hte
  46. LEFT JOIN ( SELECT t_id, doc_id, is_rent_out, has_rent_out_contract,
  47. rent_end_date, rent_start_date, rent_money, rent_user,
  48. has_pledge, pledge_user, pledge_type, pledge_value ,
  49. has_land_use_right,has_living_right,land_use_right_from,
  50. land_use_right_to FROM house_guaranty_target
  51. WHERE delete_status = 0 ) hgt ON (
  52. hgt.doc_id = hte.business_id
  53. AND hgt.t_id = hte.tid)
  54. where hte.delete_status=0 and hte.business_id = #{docId}
  55. order by hte.tid asc ,hte.tno asc
  56. </select>
  57. </mapper>