|
|
@@ -0,0 +1,300 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
+<!DOCTYPE mapper
|
|
|
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="communityServiceDaoImpl">
|
|
|
+
|
|
|
+ <!-- 保存小区信息 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,operate)
|
|
|
+ values(#{communityId},#{bId},#{name},#{address},#{cityCode},#{nearbyLandmarks},#{mapX},#{mapY},#{month},#{operate})
|
|
|
+ </insert>
|
|
|
+ <!-- 保存小区属性信息 add by wuxw 2018-07-03 -->
|
|
|
+ <insert id="saveBusinessCommunityAttr" parameterType="Map">
|
|
|
+ insert into business_community_attr(b_id,attr_id,community_id,spec_cd,value,month,operate)
|
|
|
+ values(#{bId},#{attrId},#{communityId},#{specCd},#{value},#{month},#{operate})
|
|
|
+ </insert>
|
|
|
+ <!-- 保存小区照片信息 add by wuxw 2018-07-03 -->
|
|
|
+ <insert id="saveBusinessCommunityPhoto" parameterType="Map">
|
|
|
+ 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})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询小区信息(Business) 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
|
|
|
+ from business_community s where 1 = 1
|
|
|
+ <if test="operate != null and operate != ''">
|
|
|
+ and s.operate = #{operate}
|
|
|
+ </if>
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and s.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId != ''">
|
|
|
+ and s.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询小区属性信息(Business) add by wuxw 2018-07-03 -->
|
|
|
+ <select id="getBusinessCommunityAttrs" parameterType="Map" resultType="Map">
|
|
|
+ select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,sa.operate
|
|
|
+ from business_community_attr sa where 1=1
|
|
|
+ <if test="operate != null and operate != ''">
|
|
|
+ and sa.operate = #{operate}
|
|
|
+ </if>
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and sa.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId != ''">
|
|
|
+ and sa.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ <if test="attrId != null and attrId != ''">
|
|
|
+ and sa.attr_id = #{attrId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询小区照片信息 add by wuxw 2018-07-03 -->
|
|
|
+ <select id="getBusinessCommunityPhoto" parameterType="Map" resultType="Map">
|
|
|
+ select sp.community_photo_id,sp.b_id,sp.community_id,sp.community_photo_type_cd,sp.photo,sp.operate
|
|
|
+ from business_community_photo sp where 1=1
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and sp.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="operate != null and operate != ''">
|
|
|
+ and sp.operate = #{operate}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId != ''">
|
|
|
+ and sp.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 保存小区信息至 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)
|
|
|
+ select s.community_id,s.b_id,s.name,s.address,s.city_code,s.nearby_landmarks,s.map_x,s.map_y,'0'
|
|
|
+ from business_community s where
|
|
|
+ s.operate = 'ADD' and s.b_id=#{bId}
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 保存小区属性信息到 instance add by wuxw 2018-07-03 -->
|
|
|
+ <insert id="saveCommunityAttrsInstance" parameterType="Map">
|
|
|
+ insert into s_community_attr(b_id,attr_id,community_id,spec_cd,value,status_cd)
|
|
|
+ select sa.b_id,sa.attr_id,sa.community_id,sa.spec_cd,sa.value,'0'
|
|
|
+ from business_community_attr sa
|
|
|
+ where sa.operate = 'ADD' and sa.b_id=#{bId}
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 保存 小区照片信息 instance add by wuxw 2018-07-03 -->
|
|
|
+ <insert id="saveCommunityPhotoInstance" parameterType="Map">
|
|
|
+ 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'
|
|
|
+ from business_community_photo sp
|
|
|
+ where sp.operate = 'ADD' and sp.b_id=#{bId}
|
|
|
+ </insert>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询小区信息 add by wuxw 2018-07-03 -->
|
|
|
+ <select id="getCommunityInfo" 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.status_cd
|
|
|
+ from s_community s
|
|
|
+ where 1=1
|
|
|
+ <if test="statusCd != null and statusCd != ''">
|
|
|
+ and s.status_cd = #{statusCd}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and s.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId !=''">
|
|
|
+ and s.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询小区属性信息 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
|
|
|
+ from s_community_attr sa
|
|
|
+ where
|
|
|
+ 1=1
|
|
|
+ <if test="statusCd != null and statusCd != ''">
|
|
|
+ and sa.status_cd = #{statusCd}
|
|
|
+ </if>
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and sa.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId !=''">
|
|
|
+ and sa.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ <if test="attrId != null and attrId != ''">
|
|
|
+ and sa.attr_id = #{attrId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 查询小区照片信息 add by wuxw 2018-07-03 -->
|
|
|
+ <select id="getCommunityPhoto" parameterType="Map" resultType="Map">
|
|
|
+ select sp.community_photo_id,sp.b_id,sp.community_id,sp.community_photo_type_cd,sp.photo,sp.status_cd
|
|
|
+ from s_community_photo sp
|
|
|
+ where 1=1
|
|
|
+ <if test="statusCd != null and statusCd != ''">
|
|
|
+ and sp.status_cd = #{statusCd}
|
|
|
+ </if>
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and sp.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId !=''">
|
|
|
+ and sp.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 修改小区信息 add by wuxw 2018-07-03 -->
|
|
|
+ <update id="updateCommunityInfoInstance" parameterType="Map">
|
|
|
+ update s_community s set s.status_cd = #{statusCd}
|
|
|
+ <if test="newBId != null and newBId != ''">
|
|
|
+ ,s.b_id = #{newBId}
|
|
|
+ </if>
|
|
|
+
|
|
|
+ <if test="name != null and name != ''">
|
|
|
+ ,s.name = #{name}
|
|
|
+ </if>
|
|
|
+ <if test="address != null and address != ''">
|
|
|
+ ,s.address = #{address}
|
|
|
+ </if>
|
|
|
+ <if test="cityCode != null and cityCode != ''">
|
|
|
+ ,s.city_code = #{cityCode}
|
|
|
+ </if>
|
|
|
+ <if test="nearbyLandmarks != null and nearbyLandmarks != ''">
|
|
|
+ ,s.nearby_landmarks = #{nearbyLandmarks}
|
|
|
+ </if>
|
|
|
+ <if test="mapX != null and mapX != ''">
|
|
|
+ ,s.map_x = #{mapX}
|
|
|
+ </if>
|
|
|
+ <if test="mapY != null and mapY != ''">
|
|
|
+ ,s.map_y = #{mapY}
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and s.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId !=''">
|
|
|
+ and s.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 修改小区属性信息 add by wuxw 2018-07-03 -->
|
|
|
+ <update id="updateCommunityAttrInstance" parameterType="Map">
|
|
|
+ update s_community_attr sa set sa.status_cd = #{statusCd}
|
|
|
+ <if test="newBId != null and newBId != ''">
|
|
|
+ ,sa.b_id = #{newBId}
|
|
|
+ </if>
|
|
|
+ <if test="value != null and value != ''">
|
|
|
+ ,sa.value = #{value}
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and sa.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId !=''">
|
|
|
+ and sa.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ <if test="specCd != null and specCd !=''">
|
|
|
+ and sa.spec_cd = #{specCd}
|
|
|
+ </if>
|
|
|
+ <if test="attrId != null and attrId !=''">
|
|
|
+ and sa.attr_id = #{attrId}
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <!-- 修改小区照片信息 add by wuxw 2018-07-03 -->
|
|
|
+ <update id="updateCommunityPhotoInstance" parameterType="Map">
|
|
|
+ update s_community_photo sp set sp.status_cd = #{statusCd}
|
|
|
+ <if test="newBId != null and newBId != ''">
|
|
|
+ ,sp.b_id = #{newBId}
|
|
|
+ </if>
|
|
|
+ <if test="communityPhotoTypeCd != null and communityPhotoTypeCd != ''">
|
|
|
+ ,sp.community_photo_type_cd = #{communityPhotoTypeCd}
|
|
|
+ </if>
|
|
|
+ <if test="photo != null and photo != ''">
|
|
|
+ ,sp.photo = #{photo}
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and sp.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId !=''">
|
|
|
+ and sp.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ <if test="communityPhotoId != null and communityPhotoId !=''">
|
|
|
+ and sp.community_photo_id = #{communityPhotoId}
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!--小区成员加入 add by wuxw 2018-10-27 saveBusinessCommunityMember-->
|
|
|
+ <insert id="saveBusinessCommunityMember" parameterType="Map">
|
|
|
+ insert into business_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,month,operate)
|
|
|
+ values(#{communityMemberId},#{bId},#{communityId},#{memberId},#{memberTypeCd},#{month},#{operate})
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 小区成员加入 instance表中 add by wuxw 2018-10-27 -->
|
|
|
+ <insert id="saveCommunityMemberInstance" parameterType="Map">
|
|
|
+ insert into s_community_member(community_member_id,b_id,community_id,member_id,member_type_cd,status_cd)
|
|
|
+ select ms.community_member_id,ms.b_id,ms.community_id,ms.member_id,ms.memberTypeCd,'0'
|
|
|
+ from business_community_member ms where
|
|
|
+ ms.operate = 'ADD' and ms.b_id=#{bId}
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <!-- 查询小区成员 add by wuxw 2018-10-27 getBusinessCommunityMember-->
|
|
|
+ <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
|
|
|
+ from business_community_member ms where 1 = 1
|
|
|
+ <if test="operate != null and operate != ''">,
|
|
|
+ and ms.operate = #{operate}
|
|
|
+ </if>
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and ms.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId != ''">
|
|
|
+ and ms.community_id = #{communityId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 查询小区成员 add by wuxw 2018-07-03 -->
|
|
|
+ <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
|
|
|
+ from business_community_member ms
|
|
|
+ where 1=1
|
|
|
+ <if test="statusCd != null and statusCd != ''">
|
|
|
+ and ms.status_cd = #{statusCd}
|
|
|
+ </if>,
|
|
|
+
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and ms.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityId != null and communityId !=''">
|
|
|
+ and ms.community_member_id = #{communityMemberId}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <!-- 修改小区成员 add by wuxw 2018-07-03 -->
|
|
|
+ <update id="updateCommunityMemberInstance" parameterType="Map">
|
|
|
+ update s_community_member ms set ms.status_cd = #{statusCd}
|
|
|
+ <if test="newBId != null and newBId != ''">
|
|
|
+ ,ms.b_id = #{newBId}
|
|
|
+ </if>
|
|
|
+ where 1=1
|
|
|
+ <if test="bId != null and bId !=''">
|
|
|
+ and ms.b_id = #{bId}
|
|
|
+ </if>
|
|
|
+ <if test="communityMemberId != null and communityMemberId !=''">
|
|
|
+ and ms.community_member_id = #{communityMemberId}
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+
|
|
|
+</mapper>
|