| | |
| | | <resultMap id="houseRentalTenant" type="org.springblade.modules.house.vo.HouseRentalVO" |
| | | autoMapping="true"> |
| | | <id property="id" column="id"/> |
| | | <collection property="houseTenantVOList" javaType="java.util.List" |
| | | ofType="org.springblade.modules.house.vo.HouseTenantVO" autoMapping="true"> |
| | | <collection property="householdVOList" javaType="java.util.List" |
| | | ofType="org.springblade.modules.house.vo.HouseholdVO" autoMapping="true"> |
| | | <id property="id" column="tenantId"/> |
| | | </collection> |
| | | </resultMap> |
| | |
| | | concat(jh.district_name," ",jh.building," ",unit," ",room) as address, |
| | | case when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8 then 1 |
| | | when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )<4 then 3 |
| | | else 2 end as dldType |
| | | else 2 end as dldType, |
| | | if(jhr.termination_time is null,if(date_format(jhr.due_time,'%Y-%m-%d') >= date_format(now(),'%Y-%m-%d'),0,1),2) as status |
| | | FROM jczz_house_rental jhr |
| | | JOIN jczz_doorplate_address jda ON jda.address_code = jhr.house_code |
| | | JOIN jczz_house jh ON jh.house_code = jhr.house_code |
| | | LEFT JOIN ( |
| | | SELECT jht.housing_rental_id,jht.name as tenantName,jht.phone |
| | | FROM jczz_house_tenant jht RIGHT JOIN ( |
| | | SELECT jht.housing_rental_id,jht.name as tenantName,jht.phone_number as phone |
| | | FROM jczz_household jht RIGHT JOIN ( |
| | | SELECT MAX(ID) as id,housing_rental_id |
| | | FROM jczz_house_tenant |
| | | FROM jczz_household |
| | | WHERE is_deleted = 0 |
| | | <if test="vo.tenantName != null and vo.tenantName != ''"> |
| | | AND name LIKE CONCAT('%',#{vo.tenantName},'%') |
| | | </if> |
| | | and housing_rental_id is not null |
| | | GROUP BY housing_rental_id |
| | | ) a ON a.id = jht.id |
| | | ) a ON a.id = jht.id and a.housing_rental_id is not null |
| | | ) b ON b.housing_rental_id = jhr.id |
| | | WHERE jhr.is_deleted = 0 |
| | | <if test="vo.auditStatus != null and vo.auditStatus != ''"> |
| | |
| | | select |
| | | jhr.*, |
| | | if(termination_time is null,if(date_format(jhr.due_time,'%Y-%m-%d') >= date_format(now(),'%Y-%m-%d'),0,1),2) as status, |
| | | jht.id as tenantId,jht.* |
| | | jht.id as tenantId, |
| | | jht.* |
| | | from jczz_house_rental jhr |
| | | left join jczz_house_tenant jht on jhr.id = jht.housing_rental_id and jht.is_deleted = 0 |
| | | left join jczz_household jht on jhr.id = jht.housing_rental_id and jht.is_deleted = 0 |
| | | where 1 = 1 |
| | | and jhr.is_deleted = 0 |
| | | and house_code = #{code} |
| | | and jhr.house_code = #{code} |
| | | </select> |
| | | |
| | | <sql id="filterHouseGrid"> |