luoxinwu
2023-12-20 e02e62192866d847b548b22855aad498931b7b79
花城大屏
2个文件已添加
11个文件已修改
527 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PageComPbCheckUnitDto.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/building/BuildingDto.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/StreetVO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/area/StreetAndBuildVO.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/ScreenStatics.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/WestScreenStatics.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/UnitActivityAnalysisVO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/LargeScreenApi.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComStreetService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java 112 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDaoMapper.xml 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PageComPbCheckUnitDto.java
@@ -76,6 +76,9 @@
    @ApiModelProperty(value = "社区id")
    private Long communityId;
    @ApiModelProperty(value = "所属党组织")
    private String orgName;
    @ApiModelProperty(value = "分页每页数量", example = "10")
    private Long pageSize = 10L;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/building/BuildingDto.java
@@ -1,4 +1,14 @@
package com.panzhihua.common.model.dtos.community.building;
import lombok.Data;
@Data
public class BuildingDto {
    private Long streetId;
    private Integer areaCode;
    private String appId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/StreetVO.java
New file
@@ -0,0 +1,11 @@
package com.panzhihua.common.model.vos;
import lombok.Data;
@Data
public class StreetVO {
    private String streetId;
    private String name;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/area/StreetAndBuildVO.java
@@ -1,5 +1,7 @@
package com.panzhihua.common.model.vos.area;
import com.panzhihua.common.model.vos.community.screen.event.EventPopulationSpecialStatisticsVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@@ -14,15 +16,18 @@
    /**
     * 人口数量
     */
    private Integer peopleNum;
    private Integer peopleNum = 0;
    /**
     * 小区数量
     */
    private Integer villageNum;
    private Integer villageNum = 0;
    /**
     * 房屋数量
     */
    private Integer buildNum;
    private Integer buildNum = 0;
    @ApiModelProperty("特殊人口数据")
    private EventPopulationSpecialStatisticsVO specialStatisticsVo;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/ScreenStatics.java
New file
@@ -0,0 +1,36 @@
package com.panzhihua.common.model.vos.community.bigscreen;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ScreenStatics {
    @ApiModelProperty("注册人数")
    private Integer user;
    @ApiModelProperty("日活跃")
    private Integer dayUser;
    @ApiModelProperty("月访问量")
    private Integer countUser;
    @ApiModelProperty("志愿者")
    private Integer volunteer;
    @ApiModelProperty("微心愿")
    private Integer microWish;
    @ApiModelProperty("社区活动")
    private Integer activity;
    @ApiModelProperty("随手拍")
    private Integer neighbor;
    @ApiModelProperty("党组织")
    private Integer partyOrg;
    @ApiModelProperty("党员")
    private Integer partyMember;
    @ApiModelProperty("红色物业")
    private Integer red;
    @ApiModelProperty("网格治理")
    private Integer grid;
    @ApiModelProperty("议事投票")
    private Integer discuss;
    @ApiModelProperty("共建协议")
    private Integer agreement;
    @ApiModelProperty("报道党员")
    private Integer arrivePartyMember;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/WestScreenStatics.java
@@ -26,7 +26,7 @@
    private Integer activity;
    @ApiModelProperty("疫情防控")
    private Integer reserve;
    @ApiModelProperty("邻里圈")
    @ApiModelProperty("随手拍")
    private Integer neighbor;
    @ApiModelProperty("一起议")
    private Integer discuss;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/neighbor/UnitActivityAnalysisVO.java
@@ -11,6 +11,13 @@
@Data
@ApiModel
public class UnitActivityAnalysisVO implements Serializable {
    @ApiModelProperty("单位归属")
    private String belongTo;
    @ApiModelProperty("所属党组织")
    private String a;
    @ApiModelProperty("单位名称")
    private String unitName;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/LargeScreenApi.java
@@ -1,14 +1,82 @@
package com.panzhihua.service_community.api;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActDynVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.service_community.service.ComActDynService;
import com.panzhihua.service_community.service.ComStreetService;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@RequestMapping("/largeScreen")
public class LargeScreenApi {
    @Autowired
    private ComStreetService comStreetService;
    @Autowired
    private CommunityService communityService;
    @Autowired
    private ComActDynService comActDynService;
    /**
     * 地图
     */
    @GetMapping("/panzhihuaMap")
    public R panzhihuaMap(@RequestParam("areaCode")String areaCode){
        return comStreetService.panzhihuaMap(areaCode);
    }
    @GetMapping("/oneTagThreeReal")
    public R oneTagThreeReal(@RequestParam Long streetId){
        return comStreetService.oneTagThreeReal(streetId);
    }
    /**
     * 根据行政区查询街道
     */
    @PostMapping("/searchStreet")
    public R searchStreet(@RequestBody BuildingDto buildingDto){
        return comStreetService.searchStreet(buildingDto);
    }
    /**
     * 花城资讯
     */
    @PostMapping("/huachengDyn")
    public R huachengDyn(@RequestBody ComActDynVO comActDynVO){
        return comActDynService.pageDynamicByAdmin(comActDynVO);
//        return communityService.pageDynamicByAdmin(comActDynVO);
    }
    /**
     * 综合数据
     */
    @GetMapping("/getScreenStatics")
    public R getScreenStatics(){
        return comStreetService.getScreenStatics();
    }
    /**
     * 特殊人群统计
     */
    @GetMapping("/populationStatics")
    public R populationStatics(@RequestParam("streetId") Long streetId){
        return comStreetService.populationStatics(streetId);
    }
    /**
     *  花城党建大屏
     */
    @GetMapping("/probably")
    public R probably(@RequestParam("year") Integer year,@RequestParam("belongTo") String belongTo){
        return comStreetService.probably(year, belongTo);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -2,8 +2,12 @@
import java.util.List;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
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;
import com.panzhihua.common.model.vos.community.screen.event.EventPopulationSpecialStatisticsVO;
import com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -177,6 +181,20 @@
    @Select("SELECT count(1) FROM com_act_social_org")
    Integer countSocialOrg();
    @Select("select * from com_act where area_code = #{areaCode}")
    List<ComActVO> panzhihuaMap(@Param("areaCode")String areaCode);
    List<StreetAndBuildVO> oneTagThreeReal(@Param("streetId") Long streetId);
    List<StreetAndBuildVO> oneTagThreeReal();
    ScreenStatics getScreenStatics();
    EventPopulationSpecialStatisticsVO getPopulationSpecial(@Param("streetId") Long streetId);
    Integer getPopulationAge(@Param("streetId") Long streetId, @Param("age") Integer age);
    List<UnitActivityAnalysisVO>  institutionalUnitServiceAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme);
    List<UnitActivityAnalysisVO>  institutionalUnitActivityAnalysis(@Param("beginTime") String beginTime, @Param("endTime") String endTIme);
    @Select("SELECT count(1) FROM com_pb_check_unit WHERE belong_to = #{belongTo}")
    Integer arriveUnit(@Param("belongTo") String belongTo);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComStreetService.java
@@ -3,6 +3,7 @@
import java.util.List;
import com.panzhihua.common.model.dtos.community.PageComStreetDTO;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActVO;
import com.panzhihua.common.model.vos.community.ComStreetVO;
@@ -82,4 +83,15 @@
     * 重置街道密码
     * */
    R repssStreet(ComStreetVO comActVO);
    R panzhihuaMap(String areaCode);
    R searchStreet(BuildingDto buildingDto);
    R oneTagThreeReal(Long street);
    R getScreenStatics();
    R populationStatics(Long streetId);
    R probably(Integer year,String belongTo);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComStreetServiceImpl.java
@@ -1,19 +1,37 @@
package com.panzhihua.service_community.service.impl;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.TreeSet;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.codec.Base64;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.model.dtos.community.building.BuildingDto;
import com.panzhihua.common.model.vos.StreetVO;
import com.panzhihua.common.model.vos.area.StreetAndBuildVO;
import com.panzhihua.common.model.vos.community.bigscreen.ScreenStatics;
import com.panzhihua.common.model.vos.community.screen.event.EventPopulationSpecialStatisticsVO;
import com.panzhihua.common.model.vos.neighbor.ActivityAnalysisVO;
import com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO;
import com.panzhihua.common.model.vos.user.AdministratorsUserVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.service_community.dao.ComEventMapper;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.entity.ComEvent;
import com.panzhihua.service_community.service.ComAreaTownCommunityService;
import com.panzhihua.service_community.util.MyAESUtil;
import com.panzhihua.service_community.util.WxDataUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
@@ -28,8 +46,6 @@
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActVO;
import com.panzhihua.common.model.vos.community.ComStreetVO;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.dao.ComStreetDAO;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.ComStreetService;
@@ -51,6 +67,9 @@
    @Resource
    private ComEventMapper comEventMapper;
    @Autowired
    private CommunityService communityService;
    /**
     * 新增社区
@@ -265,4 +284,85 @@
        return R.ok(comStreetDAO.updateById(comStreetDO));
    }
    @Override
    public R panzhihuaMap(String areaCode) {
        List<ComActVO> comActVOS = comActDAO.panzhihuaMap(areaCode);
        return R.ok(comActVOS);
    }
    @Override
    public R searchStreet(BuildingDto buildingDto) {
        QueryWrapper<ComStreetDO> wrapper = new QueryWrapper<>();
        wrapper.eq(buildingDto.getAreaCode()!= null,"area_code",buildingDto.getAreaCode());
        wrapper.eq("app_id","wx118de8a734d269f0");
        List<ComStreetDO> comStreetDOS = comStreetDAO.selectList(wrapper);
//        ArrayList<ComStreetDO> collect = comStreetDOS.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(
//                Comparator.comparing(ComStreetDO::getAreaCode))), ArrayList::new));
        List<StreetVO> list = comStreetDOS.stream().map(v -> {
            StreetVO vo = new StreetVO();
            vo.setStreetId(String.valueOf(v.getStreetId()));
            vo.setName(v.getName());
            return vo;
        }).collect(Collectors.toList());
        return R.ok(list);
    }
    @Override
    public R oneTagThreeReal(Long street) {
        List<StreetAndBuildVO> streetAndBuildVOS = comActDAO.oneTagThreeReal(street);
        return R.ok(streetAndBuildVOS);
    }
    @Override
    public R getScreenStatics() {
        ScreenStatics screenStatics = comActDAO.getScreenStatics();
        WxDataUtil wxDataUtil=new WxDataUtil();
        screenStatics.setDayUser(wxDataUtil.getDayUser());
        screenStatics.setCountUser(wxDataUtil.getMonthUser());
        return R.ok(screenStatics);
    }
    @Override
    public R populationStatics(Long streetId) {
        StreetAndBuildVO vo = new StreetAndBuildVO();
        List<StreetAndBuildVO> list = comActDAO.oneTagThreeReal(streetId);
        if(list != null){
            for (StreetAndBuildVO basics : list) {
                vo.setPeopleNum(vo.getPeopleNum() + basics.getPeopleNum());
                vo.setVillageNum(vo.getVillageNum() + basics.getVillageNum());
                vo.setBuildNum(vo.getBuildNum() + basics.getBuildNum());
            }
        }
        EventPopulationSpecialStatisticsVO populationSpecial = comActDAO.getPopulationSpecial(streetId);
        if(populationSpecial != null){
            populationSpecial.setOtherTotal(populationSpecial.getZjTotal() + populationSpecial.getSfTotal()
                    + populationSpecial.getXsTotal() + populationSpecial.getXjTotal()
                    + populationSpecial.getJzTotal() + populationSpecial.getXdTotal());
            populationSpecial.setLnTotal(comActDAO.getPopulationAge(streetId,60));
            populationSpecial.setGlTotal(comActDAO.getPopulationAge(streetId,80));
            vo.setSpecialStatisticsVo(populationSpecial);
        }
        return R.ok(populationSpecial);
    }
    @Override
    public R probably(Integer year,String belongTo) {
        ActivityAnalysisVO activityVO=new ActivityAnalysisVO();
//        String beginTime=null;
//        String endTime=null;
//        if (null != year){
//            //设置开始,截止时间
//            beginTime=year.toString().concat("-01-01");
//            endTime=year.toString().concat("-12-31");
//        }
        activityVO.setUnitCount(comActDAO.arriveUnit(belongTo));
        R r = communityService.institutionalUnitServiceAnalysis(year, null, null, null, null, null, belongTo, null, null);
        Object data = r.getData();
        String jsonString = JSON.toJSONString(data);
        ActivityAnalysisVO activityAnalysisVO = JSON.parseObject(jsonString, ActivityAnalysisVO.class);
        activityVO.setUnitServiceTotalTime(activityAnalysisVO.getUnitServiceTotalTime());
        return R.ok(activityVO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActDaoMapper.xml
@@ -4,13 +4,225 @@
    <select id="oneTagThreeReal" resultType="com.panzhihua.common.model.vos.area.StreetAndBuildVO">
        select * from com_street cs left join com_act ca on cs.street_id = ca.street_id
                                    left join com_mng_village cmv on cmv.community_id = ca.community_id
                                    left join com_mng_building cmb on cmb.village_id = cmv.village_id
                                 <where>
                                     <if test="">
                                         and
                                     </if>
                                 </where>
        select ca.name name,
               (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,
               (select count(cmv.village_id) from com_mng_village cmv where cmv.community_id = ca.community_id) villageNum,
               (select count(id) from com_mng_population_house as cmph where cmph.community_id = ca.community_id) buildNum
        from com_act ca where ca.street_id = #{streetId}
    </select>
    <select id="getScreenStatics"
            resultType="com.panzhihua.common.model.vos.community.bigscreen.ScreenStatics">
        select
               (select count(user_id) from sys_user t left join com_act t1 on t.community_id = t1.community_id
                where t.type=1 and t.community_id is not null) user,
               (select count(id) from com_mng_volunteer_mng t left join com_act t1 on t.community_id = t1.community_id where  t.state = 2)  volunteer,
               (select count(*) from  com_act_micro_wish AS camw  left join com_act t1 on camw.community_id = t1.community_id
                  where camw.status = 6 ) microWish,
               (select (select count(*) from com_act_activity t left join com_act t1 on t.community_id = t1.community_id  where status !=6 and status !=1 )
               + (select count(id) from com_pb_activity t left join com_act t1 on t.community_id = t1.community_id  where status !=6 and status !=1 )) activity,
               (select count(*) from com_act_easy_photo t left join com_act t1 on t.community_id = t1.community_id  where status in (1,2,4) and del_tag = 0 ) neighbor,
               (select count(id) from com_pb_org t left join com_act t1 on t.community_id = t1.community_id where parent_id = 0) partyOrg,
               (select count(id) from com_pb_member t left join com_act t1 on t.community_id = t1.community_id where audit_result = 1) partyMember,
               (select count(*) from com_property t left join  com_act t1 on t.community_id = t1.community_id where t.is_red = 1) red,
               (select count( id ) from com_act_easy_photo t left join com_act t1 on t.community_id = t1.community_id where `status` = 5 and del_tag = 0 ) grid,
               (select count(*) from com_act_discuss t left join com_act t1 on t.community_id = t1.community_id where t.is_del =2 ) discuss,
               (select count(*) from new_fight_community_construction t left join com_act t1 on t.construction_community_id = t1.community_id) agreement,
               (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) arrivePartyMember
    </select>
    <select id="getPopulationSpecial"
            resultType="com.panzhihua.common.model.vos.community.screen.event.EventPopulationSpecialStatisticsVO">
        SELECT
        count( cmpct.id ) AS cjTotal,
        (
        SELECT
        count( cmpct1.id )
        FROM
        com_mng_population_community_tags AS cmpct1
        LEFT JOIN com_act AS ca1 ON ca1.community_id = cmpct1.community_id
        LEFT JOIN com_street AS cs1 ON cs1.street_id = ca1.street_id
        WHERE
        cmpct1.label LIKE '%低保户%' and ca1.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs1.street_id = #{streetId}
        </if>
        ) as dbTotal ,
        (
        SELECT
        count( cmpct3.id )
        FROM
        com_mng_population_community_tags AS cmpct3
        LEFT JOIN com_act AS ca3 ON ca3.community_id = cmpct3.community_id
        LEFT JOIN com_street AS cs3 ON cs3.street_id = ca3.street_id
        WHERE
        cmpct3.label LIKE '%特殊情况(重大病史/孕)%'  and ca3.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs3.street_id = #{streetId}
        </if>
        ) as tsTotal ,
        (
        SELECT
        count( cmpct4.id )
        FROM
        com_mng_population_community_tags AS cmpct4
        LEFT JOIN com_act AS ca4 ON ca4.community_id = cmpct4.community_id
        LEFT JOIN com_street AS cs4 ON cs4.street_id = ca4.street_id
        WHERE
        cmpct4.label LIKE '%特扶家庭%' and ca4.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs4.street_id = #{streetId}
        </if>
        ) as tfTotal,
        (
        SELECT
        count( cmpct5.id )
        FROM
        com_mng_population_community_tags AS cmpct5
        LEFT JOIN com_act AS ca5 ON ca5.community_id = cmpct5.community_id
        LEFT JOIN com_street AS cs5 ON cs5.street_id = ca5.street_id
        WHERE
        cmpct5.label LIKE '%退役军人%' and ca5.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs5.street_id = #{streetId}
        </if>
        ) as tyTotal,
        (
        SELECT
        count( cmpct7.id )
        FROM
        com_mng_population_community_tags AS cmpct7
        LEFT JOIN com_act AS ca7 ON ca7.community_id = cmpct7.community_id
        LEFT JOIN com_street AS cs7 ON cs7.street_id = ca7.street_id
        WHERE
        cmpct7.label LIKE '%吸毒人员%' and ca7.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs7.street_id = #{streetId}
        </if>
        ) as xdTotal,
        (
        SELECT
        count( cmpct8.id )
        FROM
        com_mng_population_community_tags AS cmpct8
        LEFT JOIN com_act AS ca8 ON ca8.community_id = cmpct8.community_id
        LEFT JOIN com_street AS cs8 ON cs8.street_id = ca8.street_id
        WHERE
        cmpct8.label LIKE '%社区矫正%' and ca8.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs8.street_id = #{streetId}
        </if>
        ) as jzTotal,
        (
        SELECT
        count( cmpct9.id )
        FROM
        com_mng_population_community_tags AS cmpct9
        LEFT JOIN com_act AS ca9 ON ca9.community_id = cmpct9.community_id
        LEFT JOIN com_street AS cs9 ON cs9.street_id = ca9.street_id
        WHERE
        cmpct9.label LIKE '%邪教人员%' and ca9.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs9.street_id = #{streetId}
        </if>
        ) as xjTotal,
        (
        SELECT
        count( cmpct10.id )
        FROM
        com_mng_population_community_tags AS cmpct10
        LEFT JOIN com_act AS ca10 ON ca10.community_id = cmpct10.community_id
        LEFT JOIN com_street AS cs10 ON cs10.street_id = ca10.street_id
        WHERE
        cmpct10.label LIKE '%刑满释放%' and ca10.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs10.street_id = #{streetId}
        </if>
        ) as xsTotal,
        (
        SELECT
        count( cmpct11.id )
        FROM
        com_mng_population_community_tags AS cmpct11
        LEFT JOIN com_act AS ca11 ON ca11.community_id = cmpct11.community_id
        LEFT JOIN com_street AS cs11 ON cs11.street_id = ca11.street_id
        WHERE
        cmpct11.label LIKE '%上访人员%'  and ca11.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs11.street_id = #{streetId}
        </if>
        ) as sfTotal,
        (
        SELECT
        count( cmpct12.id )
        FROM
        com_mng_population_community_tags AS cmpct12
        LEFT JOIN com_act AS ca12 ON ca12.community_id = cmpct12.community_id
        LEFT JOIN com_street AS cs12 ON cs12.street_id = ca12.street_id
        WHERE
        cmpct12.label LIKE '%精神障碍患者%' and ca12.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs12.street_id = #{streetId}
        </if>
        ) as zjTotal
        FROM
        com_mng_population_community_tags AS cmpct
        LEFT JOIN com_act AS ca ON ca.community_id = cmpct.community_id
        LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id
        WHERE
        cmpct.label LIKE '%残疾人%'  and ca.is_screen_statistics = 1
        <if test="streetId != null and streetId != 0">
            and cs.street_id = #{streetId}
        </if>
    </select>
    <select id="getPopulationAge" resultType="java.lang.Integer">
        select count(age) from (
        SELECT
        YEAR (now()) - YEAR (substring(cmp.card_no_str, 7, 8)) age
        FROM
        com_mng_population_community_tags AS cmpct
        LEFT JOIN com_mng_population AS cmp ON cmp.id = cmpct.population_id
        LEFT JOIN com_act AS ca ON ca.community_id = cmpct.community_id
        LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id
        <where>
            and ca.is_screen_statistics = 1
            <if test="streetId != null and streetId != 0">
                and cs.street_id = #{streetId}
            </if>
        </where>
        having age >= #{age}
        ) as ageDual
    </select>
    <select id="institutionalUnitServiceAnalysis" resultType="com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO">
        select cpcu.belong_to unitName,sum(canc.real_service_time) as serviceTime
        from com_act_neighbor_circle canc left join com_pb_check_unit cpcu on canc.solve_unit_id = cpcu.id
        <where>
            <if test="beginTime != null">
                and canc.order_time between #{beginTime} and #{endTime}
            </if>
                and cpcu.belong_to != ''
        </where>
        GROUP BY cpcu.belong_to
        SELECT  cpcu.belong_to unitName,sum(caa.duration) as serviceTime
        FROM com_act_activity as caa
        left join com_pb_check_unit as cpcu on caa.check_unit_id=cpcu.id
        <where>
            <if test="beginTime != null">
                and caa.publish_at between #{beginTime} and #{endTime}
            </if>
                and cpcu.belong_to != ''
        </where>
        GROUP BY cpcu.belong_to
    </select>
    <select id="institutionalUnitActivityAnalysis"
            resultType="com.panzhihua.common.model.vos.neighbor.UnitActivityAnalysisVO">
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml
@@ -66,6 +66,9 @@
            <if test="dto.natureName != null and dto.natureName != ''">
                and cpcu.nature_name = #{dto.natureName}
            </if>
            <if test="dto.orgName != null and dto.orgName !=''">
                and cpcu.org_name like concat('%',#{dto.orgName},'%')
            </if>
        </where>
        order by cpcu.create_at desc
    </select>