|
|
@@ -52,6 +52,25 @@
|
|
|
<if test="entity.areaMax != null">
|
|
|
AND b.area <= COALESCE(#{entity.areaMax}, b.area)
|
|
|
</if>
|
|
|
+ <!-- 新增 status 条件:空查全部,1=空闲,2=已租,3=到期 -->
|
|
|
+ <if test="entity.status != null">
|
|
|
+ <choose>
|
|
|
+ <when test="entity.status == 1">
|
|
|
+ AND a.status = '空闲'
|
|
|
+ </when>
|
|
|
+ <when test="entity.status == 2">
|
|
|
+ AND a.status = '已租'
|
|
|
+ </when>
|
|
|
+ <when test="entity.status == 3">
|
|
|
+ AND EXISTS (
|
|
|
+ SELECT 1
|
|
|
+ FROM a_contract_info c
|
|
|
+ WHERE c.simplified_house_id = a.id
|
|
|
+ AND c.contract_expiration_date < CURDATE()
|
|
|
+ )
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
<if test="sortClause != null and sortClause != ''">
|
|
|
ORDER BY ${sortClause}
|
|
|
@@ -63,7 +82,6 @@
|
|
|
<if test="offset != null and limit != null">
|
|
|
LIMIT #{offset}, #{limit}
|
|
|
</if>
|
|
|
-
|
|
|
</select>
|
|
|
<select id="getListPageTotal" resultType="java.lang.Long">
|
|
|
SELECT count(*)
|
|
|
@@ -91,6 +109,24 @@
|
|
|
<if test="entity.areaMax != null">
|
|
|
AND b.area <= COALESCE(#{entity.areaMax}, b.area)
|
|
|
</if>
|
|
|
+ <if test="entity.status != null">
|
|
|
+ <choose>
|
|
|
+ <when test="entity.status == 1">
|
|
|
+ AND a.status = '空闲'
|
|
|
+ </when>
|
|
|
+ <when test="entity.status == 2">
|
|
|
+ AND a.status = '已租'
|
|
|
+ </when>
|
|
|
+ <when test="entity.status == 3">
|
|
|
+ AND EXISTS (
|
|
|
+ SELECT 1
|
|
|
+ FROM a_contract_info c
|
|
|
+ WHERE c.simplified_house_id = a.id
|
|
|
+ AND c.contract_expiration_date < CURDATE()
|
|
|
+ )
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
+ </if>
|
|
|
</where>
|
|
|
</select>
|
|
|
<select id="getArrears" resultType="java.util.Map">
|