From a92d32bc8b5d3f9411ceb334e670405ef6b77575 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期三, 13 一月 2021 18:06:44 +0800
Subject: [PATCH] 优化 房屋出租记录

---
 java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml
index 1783f95..7c29256 100644
--- a/java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/user/OwnerServiceDaoImplMapper.xml
@@ -498,7 +498,7 @@
     <!-- 鏌ヨ鏈叆椹讳笟涓� 鎬绘暟 -->
     <select id="queryNoEnterRoomOwnerCount" parameterType="Map" resultType="Map">
         select
-            COUNT(1) count
+        COUNT(1) count
         from
         building_owner o
         left join building_owner_room_rel orr on o.owner_id = orr.owner_id and orr.status_cd = '0'
@@ -561,5 +561,36 @@
 
     </select>
 
+    <select id="queryOwnerLogsByRoom" parameterType="Map" resultType="Map">
+        SELECT
+        bo.owner_id ownerId,
+        bo.`name`,
+        bo.link,
+        t.start_time startTime,
+        t.end_time endTime,
+        t.create_time createTime,
+        t.room_id roomId
+        FROM
+        business_building_owner_room_rel t
+        INNER JOIN building_owner bo ON t.owner_id = bo.owner_id AND bo.status_cd = '0' AND bo.community_id = #{communityId}
+        WHERE
+        t.operate = 'ADD'
+        AND t.room_id = #{roomId}
+        ORDER BY
+        t.create_time DESC
+        <if test="page != -1 and page != null ">
+            limit #{page}, #{row}
+        </if>
+    </select>
+
+    <select id="queryOwnerLogsCountByRoom" parameterType="Map" resultType="Map">
+        select
+        COUNT(1) count
+        from business_building_owner_room_rel t
+        inner join building_owner bo on t.owner_id = bo.owner_id and bo.status_cd = '0' and bo.community_id = #{communityId}
+        where t.operate = 'ADD'
+        and t.room_id = #{roomId}
+        order by t.create_time desc
+    </select>
 
 </mapper>

--
Gitblit v1.8.0