12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?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.HouseTargetEntityMapper">
- <select id="getListById" parameterType="java.lang.Long" resultType="com.dayou.entity.HouseTargetEntity">
- SELECT
- hte.*,
- clu.location as landLocation,
- clu.acreage as landAcreage,
- clu.use_to as landUseTo,
- clu.use_type as landUseType,
- clu.expire_date as landExpireDate,
- clu.certificate_no as landCertificateNo,
- cfa.location as assetsLocation,
- cfa.acreage_desc as assetsAcreage,
- cfa.use_to as assetsUseTo,
- cfa.own_ship_nature as assetsUseType,
- cfa.certificate_no as assetsCertificateNo,
- cfa.expire_date_desc as assetsExpireDate,
- hgt.land_use_to as targetLandUseTo,
- hgt.land_use_type as targetLandUseType
- FROM
- house_target_entity hte
- 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 (
- hte.business_id = clu.business_id
- AND hte.tid = clu.tid
- AND hte.tno = clu.tno)
- 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 (
- hte.business_id = cfa.business_id
- AND hte.tid = cfa.tid
- AND hte.tno = cfa.tno
- )
- 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)
- where hte.delete_status=0 and hte.business_id = #{docId}
- order by hte.tid asc ,hte.tno asc
- </select>
- <select id="getHouseRightsDTOList" parameterType="java.lang.Long" resultType="com.dayou.dto.HouseRightsDTO">
- SELECT
- hte.business_id,
- hte.tid,
- hte.tno,
- hte.use_info,
- hte.cert_combination as certType,
- hgt.*
- FROM
- house_target_entity hte
- LEFT JOIN ( SELECT t_id, doc_id, is_rent_out, has_rent_out_contract,
- rent_end_date, rent_start_date, rent_money, rent_user,
- has_pledge, pledge_user, pledge_type, pledge_value ,
- has_land_use_right,has_living_right,land_use_right_from,
- land_use_right_to FROM house_guaranty_target
- WHERE delete_status = 0 ) hgt ON (
- hgt.doc_id = hte.business_id
- AND hgt.t_id = hte.tid)
- where hte.delete_status=0 and hte.business_id = #{docId}
- order by hte.tid asc ,hte.tno asc
- </select>
- </mapper>
|