linwe
2023-12-08 91e2a286bb5b72172bb2e2d5f96be03439c51f72
src/main/java/org/springblade/modules/house/mapper/HouseRentalMapper.xml
@@ -58,7 +58,7 @@
    <select id="selectHouseRentalPage" resultType="org.springblade.modules.house.vo.HouseRentalTenantVO">
        SELECT jhr.*,jda.address_name as houseName,b.tenantName,b.phone,
        concat(jh.district_name," ",jh.building," ",unit," ",room) as address,
        case when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8 then 1
        case when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )&gt;= 8 then 1
             when TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )&lt;4 then 3
             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
@@ -91,6 +91,7 @@
            </if>
            <if test="vo.auditStatus ==20">
                AND TIMESTAMPDIFF( day, now(), jhr.due_time )&lt;30
                AND TIMESTAMPDIFF( day, now(), jhr.due_time )&gt;= 0
            </if>
            <if test="vo.auditStatus ==30">
                AND date_format(jhr.due_time,'%Y-%m-%d')&lt; date_format(now(),'%Y-%m-%d')
@@ -110,7 +111,7 @@
        </if>
        <if test="vo.dldType != null">
            <if test="vo.dldType ==1 ">
                AND TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )>= 8
                AND TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )&gt;= 8
            </if>
            <if test="vo.dldType ==2 ">
                AND  4 &lt;= TIMESTAMPDIFF( MONTH, jhr.rental_time, jhr.due_time )