mitao
2025-04-03 a4ed0c4cb332c78eed9a72d153df01da0803cff1
ruoyi-system/src/main/resources/mapper/system/THouseMapper.xml
@@ -86,5 +86,17 @@
          AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
    </select>
    <select id="getRentedArea" resultType="java.lang.Double">
        SELECT COALESCE(SUM(t1.house_area),0) FROM t_house t1
        LEFT JOIN t_contract t2 ON t1.id = t2.house_id
        <where>
            t2.pay_type = 2 AND t1.lease_status != 1
            <if test="businessDeptId!=0">
                AND t1.business_dept_id = #{businessDeptId}
            </if>
            AND t1.disabled = ${@com.ruoyi.common.enums.DisabledEnum@NO.getCode()}
        </where>
        GROUP BY t1.id
    </select>
</mapper>