From 988624e3f6803cb312a4fd3fc5e1affc3771121f Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 18 九月 2020 16:15:29 +0800
Subject: [PATCH] 优化代码

---
 java110-db/src/main/resources/mapper/user/RentingPoolServiceDaoImplMapper.xml |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/user/RentingPoolServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/user/RentingPoolServiceDaoImplMapper.xml
index 49167dd..37ebddd 100644
--- a/java110-db/src/main/resources/mapper/user/RentingPoolServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/user/RentingPoolServiceDaoImplMapper.xml
@@ -69,6 +69,10 @@
         <if test="state !=null and state != ''">
             and t.state= #{state}
         </if>
+
+        <if test="rentingType !=null and rentingType != ''">
+            and rc.renting_type= #{rentingType}
+        </if>
         <if test="states !=null ">
             and t.state in
             <foreach collection="states" item="item" index="index" open="(" close=")" separator=",">
@@ -146,6 +150,7 @@
     <select id="queryRentingPoolsCount" parameterType="Map" resultType="Map">
         select count(1) count
         from renting_pool t
+        left join renting_config rc on t.renting_config_id = rc.renting_config_id and rc.status_cd = '0'
         where 1 =1
         <if test="latitude !=null and latitude != ''">
             and t.latitude= #{latitude}
@@ -192,6 +197,9 @@
         <if test="longitude !=null and longitude != ''">
             and t.longitude= #{longitude}
         </if>
+        <if test="rentingType !=null and rentingType != ''">
+            and rc.renting_type= #{rentingType}
+        </if>
 
 
     </select>

--
Gitblit v1.8.0