yanghui
2022-10-27 aefbba46e174d3a7b24ec3895b66431705a53c40
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml
@@ -113,6 +113,12 @@
                    #{item}
                </foreach>
            </if>
            <if test="unitIds != null and unitIds.length != 0 ">
                AND id IN
                <foreach collection="unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
@@ -125,6 +131,12 @@
            <if test="communityIds != null and communityIds.size() >0">
                AND community_id IN
                <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="unitIds != null and unitIds.length != 0 ">
                AND id IN
                <foreach collection="unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
@@ -142,6 +154,12 @@
                    #{item}
                </foreach>
            </if>
            <if test="unitIds != null and unitIds.length != 0 ">
                AND id IN
                <foreach collection="unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
            </if>
@@ -153,6 +171,12 @@
            <if test="communityIds != null and communityIds.size() >0">
                AND m.community_id IN
                <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="unitIds != null and unitIds.length != 0 ">
                AND cpcu.id IN
                <foreach collection="unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
@@ -174,11 +198,23 @@
                    #{item}
                </foreach>
            </if>
            <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
                AND id IN
                <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
         AND belong_to = temp.belong_to) AS organTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位'
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
                AND id IN
                <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
@@ -190,11 +226,23 @@
                    #{item}
                </foreach>
            </if>
            <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
                AND m.id IN
                <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
         AND cpcu.belong_to = temp.belong_to) AS partyMemberTotal
        FROM (SELECT belong_to,COUNT( id ) AS unitTotal FROM com_pb_check_unit WHERE 1=1
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
                AND id IN
                <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
@@ -213,7 +261,12 @@
                #{item}
            </foreach>
        </if>
        <if test="unitIds != null and unitIds.length !=0">
            AND cpcu.id IN
            <foreach collection="unitIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
        </if>
@@ -232,6 +285,12 @@
                #{item}
            </foreach>
        </if>
        <if test="unitIds != null and unitIds.length !=0">
            AND cpcu.id IN
            <foreach collection="unitIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
        </if>
@@ -246,6 +305,12 @@
        <if test="communityIds != null and communityIds.size() >0">
            AND m.community_id IN
            <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="unitIds != null and unitIds.length !=0">
            AND cpcu.id IN
            <foreach collection="unitIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
@@ -269,6 +334,12 @@
                    #{item}
                </foreach>
            </if>
            <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
                AND cpcu.id IN
                <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
         AND m.check_unit_id is not null AND cpcu.nature_name = '机关单位' AND cpcu.belong_to = temp.belong_to) AS organTotal,
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
@@ -277,11 +348,23 @@
                        #{item}
                    </foreach>
                </if>
            <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
                AND cpcu.id IN
                <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
        AND cpcu.nature_name = '企事业单位' AND cpcu.belong_to = temp.belong_to) AS businessTotal
        FROM (SELECT cpcu.belong_to,COUNT( m.id ) AS partyMemberTotal FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND m.community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
                AND cpcu.id IN
                <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
@@ -310,6 +393,12 @@
                #{item}
            </foreach>
        </if>
        <if test="commonDto.unitIds != null and commonDto.unitIds.length !=0">
            AND cpcu.id IN
            <foreach collection="commonDto.unitIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="commonDto.belongTo != null and commonDto.belongTo != ''">
            AND cpcu.belong_to = #{commonDto.belongTo}
        </if>