LuoTong
2024-04-22 fc634fec8ee2b145e4de67d71ca3c4e8b41698af
大屏 一标三时
双报到双服务
18个文件已修改
3个文件已添加
444 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PagePbCheckUnitCommonDto.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/large/AreaStreetDetail.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/large/AreaStreetDetailResp.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/large/SumAreaStreetResp.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/area/StreetAndBuildVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/common/PbCheckUnitStatisticsVo.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationSpecialStatisticsVO.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/ComPbCheckUnitFeign.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComPbCheckUnitApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/LargeScreenApi.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComStreetService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDaoMapper.xml 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/ComPbCheckUnitController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbCheckUnitMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/ComPbCheckUnitService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PagePbCheckUnitCommonDto.java
@@ -4,6 +4,7 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
@@ -38,5 +39,8 @@
    @ApiModelProperty(value = "报道单位id集合")
    private Long[] unitIds;
    @ApiModelProperty("年份 例子 2024")
    private String yearTime;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/large/AreaStreetDetail.java
New file
@@ -0,0 +1,16 @@
package com.panzhihua.common.model.dtos.community.large;
import com.panzhihua.common.model.vos.community.screen.event.EventPopulationSpecialStatisticsVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AreaStreetDetail {
    @ApiModelProperty("街道相关信息")
    private AreaStreetDetailResp areaStreetDetailResp;
    @ApiModelProperty("特殊人口数据")
    private EventPopulationSpecialStatisticsVO eventPopulationVO;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/large/AreaStreetDetailResp.java
New file
@@ -0,0 +1,31 @@
package com.panzhihua.common.model.dtos.community.large;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class AreaStreetDetailResp {
    @ApiModelProperty("街道 总和")
    private Integer streetCount;
    @ApiModelProperty("社区 总和")
    private Integer actCount;
    @ApiModelProperty("人口 总和")
    private Integer populationCount;
    @ApiModelProperty("小区 总和")
    private Integer villageCount;
    @ApiModelProperty("房屋 总和")
    private Integer houseCount;
    @ApiModelProperty("城市小区 总和")
    private Integer cityVillageCount;
    @ApiModelProperty("农村小区 总和")
    private Integer countryVillageCount;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/large/SumAreaStreetResp.java
New file
@@ -0,0 +1,28 @@
package com.panzhihua.common.model.dtos.community.large;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class SumAreaStreetResp {
    @ApiModelProperty("区 总和")
    private Integer areaCount;
    @ApiModelProperty("街道 总和")
    private Integer streetCount;
    @ApiModelProperty("社区 总和")
    private Integer actCount;
    @ApiModelProperty("人口 总和")
    private Integer populationCount;
    @ApiModelProperty("小区 总和")
    private Integer villageCount;
    @ApiModelProperty("房屋 总和")
    private Integer houseCount;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/area/StreetAndBuildVO.java
@@ -9,6 +9,10 @@
    /**
     * 社区id
     */
    private String communityId;
    /**
     * 社区名称
     */
    private String name;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/common/PbCheckUnitStatisticsVo.java
@@ -30,4 +30,8 @@
    @ApiModelProperty(value = "已报到党员")
    private Integer partyMemberTotal;
    @ApiModelProperty(value = "机关单位累计总积分")
    private Integer organSumIntegral;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationSpecialStatisticsVO.java
@@ -21,7 +21,7 @@
    @ApiModelProperty("低保户")
    private Integer dbTotal = 0;
    @ApiModelProperty("高龄老人")
    @ApiModelProperty("高龄老人 》=80")
    private Integer glTotal = 0;
    @ApiModelProperty("特殊情况")
@@ -33,6 +33,9 @@
    @ApiModelProperty("退役军人")
    private Integer tyTotal = 0;
    @ApiModelProperty("留守儿童")
    private Integer lsTotal = 0;
    @ApiModelProperty(value = "吸毒人员",hidden = true)
    private Integer xdTotal = 0;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -12,6 +12,8 @@
import com.panzhihua.common.model.dtos.community.dpc.EditDpcDTO;
import com.panzhihua.common.model.dtos.community.dpc.PageDpcDTO;
import com.panzhihua.common.model.dtos.community.enterprise.*;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetail;
import com.panzhihua.common.model.dtos.community.large.SumAreaStreetResp;
import com.panzhihua.common.model.dtos.community.reserve.*;
import com.panzhihua.common.model.dtos.community.sanshuo.*;
import com.panzhihua.common.model.dtos.community.warehouse.ComActWarehouseApplyDTO;
@@ -11889,5 +11891,18 @@
    @GetMapping("/largeScreen/probably")
    public R probably(@RequestParam("year") Integer year,@RequestParam("belongTo") String belongTo);
    /**
     * 查询 一标三实 数据
     */
    @GetMapping("/largeScreen/sumAreaStreet")
     R<SumAreaStreetResp> sumAreaStreet();
    /**
     *  下拉 明细
     */
    @GetMapping(("/largeScreen/areaStreetDetail"))
     R<AreaStreetDetail> areaStreetDetail(@RequestParam("code") String code,
                                          @RequestParam("type") String type);
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/partybuilding/ComPbCheckUnitFeign.java
@@ -116,7 +116,8 @@
    R unitStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId,
                        @RequestParam(value = "belongTo") String belongTo,
                        @RequestParam(value = "choice", required = false) String choice,
                        @RequestParam(value = "unitIds", required = false) Long[] unitIds);
                        @RequestParam(value = "unitIds", required = false) Long[] unitIds,
                        @RequestParam(value = "yearTime",required = false) String yearTime);
    /**
     * 报到单位统计
@@ -139,7 +140,8 @@
                      @RequestParam(value = "belongTo") String belongTo,
                      @RequestParam(value = "choice", required = false) String choice,
                      @RequestParam(value = "checkUnitId", required = false) Long checkUnitId,
                      @RequestParam(value = "unitIds", required = false) Long[] unitIds);
                      @RequestParam(value = "unitIds", required = false) Long[] unitIds,
                      @RequestParam(value = "yearTime",required = false) String yearTime);
    /**
     * 报到党员统计-按单位归属统计
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -5,6 +5,8 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetail;
import com.panzhihua.common.model.dtos.community.large.SumAreaStreetResp;
import com.panzhihua.common.model.vos.community.ComActSocialOrgVO;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenDpcStatisticsInfo;
@@ -781,5 +783,20 @@
    public R probably(@RequestParam("year") Integer year,@RequestParam("belongTo") String belongTo){
        return communityService.probably(year,belongTo);
    }
    /**
     * 查询 一标三实 数据
     */
    @GetMapping("/sumAreaStreet")
    public R<SumAreaStreetResp> sumAreaStreet(){
        return communityService.sumAreaStreet();
    }
    /**
     *  下拉 明细
     */
    @GetMapping(("/areaStreetDetail"))
    private R<AreaStreetDetail> areaStreetDetail(@RequestParam("code") String code,
                                                 @RequestParam("type") String type){
        return communityService.areaStreetDetail(code, type);
    }
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComPbCheckUnitApi.java
@@ -284,7 +284,8 @@
    })
    @GetMapping("/statistics/top")
    public R unitStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId,
                               @RequestParam(value = "belongTo", required = false) String choice) {
                               @RequestParam(value = "belongTo", required = false) String choice,
                               @RequestParam(value = "yearTime",required = false) String yearTime) {
        String belongTo = "";
        String[] area={"东区","仁和区","米易县","盐边县","西区","钒钛高新区"};
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
@@ -296,7 +297,7 @@
        if ("PZHZGNYYH".equals(loginUserInfo.getAccount())){
            unitIds = ids;
        }
        return this.comPbCheckUnitService.unitStatisticsTop(communityId, belongTo, choice,unitIds);
        return this.comPbCheckUnitService.unitStatisticsTop(communityId, belongTo, choice,unitIds,yearTime);
    }
    @ApiOperation(value = "报到单位统计", response = PbCheckUnitStatisticsVo.class)
@@ -323,7 +324,8 @@
    @GetMapping("/pbStatistics/top")
    public R pbStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId,
                             @RequestParam(value = "choice", required = false) String choice,
                             @RequestParam(value = "checkUnitId", required = false) Long checkUnitId) {
                             @RequestParam(value = "checkUnitId", required = false) Long checkUnitId,
                             @RequestParam(value = "yearTime",required = false) String yearTime) {
        String belongTo = "";
        String[] area={"东区","仁和区","米易县","盐边县","西区","钒钛高新区"};
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
@@ -335,7 +337,7 @@
        if ("PZHZGNYYH".equals(loginUserInfo.getAccount())){
            unitIds = ids;
        }
        return this.comPbCheckUnitService.pbStatisticsTop(communityId, belongTo, choice, checkUnitId,unitIds);
        return this.comPbCheckUnitService.pbStatisticsTop(communityId, belongTo, choice, checkUnitId,unitIds,yearTime);
    }
    @ApiOperation(value = "报到党员统计-按单位归属统计", response = PbCheckUnitStatisticsVo.class)
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/LargeScreenApi.java
@@ -1,6 +1,9 @@
package com.panzhihua.service_community.api;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetail;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetailResp;
import com.panzhihua.common.model.dtos.community.large.SumAreaStreetResp;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActDynVO;
import com.panzhihua.common.service.community.CommunityService;
@@ -8,6 +11,7 @@
import com.panzhihua.service_community.service.ComStreetService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -31,6 +35,11 @@
        return comStreetService.panzhihuaMap(areaCode);
    }
    /**
     * 根据 街道 查询 社区
     * @param streetId
     * @return
     */
    @GetMapping("/oneTagThreeReal")
    public R oneTagThreeReal(@RequestParam("streetId") Long streetId){
        return comStreetService.oneTagThreeReal(streetId);
@@ -78,5 +87,23 @@
        return comStreetService.probably(year, belongTo);
    }
    /**
     * 查询 一标三实 数据
     */
    @GetMapping("/sumAreaStreet")
    public R<SumAreaStreetResp> sumAreaStreet(){
        return R.ok(comStreetService.sumAreaStreet());
    }
    /**
     *  下拉 明细
     */
    @GetMapping(("/areaStreetDetail"))
    private R<AreaStreetDetail> areaStreetDetail(@RequestParam("code") String code,
                                                 @RequestParam("type") String type){
        return R.ok(comStreetService.areaStreetDetail(code, type));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -3,6 +3,8 @@
import java.util.List;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetailResp;
import com.panzhihua.common.model.dtos.community.large.SumAreaStreetResp;
import com.panzhihua.common.model.vos.area.StreetAndBuildVO;
import com.panzhihua.common.model.vos.community.ComActPasswordVo;
import com.panzhihua.common.model.vos.community.bigscreen.ScreenStatics;
@@ -183,6 +185,7 @@
    @Select("select * from com_act where area_code = #{areaCode}")
    List<ComActVO> panzhihuaMap(@Param("areaCode")String areaCode);
    List<StreetAndBuildVO> oneTagThreeReal(@Param("streetId") Long streetId);
    ScreenStatics getScreenStatics();
@@ -197,4 +200,10 @@
    @Select("SELECT count(1) FROM com_pb_check_unit WHERE belong_to = #{belongTo}")
    Integer arriveUnit(@Param("belongTo") String belongTo);
    SumAreaStreetResp sumAreaStreet();
    AreaStreetDetailResp selectVillage(@Param("ids") List<Long> ids,@Param("type") String type);
    EventPopulationSpecialStatisticsVO selectEvent(@Param("ids") List<Long> ids);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComStreetService.java
@@ -4,6 +4,9 @@
import com.panzhihua.common.model.dtos.community.PageComStreetDTO;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetail;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetailResp;
import com.panzhihua.common.model.dtos.community.large.SumAreaStreetResp;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActVO;
import com.panzhihua.common.model.vos.community.ComStreetVO;
@@ -94,4 +97,8 @@
    R populationStatics(Long streetId);
    R probably(Integer year,String belongTo);
    SumAreaStreetResp sumAreaStreet();
    AreaStreetDetail areaStreetDetail(String code, String type);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java
@@ -13,6 +13,9 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetail;
import com.panzhihua.common.model.dtos.community.large.AreaStreetDetailResp;
import com.panzhihua.common.model.dtos.community.large.SumAreaStreetResp;
import com.panzhihua.common.model.vos.StreetVO;
import com.panzhihua.common.model.vos.area.StreetAndBuildVO;
import com.panzhihua.common.model.vos.community.bigscreen.ScreenStatics;
@@ -49,6 +52,7 @@
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.ComStreetService;
import org.springframework.util.StringUtils;
/**
 * @author: llming
@@ -367,4 +371,37 @@
        return R.ok(activityVO);
    }
    @Override
    public SumAreaStreetResp sumAreaStreet() {
        SumAreaStreetResp resp = comActDAO.sumAreaStreet();
        return resp;
    }
    @Override
    public AreaStreetDetail areaStreetDetail(String code, String type) {
        //根据层级 查询 社区id
        LambdaQueryWrapper<ComActDO> qry = new LambdaQueryWrapper<>();
        if(type.equals("1")){// 1 查询 大区
            qry.eq( !StringUtils.isEmpty(code),ComActDO::getAreaCode,code);
        }
        if(type.equals("2")){// 2 查询 街道
            qry.eq( !StringUtils.isEmpty(code),ComActDO::getStreetId,code);
        }
        if(type.equals("3")){// 3 查询 小区
            qry.eq( !StringUtils.isEmpty(code),ComActDO::getCommunityId,code);
        }
        qry.eq(ComActDO::getAppId,"wx118de8a734d269f0");
        List<ComActDO> doList = comActDAO.selectList(qry);
        //解析 社区id
        List<Long> ids = doList.stream().map(ComActDO::getCommunityId).collect(Collectors.toList());
        AreaStreetDetail result = new AreaStreetDetail();
        //查询 街道相关信息
        AreaStreetDetailResp village = comActDAO.selectVillage(ids,type);
        result.setAreaStreetDetailResp(village);
        //查询 人口相关数据
        EventPopulationSpecialStatisticsVO eventResult = comActDAO.selectEvent(ids);
        result.setEventPopulationVO(eventResult);
        return result;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDaoMapper.xml
@@ -4,7 +4,7 @@
    <select id="oneTagThreeReal" resultType="com.panzhihua.common.model.vos.area.StreetAndBuildVO">
        select ca.name name,
        select ca.name name,ca.community_id as communityId,
               (select
                     count( cmpct.id )
                from com_mng_population_community_tags cmpct left join com_mng_population cmp on cmp.id = cmpct.population_id where cmpct.community_id = ca.community_id )peopleNum,
@@ -223,6 +223,97 @@
            resultType="com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO">
    </select>
    <select id="sumAreaStreet" resultType="com.panzhihua.common.model.dtos.community.large.SumAreaStreetResp">
        SELECT
            ( select count(*) FROM (
                SELECT cs.street_id,cs.area_code FROM ( SELECT street_id from com_act where app_id = 'wx118de8a734d269f0' GROUP BY street_id   )   as ca INNER  JOIN com_street cs on cs.street_id = ca.street_id
                GROUP BY area_code) as gr    ) as areaCount ,
            ( SELECT count(*) FROM ( SELECT street_id from com_act where app_id = 'wx118de8a734d269f0' GROUP BY street_id )  as dd  )as streetCount ,
            ( SELECT count(*) FROM ( SELECT street_id from com_act where app_id = 'wx118de8a734d269f0' GROUP BY community_id ) as adfd )as actCount ,
            ( SELECT count(*) from `com_mng_population` cmp RIGHT JOIN ( SELECT street_id from com_act where app_id = 'wx118de8a734d269f0' GROUP BY street_id) cs on cs.street_id = cmp.street_id where cmp.death = '0' ) as populationCount ,
            ( SELECT count(*) from `com_mng_village` cmv RIGHT JOIN ( SELECT street_id from com_act where app_id = 'wx118de8a734d269f0' GROUP BY street_id) cs on cs.street_id = cmv.street_id  ) as villageCount ,
            ( SELECT count(*) from `com_mng_population_house` cmph RIGHT JOIN ( SELECT street_id from com_act where app_id = 'wx118de8a734d269f0' GROUP BY street_id) cs on cmph.street_id = cs.street_id  ) as houseCount
    </select>
    <select id="selectVillage" resultType="com.panzhihua.common.model.dtos.community.large.AreaStreetDetailResp">
        select
               <if test="type = '1'.toString() " >
                   ( SELECT count(*) from (SELECT 1 from com_act WHERE community_id in (
                   <foreach collection="ids" item="id" separator=",">
                       #{id}
                   </foreach>
                   ) GROUP BY street_id ) as countAS ) as streetCount  ,
               </if>
        <if test="type = '2'.toString() or type = '1'.toString()" >
            ( SELECT  count(*) from com_act WHERE community_id in (
            <foreach collection="ids" item="id" separator=",">
                #{id}
            </foreach>
            ) ) as actCount ,
        </if>
            ( SELECT count(*) FROM com_mng_population WHERE act_id in(
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        ) and death = '0' ) as populationCount ,
            ( SELECT count( * ) FROM  com_mng_village  WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        ) ) AS villageCount,
            ( SELECT count( * ) FROM  com_mng_village  WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        ) and type = '1' ) as cityVillageCount,
            ( SELECT count( * ) FROM  com_mng_village  WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        ) and type = '2' ) as countryVillageCount
    </select>
    <select id="selectEvent" resultType="com.panzhihua.common.model.vos.community.screen.event.EventPopulationSpecialStatisticsVO">
        SELECT
            ( SELECT count(*) FROM com_mng_population_community_tags WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
                )  and label like concat('%','残疾','%')  ) as cjTotal,
            ( SELECT count(*) FROM com_mng_population_community_tags WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        )  and label like concat('%','低保','%')  ) as dbTotal,
            ( SELECT count(*) FROM com_mng_population_community_tags WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        )  and label like concat('%','养老金','%')  ) as lnTotal,
            ( SELECT count(*) FROM com_mng_population_community_tags WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        )  and label like concat('%','高龄','%')  ) as glTotal,
            ( SELECT count(*) FROM com_mng_population_community_tags WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        )  and label like concat('%','退役','%')  ) as tyTotal,
            ( SELECT count(*) FROM com_mng_population_community_tags WHERE  community_id IN (
        <foreach collection="ids" item="id" separator=",">
            #{id}
        </foreach>
        )  and label like concat('%','留守','%')  ) as lsTotal
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/api/ComPbCheckUnitController.java
@@ -151,8 +151,9 @@
    public R unitStatisticsTop(@RequestParam(value = "communityId", required = false) Long communityId,
                               @RequestParam(value = "belongTo") String belongTo,
                               @RequestParam(value = "belongTo", required = false) String choice,
                               @RequestParam(value = "unitIds", required = false) Long[] unitIds) {
        return comPbCheckUnitService.unitStatisticsTop(communityId, belongTo, choice,unitIds);
                               @RequestParam(value = "unitIds", required = false) Long[] unitIds,
                               @RequestParam(value = "yearTime",required = false) String yearTime) {
        return comPbCheckUnitService.unitStatisticsTop(communityId, belongTo, choice,unitIds,yearTime);
    }
    /**
@@ -178,8 +179,9 @@
                             @RequestParam(value = "belongTo") String belongTo,
                             @RequestParam(value = "choice", required = false) String choice,
                             @RequestParam(value = "checkUnitId", required = false) Long checkUnitId,
                             @RequestParam(value = "unitIds", required = false) Long[] unitIds) {
        return comPbCheckUnitService.pbStatisticsTop(communityId, belongTo, choice, checkUnitId,unitIds);
                             @RequestParam(value = "unitIds", required = false) Long[] unitIds,
                             @RequestParam(value = "yearTime",required = false) String yearTime) {
        return comPbCheckUnitService.pbStatisticsTop(communityId, belongTo, choice, checkUnitId,unitIds,yearTime);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbCheckUnitMapper.java
@@ -64,7 +64,9 @@
     * @param choice
     * @return
     */
    PbCheckUnitStatisticsVo unitStatisticsTop(@Param("communityIds") List<Long> communityIds, @Param("belongTo") String belongTo, @Param("choice") String choice, @Param("unitIds")  Long[] unitIds);
    PbCheckUnitStatisticsVo unitStatisticsTop(@Param("communityIds") List<Long> communityIds, @Param("belongTo") String belongTo,
                                              @Param("choice") String choice, @Param("unitIds")  Long[] unitIds,
                                              @Param("yearTime") String yearTime);
    /**
     * 报到单位统计
@@ -99,5 +101,9 @@
     * @return
     */
    IPage<ComPbCheckUnitVo> pbStatisticsUnit(@Param("commonDto") PagePbCheckUnitCommonDto commonDto, @Param("page") Page page);
    Integer organSumIntegral(@Param("communityIds") List<Long> communityIds,@Param("yearTime") String yearTime);
    Integer pbOrganSumIntegral(@Param("communityIds") List<Long> communityIds,@Param("yearTime") String yearTime);
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/ComPbCheckUnitService.java
@@ -106,7 +106,7 @@
     * @param choice
     * @return
     */
    R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds);
    R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds,String yearTime);
    /**
     * 报到单位统计
@@ -123,7 +123,7 @@
     * @param checkUnitId
     * @return
     */
    R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds);
    R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds ,String yearTime);
    /**
     * 报到党员统计-按单位归属统计
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java
@@ -16,6 +16,7 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.TreeListVO;
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.utlis.StringUtils;
@@ -299,7 +300,7 @@
     * @return
     */
    @Override
    public R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds) {
    public R unitStatisticsTop(Long communityId, String belongTo, String choice,Long[] unitIds,String yearTime) {
        List<Long> communityIds = new ArrayList<>();
        if (null != communityId){
             communityIds = comPbMemberDAO.selectIds(communityId);
@@ -307,8 +308,13 @@
                communityIds.add(communityId);
            }
        }
        return R.ok(this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice,unitIds));
        //查询 活动总积分
        PbCheckUnitStatisticsVo vo = this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice,unitIds,yearTime);
        if(null != vo) {
            Integer sum = this.baseMapper.organSumIntegral(communityIds,yearTime);
            vo.setOrganSumIntegral(sum);
        }
        return R.ok(vo);
    }
    /**
@@ -339,7 +345,7 @@
     * @return
     */
    @Override
    public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds) {
    public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId,Long[] unitIds ,String yearTime) {
        List<Long> communityIds = new ArrayList<>();
        if (null != communityId){
@@ -348,7 +354,13 @@
                communityIds.add(communityId);
            }
        }
        return R.ok(this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId,unitIds));
        //查询 活动总积分
        PbCheckUnitStatisticsVo vo = this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId,unitIds);
        if(null != vo) {
            Integer sum = this.baseMapper.pbOrganSumIntegral(communityIds,yearTime);
            vo.setOrganSumIntegral(sum);
        }
        return R.ok(vo);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml
@@ -129,6 +129,11 @@
            <if test="choice != null and choice != ''">
                AND belong_to = #{choice}
            </if>
        <if test=" null != yearTime and '' != yearTime">
            and ( `create_at` &gt;= concat(#{yearTime},'-01-01 00:00:00') AND `create_at` &lt;= concat(#{yearTime},'-12-31 59:59:59'))
        </if>
        ) AS unitTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位'
            <if test="communityIds != null and communityIds.size() >0">
@@ -149,6 +154,10 @@
            <if test="choice != null and choice != ''">
                AND belong_to = #{choice}
            </if>
        <if test=" null != yearTime and '' != yearTime">
            and ( `create_at` &gt;= concat(#{yearTime},'-01-01 00:00:00') AND `create_at` &lt;= concat(#{yearTime},'-12-31 59:59:59'))
        </if>
        ) AS organTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位'
            <if test="communityIds != null and communityIds.size() >0">
@@ -169,6 +178,9 @@
            <if test="choice != null and choice != ''">
                AND belong_to = #{choice}
            </if>
        <if test=" null != yearTime and '' != yearTime">
            and ( `create_at` &gt;= concat(#{yearTime},'-01-01 00:00:00') AND `create_at` &lt;= concat(#{yearTime},'-12-31 59:59:59'))
        </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="communityIds != null and communityIds.size() >0">
@@ -189,6 +201,9 @@
            <if test="choice != null and choice != ''">
                AND cpcu.belong_to = #{choice}
            </if>
        <if test=" null != yearTime and '' != yearTime">
            and ( cpcu.`create_at` &gt;= concat(#{yearTime},'-01-01 00:00:00') AND cpcu.`create_at` &lt;= concat(#{yearTime},'-12-31 59:59:59'))
        </if>
        ) AS partyMemberTotal
    </select>
    <select id="unitStatistics" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
@@ -207,7 +222,11 @@
                    #{item}
                </foreach>
            </if>
         AND belong_to = temp.belong_to) AS organTotal,
         AND belong_to = temp.belong_to
            <if test=" null != commonDto.yearTime and '' != commonDto.yearTime">
                and ( `create_at` &gt;= concat(#{commonDto.yearTime},'-01-01 00:00:00') AND `create_at` &lt;= concat(#{commonDto.yearTime},'-12-31 59:59:59'))
            </if>
        ) 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
@@ -221,7 +240,11 @@
                    #{item}
                </foreach>
            </if>
        AND belong_to = temp.belong_to) AS businessTotal,
        AND belong_to = temp.belong_to
        <if test=" null != commonDto.yearTime and '' != commonDto.yearTime">
            and ( `create_at` &gt;= concat(#{commonDto.yearTime},'-01-01 00:00:00') AND `create_at` &lt;= concat(#{commonDto.yearTime},'-12-31 59:59:59'))
        </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="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND m.community_id IN
@@ -235,8 +258,15 @@
                    #{item}
                </foreach>
            </if>
         AND cpcu.belong_to = temp.belong_to) AS partyMemberTotal
         AND cpcu.belong_to = temp.belong_to
        <if test=" null != commonDto.yearTime and '' != commonDto.yearTime">
            and ( cpcu.`create_at` &gt;= concat(#{commonDto.yearTime},'-01-01 00:00:00') AND cpcu.`create_at` &lt;= concat(#{commonDto.yearTime},'-12-31 59:59:59'))
        </if>
            ) AS partyMemberTotal
        FROM (SELECT belong_to,COUNT( id ) AS unitTotal FROM com_pb_check_unit WHERE 1=1
        <if test=" null != commonDto.yearTime and '' != commonDto.yearTime">
            and ( `create_at` &gt;= concat(#{commonDto.yearTime},'-01-01 00:00:00') AND `create_at` &lt;= concat(#{commonDto.yearTime},'-12-31 59:59:59'))
        </if>
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
@@ -409,5 +439,56 @@
        cpcu.`name`
    </select>
    <select id="organSumIntegral" resultType="java.lang.Integer">
        SELECT sum(csr.pb_reward_integral) as organSumIntegral from (
             SELECT cm.user_id , cu.community_id   FROM com_pb_check_unit cu inner JOIN com_pb_member cm on cm.check_unit_id = cu.id
              where
               cm.user_id is not null
                and cu.community_id is not null
        <if test="communityIds != null and communityIds.size() >0">
            AND cu.community_id IN
            <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test=" null != yearTime and '' != yearTime">
            and ( cu.`create_at` &gt;= concat(#{yearTime},'-01-01 00:00:00') AND cu.`create_at` &lt;= concat(#{yearTime},'-12-31 59:59:59'))
        </if>
                   GROUP BY  cm.user_id , cu.community_id
                 ) as cum INNER JOIN (
            SELECT ccc.*  FROM com_act_act_regist as cr INNER JOIN (
                select ca.community_id ,cs.user_id,cs.activity_id,ca.pb_reward_integral
                FROM com_act_activity ca LEFT JOIN com_act_act_sign cs on cs.activity_id = ca.id  WHERE cs.`status` = '1'  and ca.have_integral_reward = '1'
                ORDER BY  cs.user_id DESC
            ) as ccc on cr.activity_id = ccc.activity_id and cr.user_id = ccc.user_id
        ) as csr  on  csr.community_id = cum.community_id and csr.user_id = cum.user_id
    </select>
    <select id="pbOrganSumIntegral" resultType="java.lang.Integer">
        SELECT sum(csr.pb_reward_integral) as organSumIntegral from (
        SELECT cm.user_id , cu.community_id   FROM com_pb_check_unit cu inner JOIN com_pb_member cm on cm.check_unit_id = cu.id
        where
        cm.user_id is not null
        and cu.community_id is not null
        <if test="communityIds != null and communityIds.size() >0">
            AND cu.community_id IN
            <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test=" null != yearTime and '' != yearTime">
            and ( cm.`create_at` &gt;= concat(#{yearTime},'-01-01 00:00:00') AND cm.`create_at` &lt;= concat(#{yearTime},'-12-31 59:59:59'))
        </if>
        GROUP BY  cm.user_id , cu.community_id
        ) as cum INNER JOIN (
        SELECT ccc.*  FROM com_act_act_regist as cr INNER JOIN (
        select ca.community_id ,cs.user_id,cs.activity_id,ca.pb_reward_integral
        FROM com_act_activity ca LEFT JOIN com_act_act_sign cs on cs.activity_id = ca.id  WHERE cs.`status` = '1'  and ca.have_integral_reward = '1'
        ORDER BY  cs.user_id DESC
        ) as ccc on cr.activity_id = ccc.activity_id and cr.user_id = ccc.user_id
        ) as csr  on  csr.community_id = cum.community_id and csr.user_id = cum.user_id
    </select>
</mapper>