| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @title: PageBaseDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | |
| | | @ApiModelProperty(value = "字符串类型查询参数", example = "10") |
| | | private String param2; |
| | | |
| | | @ApiModelProperty(value = "社区id") |
| | | @ApiModelProperty(value = "单个社区id") |
| | | private Long communityId; |
| | | |
| | | @ApiModelProperty(value = "社区id列表") |
| | | private List<Long> communityIds; |
| | | } |
| | |
| | | |
| | | //居民活动柱状统计 |
| | | List<StatisticsCommVO> residentActHistogram = comActActivityDAO.selectResidentActHistogramData(communityId, true); |
| | | //居民活动新增数据 |
| | | List<StatisticsCommVO> actAddPolylineData = comActActivityDAO.getActAddPolylineData(communityId, true); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = actAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | actAddPolylineData.add(other); |
| | | } |
| | | } |
| | | actAddPolylineData = actAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | //居民活动发布总数 |
| | | int residentActTotalCount = 0; |
| | | if (!residentActHistogram.isEmpty()) { |
| | | residentActTotalCount = residentActHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum(); |
| | | } |
| | | statisticsVO.setResidentActTotalCount(residentActTotalCount); |
| | | statisticsVO.setResidentActHistogram(residentActHistogram); |
| | | // statisticsVO.setResidentActHistogram(residentActHistogram); |
| | | statisticsVO.setResidentActHistogram(actAddPolylineData); |
| | | //业主委员会党员占比 |
| | | List<StatisticsCommVO> committeePartyPercent = comActCommitteeDao.selectCommitteePartyPercent(communityId); |
| | | statisticsVO.setCommitteePartyPercent(committeePartyPercent); |
| | |
| | | <select id="indexActList" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT id, `status`, activity_type, activity_name, cover |
| | | FROM com_act_activity |
| | | WHERE community_id = #{pageBaseDTO.communityId} |
| | | WHERE 1=1 |
| | | <if test="pageBaseDTO.communityIds != null and pageBaseDTO.communityIds.size > 0"> |
| | | AND community_id IN |
| | | <foreach collection="pageBaseDTO.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="pageBaseDTO.communityIds == null"> |
| | | AND community_id = #{pageBaseDTO.communityId} |
| | | </if> |
| | | <if test="isResidentAct"> |
| | | AND volunteer_max = 0 |
| | | </if> |
| | |
| | | SELECT t1.id, t1.title, t1.cover, t2.`name` AS typeName |
| | | FROM com_act_dyn t1 |
| | | LEFT JOIN com_act_dyn_type t2 ON t1.type = t2.id |
| | | WHERE t1.community_id = #{pageBaseDTO.communityId} AND t1.`status` = 1 AND t2.is_del = 2 |
| | | WHERE 1=1 |
| | | <if test="pageBaseDTO.communityIds != null and pageBaseDTO.communityIds.size > 0"> |
| | | AND t1.community_id IN |
| | | <foreach collection="pageBaseDTO.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="pageBaseDTO.communityIds == null"> |
| | | AND t1.community_id = #{pageBaseDTO.communityId} |
| | | </if> |
| | | AND t1.`status` = 1 AND t2.is_del = 2 |
| | | <if test="pageBaseDTO.paramId != null"> |
| | | AND t1.type = #{pageBaseDTO.paramId} |
| | | </if> |
| | |
| | | SELECT t1.id, t1.release_content, t1.release_images, t1.comment_num, t1.fabulous_num, t2.`name` AS topicName |
| | | FROM com_act_neighbor_circle t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic t2 ON t1.topic_id = t2.id |
| | | WHERE t1.community_id = #{pageBaseDTO.communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) |
| | | WHERE 1=1 |
| | | <if test="pageBaseDTO.communityIds != null and pageBaseDTO.communityIds.size > 0"> |
| | | AND t1.community_id IN |
| | | <foreach collection="pageBaseDTO.communityIds" item="item" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="pageBaseDTO.communityIds == null"> |
| | | AND t1.community_id = #{pageBaseDTO.communityId} |
| | | </if> |
| | | AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) |
| | | <if test="pageBaseDTO.paramId != null"> |
| | | AND t1.topic_id = #{pageBaseDTO.paramId} |
| | | </if> |