mrzcc
2020-02-19 9efb739152062fed7a1b073cbb0034d519283f2d
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml
@@ -277,11 +277,31 @@
    <!-- 查询小区成员  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,ms.audit_status_cd,
        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
        WHEN ms.audit_status_cd='1000'
        THEN '待审核'
        WHEN ms.audit_status_cd = '1100'
        THEN '审核完成'
        ELSE
        '审核拒绝'
        END) stateName
        <if test="needCommunityInfo == true">
            ,sc.name
        </if>
        from s_community_member ms
        <if test="needCommunityInfo == true">
            ,s_community sc,
            s_community_member msc
        </if>
        where 1=1
        <if test="needCommunityInfo == true">
            and sc.`community_id` = ms.`community_id`
            AND sc.`status_cd` = '0'
            and sc.state='1100'
        </if>
        <if test="statusCd != null and statusCd != ''">
            and ms.status_cd = #{statusCd}
        </if>
@@ -292,8 +312,19 @@
        <if test="communityMemberId != null and communityMemberId !=''">
            and ms.community_member_id = #{communityMemberId}
        </if>
        <if test="memberId != null and memberId != ''">
        <if test="memberId != null and memberId != '' and needCommunityInfo == true">
            AND ms.`community_id` = msc.`community_id`
            and msc.member_id = #{memberId}
            and msc.status_cd = '0'
        </if>
        <if test="memberId != null and memberId != '' and needCommunityInfo == false">
            and ms.member_id = #{memberId}
        </if>
        <if test="subMemberId != null and subMemberId != ''">
            and ms.member_id = #{memberId}
        </if>
        <if test="noAuditEnterCommunity == true">
            and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
        </if>
        <if test="memberTypeCd != null and memberTypeCd != ''">
            and ms.member_type_cd = #{memberTypeCd}
@@ -305,6 +336,10 @@
        <if test="communityId != null and communityId != ''">
            and ms.community_id = #{communityId}
        </if>
        <if test="communityName != null and communityName != '' and needCommunityInfo == true">
            and sc.name like concat('%',#{communityName},'%')
        </if>
        order by ms.create_time desc
        <if test="page != -1 and page != null">
            limit #{page},#{row}
        </if>
@@ -333,7 +368,16 @@
    <select id="getCommunityMemberCount" parameterType="Map" resultType="Map">
        select count(1) count
        from s_community_member ms
        <if test="needCommunityInfo == true">
            ,s_community sc,
            s_community_member msc
        </if>
        where 1=1
        <if test="needCommunityInfo == true">
            and sc.`community_id` = ms.`community_id`
            AND sc.`status_cd` = '0'
            and sc.state='1100'
        </if>
        <if test="statusCd != null and statusCd != ''">
            and ms.status_cd = #{statusCd}
        </if>
@@ -344,9 +388,23 @@
        <if test="communityMemberId != null and communityMemberId !=''">
            and ms.community_member_id = #{communityMemberId}
        </if>
        <if test="memberId != null and memberId != ''">
        <if test="memberId != null and memberId != '' and needCommunityInfo == true">
            AND ms.`community_id` = msc.`community_id`
            and msc.member_id = #{memberId}
            and msc.status_cd = '0'
        </if>
        <if test="memberId != null and memberId != '' and needCommunityInfo == false">
            and ms.member_id = #{memberId}
        </if>
        <if test="subMemberId != null and subMemberId != ''">
            and ms.member_id = #{memberId}
        </if>
        <if test="noAuditEnterCommunity == true">
            and ms.member_type_cd not in ('390001200003','390001200005','390001200000')
        </if>
        <if test="memberTypeCd != null and memberTypeCd != ''">
            and ms.member_type_cd = #{memberTypeCd}
        </if>
@@ -354,8 +412,17 @@
            and ms.audit_status_cd = #{auditStatusCd}
        </if>
        <if test="auditStatusCds != null and auditStatusCds != null">
            and ms.audit_status_cd in
            <foreach collection="auditStatusCds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="communityId != null and communityId != ''">
            and ms.community_id = #{communityId}
        </if>
        <if test="communityName != null and communityName != '' and needCommunityInfo == true">
            and sc.name like concat('%',#{communityName},'%')
        </if>
    </select>
@@ -387,13 +454,19 @@
            and t.city_code= #{cityCode}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="communityIds !=null">
            and t.community_id in
            <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
@@ -411,6 +484,15 @@
            and cm.community_id = t.community_id
            and cm.member_id = #{memberId}
            and cm.status_cd = '0'
        </if>
        <if test="memberId !=null and memberId !='' and auditStatusCd != null and auditStatusCd !=''">
            and cm.audit_status_cd = #{auditStatusCd}
        </if>
        <if test="notInCommunityId != null ">
            and t.community_id not in
            <foreach collection="notInCommunityId" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
@@ -438,13 +520,19 @@
            and t.city_code= #{cityCode}
        </if>
        <if test="name !=null and name != ''">
            and t.name= #{name}
            and t.name like concat('%',#{name},'%')
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="communityIds !=null">
            and t.community_id in
            <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
@@ -460,8 +548,17 @@
        </if>
        <if test="memberId !=null and memberId !=''">
            and cm.community_id = t.community_id
                and cm.member_id = #{memberId}
                and cm.status_cd = '0'
            and cm.member_id = #{memberId}
            and cm.status_cd = '0'
        </if>
        <if test="memberId !=null and memberId !='' and auditStatusCd != null and auditStatusCd !=''">
            and cm.audit_status_cd = #{auditStatusCd}
        </if>
        <if test="notInCommunityId != null ">
            and t.community_id not in
            <foreach collection="notInCommunityId" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>