linwe
2023-12-06 27aba12a2708699d5bab06db3d6f508da595b7b7
src/main/java/org/springblade/modules/house/mapper/HouseRentalMapper.xml
@@ -161,8 +161,8 @@
            FROM jczz_house_rental jhr
            LEFT JOIN
            (
                select housing_rental_id,count(*) num from jczz_house_tenant
                where is_deleted = 0
        select housing_rental_id,count(*) num from jczz_household
        where is_deleted = 0 and housing_rental_id is not null
                GROUP BY housing_rental_id
            ) jht
            ON jht.housing_rental_id = jhr.id
@@ -180,7 +180,9 @@
            FROM jczz_house_rental jhr
            LEFT JOIN
            (
            select housing_rental_id,count(*) num from jczz_house_tenant where is_deleted = 0 GROUP BY housing_rental_id
        select housing_rental_id,count(*) num from jczz_household
        where is_deleted = 0 and housing_rental_id is not null
        GROUP BY housing_rental_id
            ) jht
            ON jht.housing_rental_id = jhr.id
            LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jhr.house_code
@@ -197,7 +199,9 @@
            FROM jczz_house_rental jhr
            LEFT JOIN
            (
            select housing_rental_id,count(*) num from jczz_house_tenant where is_deleted = 0 GROUP BY housing_rental_id
        select housing_rental_id,count(*) num from jczz_household
        where is_deleted = 0 and housing_rental_id is not null
        GROUP BY housing_rental_id
            ) jht
            ON jht.housing_rental_id = jhr.id
            LEFT JOIN jczz_doorplate_address jda ON jda.address_code = jhr.house_code
@@ -223,11 +227,11 @@
        JOIN jczz_doorplate_address jda ON jda.address_code = jhr.house_code
        JOIN jczz_house jh ON jh.house_code = jhr.house_code and jh.is_deleted = 0
        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.phoneNumber phone
        FROM jczz_household jht RIGHT JOIN (
        SELECT MAX(ID) as id,housing_rental_id
        FROM jczz_house_tenant
        WHERE is_deleted = 0
        FROM jczz_household
        WHERE is_deleted = 0 and house_rental_id is not null
        <if test="vo.tenantName != null and vo.tenantName != ''">
            AND name LIKE CONCAT('%',#{vo.tenantName},'%')
        </if>