|
|
@@ -62,6 +62,7 @@
|
|
|
|
|
|
<if test="houseStatus != null and houseStatus != ''">
|
|
|
AND hns.status = #{houseStatus}
|
|
|
+-- AND FIND_IN_SET(hns.status,#{houseNumberStatus})
|
|
|
</if>
|
|
|
|
|
|
<if test="houseNumberStatus != null and houseNumberStatus != ''">
|
|
|
@@ -379,6 +380,102 @@
|
|
|
</if>
|
|
|
ORDER BY b.building,b.element
|
|
|
</select>
|
|
|
+ <select id="getHouseNumberIds" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ `house_number`
|
|
|
+ WHERE deleted=0
|
|
|
+ </select>
|
|
|
+ <select id="getHouserNumberStatusIds" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ id
|
|
|
+ FROM
|
|
|
+ `house_number`
|
|
|
+ WHERE deleted=0
|
|
|
+ AND house_status=#{status}
|
|
|
+ </select>
|
|
|
+ <select id="getStateHouseNumber" resultType="java.lang.Integer">
|
|
|
+ SELECT
|
|
|
+ hn.id AS houseNumberId
|
|
|
+ FROM
|
|
|
+ `house_number` hn
|
|
|
+ LEFT JOIN house_number_state hns ON hn.id = hns.house_number_id
|
|
|
+ AND hns.deleted = 0
|
|
|
+ AND #{end} >= hns.start_time
|
|
|
+ AND hns.end_time >= #{start}
|
|
|
+ WHERE
|
|
|
+ hn.deleted = 0
|
|
|
+ AND FIND_IN_SET(hns.status,'3,4,5,6')
|
|
|
+ ORDER BY
|
|
|
+ hn.room_number
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="houseStateLeisurePage" resultType="com.template.model.vo.HouseStateVo">
|
|
|
+ SELECT
|
|
|
+ hn.id AS houseNumberId,
|
|
|
+ hn.house_id as houseId,
|
|
|
+ hn.room_number as houseNumber,
|
|
|
+ hn.house_status as houseStatus,
|
|
|
+ h.room_name as houseName,
|
|
|
+ hns.`status` AS status,
|
|
|
+ ho.reserve_name as reserveName,
|
|
|
+ ho.reserve_live_time as reserveLiveTime,
|
|
|
+ ho.reserve_leave_time as reserveLeaveTime,
|
|
|
+ h.room_live_time as roomLiveTime,
|
|
|
+ h.receiving_time as receivingTime,
|
|
|
+ hns.id as houseNumberStateId,
|
|
|
+ ho.order_number as orderNumber,
|
|
|
+ h.room_type as roomType,
|
|
|
+ b.building,
|
|
|
+ b.element,
|
|
|
+ ho.key_type as lockStatus,
|
|
|
+ ho.key_pass_word as passWord,
|
|
|
+ ho.order_status as orderStatus,
|
|
|
+ ho.id as houseOrderId,
|
|
|
+ ho.live_time AS liveTime,
|
|
|
+ ho.leave_time AS leaveTime,
|
|
|
+ hns.start_time as startTime,
|
|
|
+ hns.end_time as endTime
|
|
|
+ FROM
|
|
|
+ `house_number` hn
|
|
|
+ LEFT JOIN house h ON h.id = hn.house_id
|
|
|
+ AND h.deleted = 0
|
|
|
+ LEFT JOIN house_number_state hns ON hn.id = hns.house_number_id
|
|
|
+ AND hns.deleted = 0
|
|
|
+ AND #{end}>= hns.start_time
|
|
|
+ AND hns.end_time>= #{start}
|
|
|
+ LEFT JOIN house_order ho ON hns.order_number = ho.order_number
|
|
|
+ AND ho.deleted = 0
|
|
|
+ LEFT JOIN building b ON b.id = hn.building_id
|
|
|
+ AND b.deleted = 0
|
|
|
+
|
|
|
+ <where>
|
|
|
+ hn.deleted = 0
|
|
|
+ <if test="houseType != null and houseType != ''">
|
|
|
+ AND h.room_type = #{houseType}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="keyWord != null and keyWord != ''">
|
|
|
+ AND ( hn.room_number LIKE '%' #{keyWord} '%' OR ho.reserve_name LIKE '%' #{keyWord} '%' )
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="houseId != null and houseId != ''">
|
|
|
+ AND hn.house_id = #{houseId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="buildingId != null and buildingId != ''">
|
|
|
+ AND hn.building_id = #{buildingId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="houseNumberIds != null and houseNumberIds != ''">
|
|
|
+ AND FIND_IN_SET(hn.id,#{houseNumberIds})
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </where>
|
|
|
+ ORDER BY
|
|
|
+ hn.room_number
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
</mapper>
|