puhanshu
2022-07-25 a93aae216896cec7790abe3573f7d8c4e1f9d8cd
报到单位/党员统计
2个文件已添加
10个文件已修改
494 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PagePbCheckUnitCommonDto.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/common/PbCheckUnitStatisticsVo.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PagePartyOrganizationVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingMemberVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/ComPbCheckUnitFeign.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComPbCheckUnitApi.java 60 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/ComPbCheckUnitController.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbCheckUnitMapper.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/ComPbCheckUnitService.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PagePbCheckUnitCommonDto.java
New file
@@ -0,0 +1,33 @@
package com.panzhihua.common.model.dtos.common;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @title: PagePbCheckUnitCommonDto
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 报到单位/报到党员统计公共请求参数
 * @author: hans
 * @date: 2022/07/25 15:41
 */
@Data
@ApiModel("报到单位/报到党员统计公共请求参数")
public class PagePbCheckUnitCommonDto {
    @ApiModelProperty(value = "社区id")
    private Long communityId;
    @ApiModelProperty(value = "分页每页数量", example = "10")
    private Long pageSize = 10L;
    @ApiModelProperty(value = "分页当前记录数", example = "1")
    private Long pageNum = 1L;
    @ApiModelProperty("单位归属")
    private String belongTo;
    @ApiModelProperty("单位性质")
    private String natureName;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/common/PbCheckUnitStatisticsVo.java
New file
@@ -0,0 +1,33 @@
package com.panzhihua.common.model.vos.common;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @title: PbCheckUnitStatisticsTopVo
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 报到单位统计返回参数
 * @author: hans
 * @date: 2022/07/25 10:51
 */
@Data
@ApiModel("报到单位统计返回参数")
public class PbCheckUnitStatisticsVo {
    @ApiModelProperty(value = "单位归属")
    private String belongTo;
    @ApiModelProperty(value = "报到单位总数")
    private Integer unitTotal;
    @ApiModelProperty(value = "已报到机关单位")
    private Integer organTotal;
    @ApiModelProperty(value = "已报到企事业单位")
    private Integer businessTotal;
    @ApiModelProperty(value = "已报到党员")
    private Integer partyMemberTotal;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PagePartyOrganizationVO.java
@@ -67,4 +67,13 @@
    private String belongTo;
    private String areaCode;
    @ApiModelProperty("单位性质")
    private String natureName;
    @ApiModelProperty("工作单位")
    private String workUnitName;
    @ApiModelProperty("是否注册小程序(1.是 0.否)")
    private Integer isRegister;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PartyBuildingMemberVO.java
@@ -132,4 +132,6 @@
    private String unitHelpCommunityContactsName;
    @ApiModelProperty("区级")
    private String belongTo;
    @ApiModelProperty("微信昵称")
    private String nickName;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/ComPbCheckUnitFeign.java
@@ -98,4 +98,46 @@
    @PostMapping("/importCheckUnit")
    R importCheckUnit(@RequestBody List<ComPbCheckUnitExcelVO> list,@RequestParam(value = "communityId") Long communityId
            ,@RequestParam(value = "userId") Long userId);
    /**
     * 报到单位统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    @GetMapping("/statistics/top")
    R unitStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId, @RequestParam(value = "belongTo") String belongTo);
    /**
     * 报到单位统计
     * @param commonDto
     * @return
     */
    @PostMapping("/statistics")
    R unitStatistics(@RequestBody PagePbCheckUnitCommonDto commonDto);
    /**
     * 报到党员统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    @GetMapping("/pbStatistics/top")
    R pbStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId, @RequestParam(value = "belongTo") String belongTo);
    /**
     * 报到党员统计-按单位归属统计
     * @param commonDto
     * @return
     */
    @PostMapping("/pbStatistics/belong")
    R pbStatisticsBelong(@RequestBody PagePbCheckUnitCommonDto commonDto);
    /**
     * 报到党员统计-按单位统计
     * @param commonDto
     * @return
     */
    @PostMapping("/pbStatistics/unit")
    R pbStatisticsUnit(@RequestBody PagePbCheckUnitCommonDto commonDto);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComPbCheckUnitApi.java
@@ -7,22 +7,22 @@
import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
import com.alibaba.fastjson.JSONArray;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.listen.ComMngPopulationServeExcelListen;
import com.panzhihua.common.listen.ComPbCheckUnitExcelListen;
import com.panzhihua.common.model.dtos.FtpConfig;
import com.panzhihua.common.model.dtos.common.AddComPbCheckUnitDto;
import com.panzhihua.common.model.dtos.common.EditComPbCheckUnitDto;
import com.panzhihua.common.model.dtos.common.PageComPbCheckUnitDto;
import com.panzhihua.common.model.dtos.common.PagePbCheckUnitCommonDto;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo;
import com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO;
import com.panzhihua.common.service.partybuilding.ComPbCheckUnitFeign;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.SFTPUtil;
import com.panzhihua.community_backstage.config.SFTPConfig;
import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.StringRedisTemplate;
@@ -237,4 +237,58 @@
    public R exportElder() {
        return R.ok(sftpConfig.getExcelUrl() + "党组织导入模板.xlsx");
    }
    @ApiOperation(value = "报到单位统计-顶部数据", response = PbCheckUnitStatisticsVo.class)
    @ApiImplicitParam(name = "communityId", value = "社区id")
    @GetMapping("/statistics/top")
    public R unitStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId) {
        String belongTo = "";
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            belongTo = this.getLoginUserInfo().getName();
        }
        return this.comPbCheckUnitService.unitStatisticsTop(communityId, belongTo);
    }
    @ApiOperation(value = "报到单位统计", response = PbCheckUnitStatisticsVo.class)
    @PostMapping("/statistics")
    public R unitStatistics(@RequestBody PagePbCheckUnitCommonDto commonDto) {
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            commonDto.setBelongTo(this.getLoginUserInfo().getName());
        }
        return this.comPbCheckUnitService.unitStatistics(commonDto);
    }
    @ApiOperation(value = "报到党员统计-顶部数据", response = PbCheckUnitStatisticsVo.class)
    @ApiImplicitParam(name = "communityId", value = "社区id")
    @GetMapping("/pbStatistics/top")
    public R pbStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId) {
        String belongTo = "";
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            belongTo = this.getLoginUserInfo().getName();
        }
        return this.comPbCheckUnitService.pbStatisticsTop(communityId, belongTo);
    }
    @ApiOperation(value = "报到党员统计-按单位归属统计", response = PbCheckUnitStatisticsVo.class)
    @PostMapping("/pbStatistics/belong")
    public R pbStatisticsBelong(@RequestBody PagePbCheckUnitCommonDto commonDto) {
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            commonDto.setBelongTo(this.getLoginUserInfo().getName());
        }
        return this.comPbCheckUnitService.pbStatisticsBelong(commonDto);
    }
    @ApiOperation(value = "报到党员统计-按单位统计", response = ComPbCheckUnitVo.class)
    @PostMapping("/pbStatistics/unit")
    public R pbStatisticsUnit(@RequestBody PagePbCheckUnitCommonDto commonDto) {
        String[] area={"东区","仁和区","米易县","盐边县"};
        if(ArrayUtil.contains(area,this.getLoginUserInfo().getName())){
            commonDto.setBelongTo(this.getLoginUserInfo().getName());
        }
        return this.comPbCheckUnitService.pbStatisticsUnit(commonDto);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/ComPbCheckUnitController.java
@@ -129,5 +129,58 @@
        return this.comPbCheckUnitService.importCheckUnit(list,communityId,userId);
    }
    /**
     * 报到单位统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    @GetMapping("/statistics/top")
    public R unitStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId,
                               @RequestParam(value = "belongTo") String belongTo) {
        return comPbCheckUnitService.unitStatisticsTop(communityId, belongTo);
    }
    /**
     * 报到单位统计
     * @param commonDto
     * @return
     */
    @PostMapping("/statistics")
    public R unitStatistics(@RequestBody PagePbCheckUnitCommonDto commonDto) {
        return comPbCheckUnitService.unitStatistics(commonDto);
    }
    /**
     * 报到党员统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    @GetMapping("/pbStatistics/top")
    public R pbStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId,
                             @RequestParam(value = "belongTo") String belongTo) {
        return comPbCheckUnitService.pbStatisticsTop(communityId, belongTo);
    }
    /**
     * 报到党员统计-按单位归属统计
     * @param commonDto
     * @return
     */
    @PostMapping("/pbStatistics/belong")
    public R pbStatisticsBelong(@RequestBody PagePbCheckUnitCommonDto commonDto) {
        return comPbCheckUnitService.pbStatisticsBelong(commonDto);
    }
    /**
     * 报到党员统计-按单位统计
     * @param commonDto
     * @return
     */
    @PostMapping("/pbStatistics/unit")
    public R pbStatisticsUnit(@RequestBody PagePbCheckUnitCommonDto commonDto) {
        return comPbCheckUnitService.pbStatisticsUnit(commonDto);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbCheckUnitMapper.java
@@ -56,5 +56,45 @@
    List<ComPbCheckUnitVo> queryAllByList(@Param("dto") PageComPbCheckUnitDto comPbCheckUnit);
    Long selectCommunityId(@Param("area") String area,@Param("town")String town,@Param("community")String community);
    /**
     * 报到单位统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    PbCheckUnitStatisticsVo unitStatisticsTop(@Param("communityId") Long communityId, @Param("belongTo") String belongTo);
    /**
     * 报到单位统计
     * @param commonDto
     * @param page
     * @return
     */
    IPage<PbCheckUnitStatisticsVo> unitStatistics(@Param("commonDto") PagePbCheckUnitCommonDto commonDto, @Param("page") Page page);
    /**
     * 报到党员统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    PbCheckUnitStatisticsVo pbStatisticsTop(@Param("communityId") Long communityId, @Param("belongTo") String belongTo);
    /**
     * 报到党员统计-按单位归属统计
     * @param commonDto
     * @param page
     * @return
     */
    IPage<PbCheckUnitStatisticsVo> pbStatisticsBelong(@Param("commonDto") PagePbCheckUnitCommonDto commonDto, @Param("page") Page page);
    /**
     * 报到党员统计-按单位统计
     * @param commonDto
     * @param page
     * @return
     */
    IPage<ComPbCheckUnitVo> pbStatisticsUnit(@Param("commonDto") PagePbCheckUnitCommonDto commonDto, @Param("page") Page page);
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/ComPbCheckUnitService.java
@@ -94,4 +94,40 @@
     */
    R detailByPhone(String phone);
    /**
     * 报到单位统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    R unitStatisticsTop(Long communityId, String belongTo);
    /**
     * 报到单位统计
     * @param commonDto
     * @return
     */
    R unitStatistics(PagePbCheckUnitCommonDto commonDto);
    /**
     * 报到党员统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    R pbStatisticsTop(Long communityId, String belongTo);
    /**
     * 报到党员统计-按单位归属统计
     * @param commonDto
     * @return
     */
    R pbStatisticsBelong(PagePbCheckUnitCommonDto commonDto);
    /**
     * 报到党员统计-按单位统计
     * @param commonDto
     * @return
     */
    R pbStatisticsUnit(PagePbCheckUnitCommonDto commonDto);
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java
@@ -237,4 +237,56 @@
        }
        return R.ok();
    }
    /**
     * 报到单位统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    @Override
    public R unitStatisticsTop(Long communityId, String belongTo) {
        return R.ok(this.baseMapper.unitStatisticsTop(communityId, belongTo));
    }
    /**
     * 报到单位统计
     * @param commonDto
     * @return
     */
    @Override
    public R unitStatistics(PagePbCheckUnitCommonDto commonDto) {
        return R.ok(this.baseMapper.unitStatistics(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
    }
    /**
     * 报到党员统计-顶部数据
     * @param communityId
     * @param belongTo
     * @return
     */
    @Override
    public R pbStatisticsTop(Long communityId, String belongTo) {
        return R.ok(this.baseMapper.pbStatisticsTop(communityId, belongTo));
    }
    /**
     * 报到党员统计-按单位归属统计
     * @param commonDto
     * @return
     */
    @Override
    public R pbStatisticsBelong(PagePbCheckUnitCommonDto commonDto) {
        return R.ok(this.baseMapper.pbStatisticsBelong(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
    }
    /**
     * 报到党员统计-按单位统计
     * @param commonDto
     * @return
     */
    @Override
    public R pbStatisticsUnit(PagePbCheckUnitCommonDto commonDto) {
        return R.ok(this.baseMapper.pbStatisticsUnit(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml
@@ -88,6 +88,122 @@
    <select id="selectCommunityId" resultType="Long">
        select community_id from com_area_town_community where area=#{area} and town=#{town} and community=#{community}
    </select>
    <select id="unitStatisticsTop"
            resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
        SELECT
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE 1=1
            <if test="communityId != null">
                AND community_id = #{communityId}
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
            </if>
        ) AS unitTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位'
            <if test="communityId != null">
                AND community_id = #{communityId}
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
            </if>
        ) AS organTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位'
            <if test="communityId != null">
                AND community_id = #{communityId}
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
            </if>
        ) AS businessTotal,
        (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="communityId != null">
                AND m.community_id = #{communityId}
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND cpcu.belong_to = #{belongTo}
            </if>
        ) AS partyMemberTotal
    </select>
    <select id="unitStatistics" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
        SELECT temp.*,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位' AND belong_to = temp.belong_to) AS organTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位' AND belong_to = temp.belong_to) AS businessTotal,
        (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 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.communityId != null">
            AND community_id = #{commonDto.communityId}
        </if>
        <if test="commonDto.belongTo != null and commonDto.belongTo != ''">
            AND belong_to = #{commonDto.belongTo}
        </if>
        GROUP BY belong_to) temp
    </select>
    <select id="pbStatisticsTop" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
        SELECT
        (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
        AND cpcu.nature_name = '机关单位'
        <if test="communityId != null">
            AND m.community_id = #{communityId}
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
        </if>
        ) 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
        AND cpcu.nature_name = '企事业单位'
        <if test="communityId != null">
            AND m.community_id = #{communityId}
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
        </if>
        ) AS businessTotal,
        (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="communityId != null">
            AND m.community_id = #{communityId}
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
        </if>
        ) AS partyMemberTotal
    </select>
    <select id="pbStatisticsBelong" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
        SELECT temp.*,
        (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
        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
        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.communityId != null">
            AND m.community_id = #{commonDto.communityId}
        </if>
        <if test="commonDto.belongTo != null and commonDto.belongTo != ''">
            AND cpcu.belong_to = #{commonDto.belongTo}
        </if>
        GROUP BY belong_to) temp
    </select>
    <select id="pbStatisticsUnit" resultType="com.panzhihua.common.model.vos.common.ComPbCheckUnitVo">
        SELECT
        cpcu.`name`,
        cpcu.nature_name,
        cpcu.belong_to,
        cpcu.help_community_name,
        cpcu.village_name,
        COUNT( m.id ) AS count
        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.communityId != null">
            AND m.community_id = #{commonDto.communityId}
        </if>
        <if test="commonDto.belongTo != null and commonDto.belongTo != ''">
            AND cpcu.belong_to = #{commonDto.belongTo}
        </if>
        GROUP BY
        cpcu.`name`
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml
@@ -58,9 +58,11 @@
        TIMESTAMPDIFF(
        YEAR,
        m.employment_time,
        DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge
        DATE_FORMAT( NOW(), '%Y-%m-%d' )) as partyAge,
        su.nick_name
        from com_pb_member as m
        LEFT JOIN com_pb_org o ON m.org_id = o.id
        LEFT JOIN sys_user su ON o.user_id = su.user_id
        LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id
        LEFT JOIN com_mng_village cmv on m.village_id = cmv.village_id
        LEFT JOIN com_act ca on m.community_id = ca.community_id
@@ -107,6 +109,20 @@
            <if test="dto.belongTo !=null and dto.belongTo !=''">
                and cpcu.belong_to = #{dto.belongTo}
            </if>
            <if test="dto.natureName !=null and dto.natureName !=''">
                and cpcu.nature_name = #{dto.natureName}
            </if>
            <if test="dto.workUnitName !=null and dto.workUnitName !=''">
                and cpcu.name = #{dto.workUnitName}
            </if>
            <if test="dto.isRegister !=null">
                <if test="dto.isRegister == 1">
                    and m.user_id IS NOT NULL
                </if>
                <if test="dto.isRegister == 0">
                    and m.user_id IS NULL
                </if>
            </if>
        </where>
        order by m.create_at desc
    </select>