|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="communityServiceDaoImpl">
|
|
<mapper namespace="communityServiceDaoImpl">
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<!-- 保存小区信息 add by wuxw 2018-07-03 -->
|
|
<!-- 保存小区信息 add by wuxw 2018-07-03 -->
|
|
|
<insert id="saveBusinessCommunityInfo" parameterType="Map">
|
|
<insert id="saveBusinessCommunityInfo" parameterType="Map">
|
|
|
insert into business_community(community_id,b_id,name,address,city_code,
|
|
insert into business_community(community_id,b_id,name,address,city_code,
|
|
@@ -18,7 +18,8 @@
|
|
|
</insert>
|
|
</insert>
|
|
|
<!-- 保存小区照片信息 add by wuxw 2018-07-03 -->
|
|
<!-- 保存小区照片信息 add by wuxw 2018-07-03 -->
|
|
|
<insert id="saveBusinessCommunityPhoto" parameterType="Map">
|
|
<insert id="saveBusinessCommunityPhoto" parameterType="Map">
|
|
|
- insert into business_community_photo(community_photo_id,b_id,community_id,community_photo_type_cd,photo,month,operate)
|
|
|
|
|
|
|
+ insert into
|
|
|
|
|
+ business_community_photo(community_photo_id,b_id,community_id,community_photo_type_cd,photo,month,operate)
|
|
|
values(#{communityPhotoId},#{bId},#{communityId},#{communityPhotoTypeCd},#{photo},#{month},#{operate})
|
|
values(#{communityPhotoId},#{bId},#{communityId},#{communityPhotoTypeCd},#{photo},#{month},#{operate})
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
@@ -76,7 +77,8 @@
|
|
|
|
|
|
|
|
<!-- 保存小区信息至 instance表中 add by wuxw 2018-07-03 -->
|
|
<!-- 保存小区信息至 instance表中 add by wuxw 2018-07-03 -->
|
|
|
<insert id="saveCommunityInfoInstance" parameterType="Map">
|
|
<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,community_area)
|
|
|
|
|
|
|
+ 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})
|
|
values(#{community_id},#{b_id},#{name},#{address},#{city_code},#{nearby_landmarks},#{map_x},#{map_y},'0',#{state},#{communityArea})
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
@@ -90,13 +92,13 @@
|
|
|
and sa.community_id = #{communityId}
|
|
and sa.community_id = #{communityId}
|
|
|
</if>
|
|
</if>
|
|
|
</insert>
|
|
</insert>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
<!-- 保存 小区照片信息 instance add by wuxw 2018-07-03 -->
|
|
<!-- 保存 小区照片信息 instance add by wuxw 2018-07-03 -->
|
|
|
<insert id="saveCommunityPhotoInstance" parameterType="Map">
|
|
<insert id="saveCommunityPhotoInstance" parameterType="Map">
|
|
|
insert into s_community_photo(community_photo_id,b_id,community_id,community_photo_type_cd,photo,status_cd)
|
|
insert into s_community_photo(community_photo_id,b_id,community_id,community_photo_type_cd,photo,status_cd)
|
|
|
select sp.community_photo_id,sp.b_id,sp.community_id,sp.community_photo_type_cd,sp.photo,'0'
|
|
select sp.community_photo_id,sp.b_id,sp.community_id,sp.community_photo_type_cd,sp.photo,'0'
|
|
|
from business_community_photo sp
|
|
from business_community_photo sp
|
|
|
- where sp.operate = 'ADD' and sp.b_id=#{bId}
|
|
|
|
|
|
|
+ where sp.operate = 'ADD' and sp.b_id=#{bId}
|
|
|
<if test="communityId != null and communityId != ''">
|
|
<if test="communityId != null and communityId != ''">
|
|
|
and sp.community_id = #{communityId}
|
|
and sp.community_id = #{communityId}
|
|
|
</if>
|
|
</if>
|
|
@@ -128,7 +130,8 @@
|
|
|
v.value_name valueName,
|
|
v.value_name valueName,
|
|
|
s.list_show listShow
|
|
s.list_show listShow
|
|
|
from s_community_attr sa
|
|
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_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'
|
|
left join attr_value v on sa.`value` = v.`value` and sa.spec_cd = v.spec_cd and v.status_cd = '0'
|
|
|
where
|
|
where
|
|
|
1=1
|
|
1=1
|
|
@@ -170,7 +173,6 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<!-- 修改小区信息 add by wuxw 2018-07-03 -->
|
|
<!-- 修改小区信息 add by wuxw 2018-07-03 -->
|
|
|
<update id="updateCommunityInfoInstance" parameterType="Map">
|
|
<update id="updateCommunityInfoInstance" parameterType="Map">
|
|
|
update s_community s set s.status_cd = #{statusCd}
|
|
update s_community s set s.status_cd = #{statusCd}
|
|
@@ -260,17 +262,18 @@
|
|
|
</if>
|
|
</if>
|
|
|
</update>
|
|
</update>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
<!--小区成员加入 add by wuxw 2018-10-27 saveBusinessCommunityMember-->
|
|
<!--小区成员加入 add by wuxw 2018-10-27 saveBusinessCommunityMember-->
|
|
|
<insert id="saveBusinessCommunityMember" parameterType="Map">
|
|
<insert id="saveBusinessCommunityMember" parameterType="Map">
|
|
|
- insert into business_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,month,operate,audit_status_cd)
|
|
|
|
|
|
|
+ insert into
|
|
|
|
|
+ business_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,month,operate,audit_status_cd)
|
|
|
values(#{communityMemberId},#{bId},#{communityId},#{memberId},#{memberTypeCd},#{month},#{operate},#{auditStatusCd})
|
|
values(#{communityMemberId},#{bId},#{communityId},#{memberId},#{memberTypeCd},#{month},#{operate},#{auditStatusCd})
|
|
|
</insert>
|
|
</insert>
|
|
|
|
|
|
|
|
<!-- 小区成员加入 instance表中 add by wuxw 2018-10-27 -->
|
|
<!-- 小区成员加入 instance表中 add by wuxw 2018-10-27 -->
|
|
|
<insert id="saveCommunityMemberInstance" parameterType="Map">
|
|
<insert id="saveCommunityMemberInstance" parameterType="Map">
|
|
|
- insert into s_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,status_cd,audit_status_cd)
|
|
|
|
|
|
|
+ insert into
|
|
|
|
|
+ s_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,status_cd,audit_status_cd)
|
|
|
select ms.community_member_id,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,'0',ms.audit_status_cd
|
|
select ms.community_member_id,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,'0',ms.audit_status_cd
|
|
|
from business_community_member ms where
|
|
from business_community_member ms where
|
|
|
ms.operate = 'ADD' and ms.b_id=#{bId}
|
|
ms.operate = 'ADD' and ms.b_id=#{bId}
|
|
@@ -281,7 +284,8 @@
|
|
|
|
|
|
|
|
<!-- 查询小区成员 add by wuxw 2018-10-27 getBusinessCommunityMember-->
|
|
<!-- 查询小区成员 add by wuxw 2018-10-27 getBusinessCommunityMember-->
|
|
|
<select id="getBusinessCommunityMember" parameterType="Map" resultType="Map">
|
|
<select id="getBusinessCommunityMember" parameterType="Map" resultType="Map">
|
|
|
- select ms.community_member_id,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.operate,ms.audit_status_cd
|
|
|
|
|
|
|
+ select
|
|
|
|
|
+ ms.community_member_id,ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.operate,ms.audit_status_cd
|
|
|
from business_community_member ms where 1 = 1
|
|
from business_community_member ms where 1 = 1
|
|
|
<if test="operate != null and operate != ''">
|
|
<if test="operate != null and operate != ''">
|
|
|
and ms.operate = #{operate}
|
|
and ms.operate = #{operate}
|
|
@@ -297,8 +301,10 @@
|
|
|
|
|
|
|
|
<!-- 查询小区成员 add by wuxw 2018-07-03 -->
|
|
<!-- 查询小区成员 add by wuxw 2018-07-03 -->
|
|
|
<select id="getCommunityMember" parameterType="Map" resultType="Map">
|
|
<select id="getCommunityMember" parameterType="Map" resultType="Map">
|
|
|
- select ms.community_member_id , ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.status_cd,ms.audit_status_cd,
|
|
|
|
|
- ms.community_member_id communityMemberId ,ms.b_id bId,ms.community_id communityId,ms.member_id memberId,ms.member_type_cd memberTypeCd,ms.status_cd statusCd,
|
|
|
|
|
|
|
+ select ms.community_member_id ,
|
|
|
|
|
+ ms.b_id,ms.community_id,ms.member_id,ms.member_type_cd,ms.status_cd,ms.audit_status_cd,
|
|
|
|
|
+ ms.community_member_id communityMemberId ,ms.b_id bId,ms.community_id communityId,ms.member_id
|
|
|
|
|
+ memberId,ms.member_type_cd memberTypeCd,ms.status_cd statusCd,
|
|
|
ms.audit_status_cd auditStatusCd,
|
|
ms.audit_status_cd auditStatusCd,
|
|
|
(CASE
|
|
(CASE
|
|
|
WHEN ms.audit_status_cd='1000'
|
|
WHEN ms.audit_status_cd='1000'
|
|
@@ -455,7 +461,7 @@
|
|
|
|
|
|
|
|
<!-- 查询小区信息 add by wuxw 2018-07-03 -->
|
|
<!-- 查询小区信息 add by wuxw 2018-07-03 -->
|
|
|
<select id="getCommunityInfoNew" parameterType="Map" resultType="Map">
|
|
<select id="getCommunityInfoNew" parameterType="Map" resultType="Map">
|
|
|
- select t.address,t.nearby_landmarks,t.nearby_landmarks nearbyLandmarks,
|
|
|
|
|
|
|
+ select t.address,t.nearby_landmarks,t.nearby_landmarks nearbyLandmarks,
|
|
|
t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd,
|
|
t.city_code,t.city_code cityCode,t.name,t.status_cd,t.status_cd statusCd,
|
|
|
t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.map_y,t.map_y mapY,
|
|
t.community_id,t.community_id communityId,t.b_id,t.b_id bId,t.map_y,t.map_y mapY,
|
|
|
t.map_x,t.map_x mapX,t.state,(CASE
|
|
t.map_x,t.map_x mapX,t.state,(CASE
|
|
@@ -533,10 +539,9 @@
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<!-- 查询小区数量 add by wuxw 2018-07-03 -->
|
|
<!-- 查询小区数量 add by wuxw 2018-07-03 -->
|
|
|
<select id="queryCommunitysCount" parameterType="Map" resultType="Map">
|
|
<select id="queryCommunitysCount" parameterType="Map" resultType="Map">
|
|
|
- select count(DISTINCT(t.community_id)) count
|
|
|
|
|
|
|
+ select count(DISTINCT(t.community_id)) count
|
|
|
from s_community t,city_area ca
|
|
from s_community t,city_area ca
|
|
|
<if test="memberId !=null and memberId !=''">
|
|
<if test="memberId !=null and memberId !=''">
|
|
|
,s_community_member cm
|
|
,s_community_member cm
|
|
@@ -597,4 +602,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
+ <!-- 查询商户小区 -->
|
|
|
|
|
+ <select id="getStoreCommunitys" parameterType="Map" resultType="Map">
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ sc.`community_id` communityId,
|
|
|
|
|
+ sc.`name`,
|
|
|
|
|
+ sc.`address`,
|
|
|
|
|
+ sc.`nearby_landmarks` nearbyLandmarks,
|
|
|
|
|
+ sc.`city_code` cityCode,
|
|
|
|
|
+ sc.`map_x` mapX,
|
|
|
|
|
+ sc.`map_y` mapY,
|
|
|
|
|
+ scm.`community_member_id` communityMemberId,
|
|
|
|
|
+ scm.`member_id` memberId,
|
|
|
|
|
+ scm.`member_type_cd` memberTypeCd,
|
|
|
|
|
+ scm.audit_status_cd auditStatusCd,
|
|
|
|
|
+ scm.`status_cd` statusCd,
|
|
|
|
|
+ ca.area_name areaName,
|
|
|
|
|
+ ca.parent_area_name cityName,
|
|
|
|
|
+ ca1.parent_area_name provName,
|
|
|
|
|
+ sc.community_area communityArea
|
|
|
|
|
+ FROM
|
|
|
|
|
+ s_community sc,
|
|
|
|
|
+ s_community_member scm,
|
|
|
|
|
+ city_area ca,
|
|
|
|
|
+ city_area ca1
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ sc.`community_id` = scm.`community_id`
|
|
|
|
|
+ AND sc.`status_cd` = '0'
|
|
|
|
|
+ and sc.city_code = ca.area_code
|
|
|
|
|
+ and ca.parent_area_code = ca1.area_code
|
|
|
|
|
+ AND scm.`member_id` = #memberId#
|
|
|
|
|
+ AND scm.`member_type_cd` = #memberTypeCd#
|
|
|
|
|
+ AND scm.`status_cd` = '0'
|
|
|
|
|
+ <if test="auditStatusCd ==null or auditStatusCd ==''">
|
|
|
|
|
+ and scm.audit_status_cd in ('1000', '1100','1200')
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="auditStatusCd !=null and auditStatusCd !=''">
|
|
|
|
|
+ and scm.audit_status_cd = #auditStatusCd#
|
|
|
|
|
+ </if>
|
|
|
|
|
+ group by sc.community_id
|
|
|
|
|
+ </select>
|
|
|
</mapper>
|
|
</mapper>
|