| | |
| | | |
| | | <!-- 保存小区信息 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"> |
| | |
| | | |
| | | <!-- 查询小区信息(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,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} |
| | |
| | | |
| | | <!-- 保存小区信息至 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 --> |
| | |
| | | |
| | | <!-- 查询小区属性信息 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 != ''"> |
| | |
| | | <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> |
| | |
| | | <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} |
| | |
| | | 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') |
| | |
| | | </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"> |
| | |
| | | |
| | | <!-- 查询小区成员 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, |
| | |
| | | </if> |
| | | |
| | | <if test="subMemberId != null and subMemberId != ''"> |
| | | and ms.member_id = #{memberId} |
| | | and ms.member_id = #{subMemberId} |
| | | </if> |
| | | |
| | | <if test="noAuditEnterCommunity == true"> |
| | |
| | | <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 --> |
| | |
| | | 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> |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | group by t.community_id |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | |
| | | |
| | | <!-- 查询小区数量 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> |