From 5bdf058a2a12c113b14e47c9049393642e9dae25 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期六, 28 十一月 2020 19:44:02 +0800
Subject: [PATCH] Merge http://139.155.19.15:8000/supervip/MicroCommunity

---
 java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml |   59 ++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 46 insertions(+), 13 deletions(-)

diff --git a/java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml
index 3c1ed14..c0cb494 100644
--- a/java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml
+++ b/java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml
@@ -6,8 +6,10 @@
     
     <!-- 淇濆瓨灏忓尯淇℃伅 add by wuxw 2018-07-03 -->
     <insert id="saveBusinessCommunityInfo" parameterType="Map">
-        insert into business_community(community_id,b_id,name,address,city_code,nearby_landmarks,map_x,map_y,month,state,operate)
-        values(#{communityId},#{bId},#{name},#{address},#{cityCode},#{nearbyLandmarks},#{mapX},#{mapY},#{month},#{state},#{operate})
+        insert into business_community(community_id,b_id,name,address,city_code,
+        nearby_landmarks,map_x,map_y,month,state,operate,community_area)
+        values(#{communityId},#{bId},#{name},#{address},#{cityCode},
+        #{nearbyLandmarks},#{mapX},#{mapY},#{month},#{state},#{operate},#{communityArea})
     </insert>
     <!-- 淇濆瓨灏忓尯灞炴�т俊鎭�  add by wuxw 2018-07-03 -->
     <insert id="saveBusinessCommunityAttr" parameterType="Map">
@@ -23,7 +25,8 @@
 
     <!-- 鏌ヨ灏忓尯淇℃伅锛圔usiness锛� add by wuxw 2018-07-03 -->
     <select id="getBusinessCommunityInfo" parameterType="Map" resultType="Map">
-        select s.community_id,s.b_id,s.name,s.address,s.city_code,s.nearby_landmarks,s.map_x,s.map_y,s.operate,s.state
+        select s.community_id,s.b_id,s.name,s.address,s.city_code,s.nearby_landmarks,
+        s.map_x,s.map_y,s.operate,s.state,s.community_area communityArea,s.community_area
         from business_community s where 1 = 1
         <if test="operate != null and operate != ''">
             and s.operate = #{operate}
@@ -73,8 +76,8 @@
 
     <!-- 淇濆瓨灏忓尯淇℃伅鑷� instance琛ㄤ腑 add by wuxw 2018-07-03 -->
     <insert id="saveCommunityInfoInstance" parameterType="Map">
-        insert into s_community(community_id,b_id,name,address,city_code,nearby_landmarks,map_x,map_y,status_cd,state)
-        values(#{community_id},#{b_id},#{name},#{address},#{city_code},#{nearby_landmarks},#{map_x},#{map_y},'0',#{state})
+        insert into s_community(community_id,b_id,name,address,city_code,nearby_landmarks,map_x,map_y,status_cd,state,community_area)
+        values(#{community_id},#{b_id},#{name},#{address},#{city_code},#{nearby_landmarks},#{map_x},#{map_y},'0',#{state},#{communityArea})
     </insert>
 
     <!-- 淇濆瓨灏忓尯灞炴�т俊鎭埌 instance add by wuxw 2018-07-03 -->
@@ -119,8 +122,14 @@
 
     <!-- 鏌ヨ灏忓尯灞炴�т俊鎭� add by wuxw 2018-07-03 -->
     <select id="getCommunityAttrs" parameterType="Map" resultType="Map">
-        select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,sa.status_cd
+        select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,sa.status_cd,
+        sa.b_id bId,sa.attr_id attrId,sa.community_id communityId,sa.spec_cd specCd,
+        s.spec_name specName,
+        v.value_name valueName,
+        s.list_show listShow
         from s_community_attr sa
+        left join attr_spec s on sa.spec_cd = s.spec_cd and s.status_cd = '0' and s.table_name = 'building_community_attr'
+        left join attr_value v on sa.`value` = v.`value` and sa.spec_cd = v.spec_cd and v.status_cd = '0'
         where
         1=1
         <if test="statusCd != null and statusCd != ''">
@@ -132,6 +141,13 @@
         <if test="communityId != null and communityId !=''">
             and sa.community_id = #{communityId}
         </if>
+        <if test="communityIds != null ">
+            and sa.community_id in
+            <foreach collection="communityIds" item="item" index="index" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+
         <if test="attrId != null and attrId != ''">
             and sa.attr_id = #{attrId}
         </if>
@@ -183,6 +199,10 @@
         <if test="state != null and state != ''">
             ,s.state = #{state}
         </if>
+        <if test="communityArea != null and communityArea != ''">
+            ,s.community_area = #{communityArea}
+        </if>
+
         where 1=1
         <if test="bId != null and bId !=''">
             and s.b_id = #{bId}
@@ -321,7 +341,7 @@
             and ms.member_id = #{memberId}
         </if>
         <if test="subMemberId != null and subMemberId != ''">
-            and ms.member_id = #{memberId}
+            and ms.member_id = #{subMemberId}
         </if>
         <if test="noAuditEnterCommunity == true">
             and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
@@ -338,6 +358,9 @@
         </if>
         <if test="communityName != null and communityName != '' and needCommunityInfo == true">
             and sc.name like concat('%',#{communityName},'%')
+        </if>
+        <if test="needCommunityInfo == true">
+            group by ms.community_id
         </if>
         order by ms.create_time desc
         <if test="page != -1 and page != null">
@@ -366,7 +389,7 @@
 
     <!-- 鏌ヨ灏忓尯鎴愬憳  add by wuxw 2018-07-03 -->
     <select id="getCommunityMemberCount" parameterType="Map" resultType="Map">
-        select count(1) count
+        select ms.community_id,count(1) count
         from s_community_member ms
         <if test="needCommunityInfo == true">
             ,s_community sc,
@@ -398,7 +421,7 @@
         </if>
 
         <if test="subMemberId != null and subMemberId != ''">
-            and ms.member_id = #{memberId}
+            and ms.member_id = #{subMemberId}
         </if>
 
         <if test="noAuditEnterCommunity == true">
@@ -424,6 +447,10 @@
         <if test="communityName != null and communityName != '' and needCommunityInfo == true">
             and sc.name like concat('%',#{communityName},'%')
         </if>
+        <if test="needCommunityInfo == true">
+            group by ms.community_id
+        </if>
+
     </select>
 
     <!-- 鏌ヨ灏忓尯淇℃伅 add by wuxw 2018-07-03 -->
@@ -438,12 +465,16 @@
         THEN '瀹℃牳瀹屾垚'
         ELSE
         '瀹℃牳鎷掔粷'
-        END) stateName
-        from s_community t
+        END) stateName,ca.area_code areaCode,ca.area_name areaName,
+        ca.parent_area_code parentAreaCode,ca.parent_area_name parentAreaName,
+        t.community_area communityArea
+        from s_community t,city_area ca
         <if test="memberId !=null and memberId !=''">
             ,s_community_member cm
         </if>
         where 1 =1
+        and t.city_code = ca.area_code
+        and ca.status_cd = '0'
         <if test="address !=null and address != ''">
             and t.address= #{address}
         </if>
@@ -505,12 +536,14 @@
 
     <!-- 鏌ヨ灏忓尯鏁伴噺 add by wuxw 2018-07-03 -->
     <select id="queryCommunitysCount" parameterType="Map" resultType="Map">
-        select  count(1) count
-        from s_community t
+        select  count(DISTINCT(t.community_id)) count
+        from s_community t,city_area ca
         <if test="memberId !=null and memberId !=''">
             ,s_community_member cm
         </if>
         where 1 =1
+        and t.city_code = ca.area_code
+        and ca.status_cd = '0'
         <if test="address !=null and address != ''">
             and t.address= #{address}
         </if>

--
Gitblit v1.8.0