张天森
2023-02-06 2e2bcc55ea6eb6fd63dae451bdd26f4b9875db40
#add 普达大屏接口
12个文件已添加
4个文件已修改
626 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/DateVO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/BasicDataVO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/CitizenInfoVO.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/DynamicVO.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/PartyDataVO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/PropertyVO.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/SpecialPeopleVO.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/YardVO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenPudaApi.java 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/PudaScreenApi.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComScreenDao.java 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ScreenWorkService.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComScreenMapper.xml 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/DateVO.java
New file
@@ -0,0 +1,19 @@
package com.panzhihua.common.model.vos;
import lombok.Data;
/**
 * @author Tuzi
 * @date 2023年02月03日 17:55
 */
@Data
public class DateVO {
    private String now;
    private String offset16;
    private String offset27;
    private String offset35;
    private String offset45;
    private String offset55;
    private Long communityId;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/BasicDataVO.java
New file
@@ -0,0 +1,22 @@
package com.panzhihua.common.model.vos.puda;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author Tuzi
 * @date 2023年02月03日 14:11
 */
@Data
@ApiModel("基础数据")
public class BasicDataVO {
    @ApiModelProperty("小区建筑")
    private Integer village;
    @ApiModelProperty("居民人数")
    private Integer people;
    @ApiModelProperty("房屋总数")
    private Integer buildings;
    @ApiModelProperty("单位总数")
    private Integer unit;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/CitizenInfoVO.java
New file
@@ -0,0 +1,39 @@
package com.panzhihua.common.model.vos.puda;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
 * @author Tuzi
 * @date 2023年02月03日 13:52
 */
@ApiModel("居民信息")
@Data
public class CitizenInfoVO {
    @ApiModelProperty("男性数量")
    private Integer maleNum;
    @ApiModelProperty("女性数量")
    private Integer femaleNum;
    @ApiModelProperty("0-16数量")
    private Integer count1;
    @ApiModelProperty("16-27")
    private Integer count2;
    @ApiModelProperty("27-35")
    private Integer count3;
    @ApiModelProperty("35-45")
    private Integer count4;
    @ApiModelProperty("45-55")
    private Integer count5;
    @ApiModelProperty("55以上")
    private Integer count6;
    @ApiModelProperty("男性占比")
    private BigDecimal maleRate;
    @ApiModelProperty("女性占比")
    private BigDecimal femaleRate;
    @ApiModelProperty("总人口")
    private Integer total;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/DynamicVO.java
New file
@@ -0,0 +1,26 @@
package com.panzhihua.common.model.vos.puda;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author Tuzi
 * @date 2023年02月03日 13:44
 */
@ApiModel("自治动态")
@Data
public class DynamicVO {
    @ApiModelProperty("微心愿")
    private Integer microWish;
    @ApiModelProperty("随手拍")
    private Integer easyPhoto;
    @ApiModelProperty("通知公告")
    private Integer announcement;
    @ApiModelProperty("社区咨询")
    private Integer communityInfo;
    @ApiModelProperty("问题清单")
    private Integer questions;
    @ApiModelProperty("需求清单")
    private Integer demands;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/PartyDataVO.java
New file
@@ -0,0 +1,22 @@
package com.panzhihua.common.model.vos.puda;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author Tuzi
 * @date 2023年02月03日 13:48
 */
@ApiModel("党建数据")
@Data
public class PartyDataVO {
    @ApiModelProperty("社区两委")
    private Integer committee;
    @ApiModelProperty("报到单位")
    private Integer unit;
    @ApiModelProperty("报到党员")
    private Integer partyMembers;
    @ApiModelProperty("党建活动")
    private Integer partyActivity;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/PropertyVO.java
New file
@@ -0,0 +1,18 @@
package com.panzhihua.common.model.vos.puda;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author Tuzi
 * @date 2023年02月03日 13:47
 */
@ApiModel("红色物业")
@Data
public class PropertyVO {
    @ApiModelProperty("物业公司名称")
    private String propertyName;
    @ApiModelProperty("党员数量")
    private Integer partyMembers;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/SpecialPeopleVO.java
New file
@@ -0,0 +1,25 @@
package com.panzhihua.common.model.vos.puda;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
 * @author Tuzi
 * @date 2023年02月03日 14:13
 */
@Data
@ApiModel("特殊人口统计")
public class SpecialPeopleVO {
    @ApiModelProperty("标签")
    private String label;
    @ApiModelProperty("人数")
    private Integer count;
    @ApiModelProperty("特殊人群占比")
    private BigDecimal rate;
    private Integer total;
    private List<SpecialPeopleVO> childList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/puda/YardVO.java
New file
@@ -0,0 +1,19 @@
package com.panzhihua.common.model.vos.puda;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author Tuzi
 * @date 2023年02月03日 14:03
 */
@Data
@ApiModel("小区院落'")
public class YardVO {
    @ApiModelProperty("院落总数")
    private Integer count;
    @ApiModelProperty("城镇院落")
    private Integer cityYard;
    @ApiModelProperty("农村院落")
    private Integer countryYard;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -11171,4 +11171,48 @@
    R findPointNumByDistance(@RequestParam("distance") Integer distance, @RequestParam("lat") String lat, @RequestParam("lng") String lng);
    /**
     * 普达大屏-自治动态
     * */
    @GetMapping("/pudaScreen/autonomyDynamic")
    R autonomyDynamic();
    /**
     * 普达大屏-红色物业
     * */
    @GetMapping("/pudaScreen/propertyDynamic")
    R propertyDynamic();
    /**
     * 普达大屏-党建数据
     **/
    @GetMapping("/pudaScreen/partyData")
    R partyData();
    /**
     *
     * 普达大屏-居民信息
     * */
    @GetMapping("/pudaScreen/peopleInfo")
    R peopleInfo();
    /**
     * 普达大屏-小区院落
     * */
    @GetMapping("/pudaScreen/countryard")
    R countryard();
    /**
     * 普达大屏-基础数据
     * */
    @GetMapping("/pudaScreen/basicData")
    R basicData();
    /**
     * 普达大屏-特殊人群
     * */
    @GetMapping("/pudaScreen/specialPeople")
    R specialPeople();
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ScreenPudaApi.java
New file
@@ -0,0 +1,70 @@
package com.panzhihua.community_backstage.api;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.puda.*;
import com.panzhihua.common.service.community.CommunityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
 * @author Tuzi
 * @date 2023年02月03日 10:22
 */
@Slf4j
@RestController
@RequestMapping("/pudaScreen")
@Api(tags = "普达大屏接口")
public class ScreenPudaApi extends BaseController {
    @Resource
    private CommunityService communityService;
    @ApiOperation(value = "自治动态",response = DynamicVO.class)
    @GetMapping("/autonomyDynamic")
    public R autonomyDynamic(){
        return communityService.autonomyDynamic();
    }
    @ApiOperation(value = "红色物业",response = PropertyVO.class)
    @GetMapping("/propertyDynamic")
    public R propertyDynamic(){
        return communityService.propertyDynamic();
    }
    @ApiOperation(value = "党建数据",response = PartyDataVO.class)
    @GetMapping("/partyData")
    public R partyData(){
        return communityService.partyData();
    }
    @ApiOperation(value = "党建数据",response = CitizenInfoVO.class)
    @GetMapping("/peopleInfo")
    public R peopleInfo(){
        return communityService.peopleInfo();
    }
    @ApiOperation(value = "小区院落",response = YardVO.class)
    @GetMapping("/countryard")
    public R countryard(){
        return communityService.countryard();
    }
    @ApiOperation(value = "基础数据",response = BasicDataVO.class)
    @GetMapping("/basicData")
    public R basicData(){
        return communityService.basicData();
    }
    @ApiOperation(value = "基础数据",response = SpecialPeopleVO.class)
    @GetMapping("/specialPeople")
    public R specialPeople(){
        return communityService.specialPeople();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/PudaScreenApi.java
New file
@@ -0,0 +1,56 @@
package com.panzhihua.service_community.api;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.service.ScreenWorkService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
 * @author Tuzi
 * @date 2023年02月03日 11:12
 */
@RestController
@RequestMapping("/pudaScreen")
public class PudaScreenApi {
    @Resource
    private ScreenWorkService screenWorkService;
    @GetMapping("/autonomyDynamic")
    public R autonomyDynamic(){
        return screenWorkService.autonomyDynamic(10172L);
    }
    @GetMapping("/propertyDynamic")
    public R propertyDynamic(){
        return  screenWorkService.property(10172L);
    }
    @GetMapping("/partyData")
    public R partyData(){
        return screenWorkService.partyData(10172L);
    }
    @GetMapping("/peopleInfo")
    public R peopleInf(){
        return screenWorkService.citizenInfo(10172L);
    }
    @GetMapping("/countryard")
    public R countryard(){
        return screenWorkService.yard(10172L);
    }
    @GetMapping("/basicData")
    public R basicData(){
        return screenWorkService.basicData(10172L);
    }
    @GetMapping("/specialPeople")
    public R specialPeople(){
        return screenWorkService.specialPeople(10172L);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -5,6 +5,7 @@
import com.panzhihua.common.model.vos.community.ComActPasswordVo;
import com.panzhihua.common.model.vos.community.DataCount;
import com.panzhihua.common.model.vos.partybuilding.ComPbMemberTypeVO;
import com.panzhihua.common.model.vos.puda.DynamicVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComScreenDao.java
New file
@@ -0,0 +1,54 @@
package com.panzhihua.service_community.dao;
import com.panzhihua.common.model.vos.DateVO;
import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo;
import com.panzhihua.common.model.vos.puda.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ComScreenDao {
    /**
     * 自治动态统计
     * @return 处理结果
     * */
    DynamicVO autonomyDynamic(Long communityId);
    /**
     * 红色物业
     * @return 处理结果
     * */
    PropertyVO propertyData(Long community);
    /**
     * 党建数据
     * @return 处理结果
     * */
    PartyDataVO partyData(Long communityId);
    /**
     * 小区院落
     * @return 处理结果
     * */
    YardVO yard(Long communityId);
    /**
     * 基础数据
     * @return 处理结果
     * */
    BasicDataVO basicData(Long communityId);
    CitizenInfoVO ageRange(@Param("vo") DateVO vo);
    /**
     * 特殊人群统计
     * @return
     * */
    List<SpecialPeopleVO> specialPeople(Long communityId);
    PageBuildingListAdminVo peopleInfoAdmin(Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ScreenWorkService.java
@@ -65,4 +65,39 @@
    R workCount(Long communityId);
    R dynamicWork(Long communityId);
    /**
     * 自治动态
     * */
    R autonomyDynamic(Long communityId);
    /**
     * 红色物业
     * */
    R property(Long communityId);
    /**
     * 党建数据
     * */
    R partyData(Long communityId);
    /**
     * 小区院落
     * */
    R yard(Long communityId);
    /**
     *居民信息
     * */
    R citizenInfo(Long communityId);
    /**
     * 特殊人群信息
     * */
    R specialPeople(Long communityId);
    /**
     * 基础数据
     * */
    R basicData(Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ScreenWorkServiceImpl.java
@@ -6,6 +6,16 @@
import javax.annotation.Resource;
import cn.hutool.core.util.NumberUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.model.vos.DateVO;
import com.panzhihua.common.model.vos.community.building.admin.BuildingListHeaderStatisticsAdminVo;
import com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo;
import com.panzhihua.common.model.vos.puda.BasicDataVO;
import com.panzhihua.common.model.vos.puda.CitizenInfoVO;
import com.panzhihua.common.model.vos.puda.DynamicVO;
import com.panzhihua.common.model.vos.puda.SpecialPeopleVO;
import com.panzhihua.common.service.community.CommunityService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -47,6 +57,10 @@
    private ComPbDynDAO comPbDynDAO;
    @Resource
    private ComActEasyPhotoDAO comActEasyPhotoDAO;
    @Resource
    private ComScreenDao comScreenDao;
    @Resource
    private CommunityService communityService;
    @Override
    public R statisticNeighborCircle(Long communityId) {
@@ -317,6 +331,78 @@
        return R.ok(workScreenVO);
    }
    @Override
    public R autonomyDynamic(Long communityId) {
        DynamicVO dynamicVO =comScreenDao.autonomyDynamic(communityId);
        return R.ok(dynamicVO);
    }
    @Override
    public R property(Long communityId) {
        return R.ok(comScreenDao.propertyData(communityId));
    }
    @Override
    public R partyData(Long communityId) {
        return R.ok(comScreenDao.partyData(communityId));
    }
    @Override
    public R yard(Long communityId) {
        return R.ok(comScreenDao.yard(communityId));
    }
    @Override
    public R citizenInfo(Long communityId) {
        DateVO vo=new DateVO();
        //当前日期
        vo.setNow(DateUtil.now());
        //16年前
        vo.setOffset16(DateUtil.offsetMonth(DateUtil.date(), -192).toDateStr());
        //27年前
        vo.setOffset27(DateUtil.offsetMonth(DateUtil.date(), -324).toDateStr());
        //35年前
        vo.setOffset35(DateUtil.offsetMonth(DateUtil.date(), -420).toDateStr());
        //45年前
        vo.setOffset45(DateUtil.offsetMonth(DateUtil.date(), -540).toDateStr());
        //55年前
        vo.setOffset55(DateUtil.offsetMonth(DateUtil.date(), -660).toDateStr());
        CitizenInfoVO citizenInfoVO = comScreenDao.ageRange(vo);
        citizenInfoVO.setTotal(comScreenDao.peopleInfoAdmin(communityId).getPopulationNum());
        citizenInfoVO.setMaleRate(NumberUtil.div(citizenInfoVO.getMaleNum(), citizenInfoVO.getTotal(), 2));
        citizenInfoVO.setFemaleRate(NumberUtil.div(citizenInfoVO.getFemaleNum(), citizenInfoVO.getTotal(), 2));
        //男性占比
        return R.ok(citizenInfoVO);
    }
    @Override
    public R specialPeople(Long communityId) {
        SpecialPeopleVO vo=new SpecialPeopleVO();
        vo.setTotal(0);
        List<SpecialPeopleVO> specialPeopleVOS = comScreenDao.specialPeople(communityId);
        //求和
        for (SpecialPeopleVO specialPeopleVO : specialPeopleVOS) {
            vo.setTotal(vo.getTotal()+specialPeopleVO.getCount());
        }
        //计算占比
        for (SpecialPeopleVO specialPeopleVO : specialPeopleVOS) {
            specialPeopleVO.setRate(NumberUtil.div(specialPeopleVO.getCount(),vo.getTotal() ,2 ));
        }
        vo.setChildList(specialPeopleVOS);
        return R.ok(vo);
    }
    @Override
    public R basicData(Long communityId) {
        //PageBuildingListAdminVo pageBuildingListAdminVo = comScreenDao.peopleInfoAdmin(communityId);
        R r = communityService.buildingListHeaderStatisticsAdmin(communityId);
        BuildingListHeaderStatisticsAdminVo buildingListHeaderStatisticsAdminVo = (BuildingListHeaderStatisticsAdminVo)r.getData();
        BasicDataVO vo=new BasicDataVO();
        vo.setPeople(buildingListHeaderStatisticsAdminVo.getPopulationNum());
        vo.setBuildings(buildingListHeaderStatisticsAdminVo.getBuildNum());
        return R.ok(vo);
    }
    private List<DynamicWorkVO> listHalfYearByDyn() {
        List<DynamicWorkVO> dateList = new ArrayList<>();
        Date now = new Date();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComScreenMapper.xml
New file
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.panzhihua.service_community.dao.ComScreenDao">
    <select id="autonomyDynamic" resultType="com.panzhihua.common.model.vos.puda.DynamicVO">
        select community_id,
        (select count(id) from com_act_micro_wish where status=6 and  community_id=#{communityId}) as microWish,
        (select count(id) from com_act_easy_photo where del_tag=0 and status=5 and  community_id=#{communityId}) as easyPhoto,
        (select count(id) from com_act_announcement where community_id=#{communityId}) as announcement,
        (select count(id) from com_act_activity where community_id=#{communityId}) as communityInfo,
        (select count(id) from com_act_neighbor_circle  where is_del=2 and belong_type=2 and solve_status in (3,4) and community_id=#{communityId}) as questions,
        (select count(id) from com_act_neighbor_circle  where is_del=2 and belong_type=3 and solve_status in (3,4) and community_id=#{communityId}) as demands
        from
        com_act
        where community_id=#{communityId}
    </select>
    <select id="propertyData" resultType="com.panzhihua.common.model.vos.puda.PropertyVO">
         select cp.name as propertyName,
        (select count(cpm.id) from com_pb_member as cpm where cpm.community_id=#{communityId} and cpm.check_unit_id=cp.id) as partyMembers
        from com_property as cp
        where cp.community_id=#{communityId}
    </select>
    <select id="partyData" resultType="com.panzhihua.common.model.vos.puda.PartyDataVO">
        select id,
        (select count(id) from com_sanshuo_expert where community_id=#{communityId}) as commitee,
        (select count(id) from com_pb_check_unit where community_id=#{communityId}) as unit,
        (select count(id) from com_pb_member where community_id=#{communityId}) as partyMembers,
        (select count(id) from com_pb_dyn where community_id=#{communityId}) as partyActivity
        from com_pb_member where community_id=#{communityId}
        limit 1
    </select>
    <select id="yard" resultType="com.panzhihua.common.model.vos.puda.YardVO">
        select
        (select count(community_id) from com_mng_village where community_id=#{communityId}) as count,
        (select count(community_id) from com_mng_village where community_id=#{communityId} and type=1) as cityYard,
        (select count(community_id) from com_mng_village where community_id=#{communityId} and type=2) as countryYard,
        from com_mng_village limit 1
    </select>
    <select id="basicData" resultType="com.panzhihua.common.model.vos.puda.BasicDataVO">
        SELECT count( id ) AS buildings,
        ( SELECT count( id ) FROM com_mng_population_community_tags WHERE community_id = cmb.act_id ) AS people,
        ( SELECT count( id ) FROM com_pb_check_unit WHERE community_id = cmb.act_id ) AS people
        FROM
            com_mng_building AS cmb
        WHERE
            cmb.act_id = #{communityId}
    </select>
    <select id="ageRange" resultType="com.panzhihua.common.model.vos.puda.CitizenInfoVO">
        SELECT count(act_id) as total,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and sex='1') AS maleNum,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and sex='2') AS femaleNum,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset16} and #{vo.now} ) AS count1,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset27} and #{vo.offset16}) AS count2,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset35} and #{vo.offset27}) AS count3,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset45} and #{vo.offset35}) AS count4,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday BETWEEN #{vo.offset55} and #{vo.offset45}) AS count5,
        (SELECT count(act_id) FROM com_mng_population WHERE  act_id=#{vo.communityId} and birthday &lt; #{vo.offset55}) AS count6,
        FROM com_mng_population
        WHERE act_id=#{vo.communityId}
    </select>
    <select id="specialPeople" resultType="com.panzhihua.common.model.vos.puda.SpecialPeopleVO">
        select count(id) as count,label from com_mng_population_community_tags
        where community_id=#{communityId}
        GROUP BY label
        having label &lt;> ''
    </select>
    <select id="peopleInfoAdmin"
            resultType="com.panzhihua.common.model.vos.community.building.admin.PageBuildingListAdminVo">
        cmb.id,
        cmv.village_id,
        cmv.alley,
        cmb.`name`,
        cmv.`name` AS villageName,
        cmv.house_num as doorNum,
        (select count(distinct unit_no) from com_mng_population_house where village_id = cmb.village_id AND floor = cmb.`name`) as unit_total,
        (select max(CAST(house_no as SIGNED)) from com_mng_population_house where village_id = cmb.village_id AND floor = cmb.`name` AND `unit_no` is not null and house_no is not null) as buildFloorSum,
        (select count(id) from com_mng_population_house where village_id = cmb.village_id and floor = cmb.`name` ) as houseNum,
        (select count(id) from com_mng_population where village_id = cmb.village_id and floor = cmb.`name`) as populationNum
        FROM
        com_mng_building AS cmb
        inner JOIN com_mng_village AS cmv ON cmv.village_id = cmb.village_id
        <where>
            <if test="communityId != null">
                and cmb.act_id = #{pageBuildingListDto.communityId}
            </if>
        </where>
        order by cmb.id desc
    </select>
</mapper>