| | |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | List<ComActEasyPhotoVO> selectStatisticsList(@Param("communityId") Long communityId); |
| | | List<StatisticsCommVO> selectStatisticsList(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 获取居民自治统计数据 |
| | |
| | | if (isNull(statisticsVO)) { |
| | | statisticsVO = new ResidentAutonomyStatisticsVO(); |
| | | } |
| | | List<ComActEasyPhotoVO> easyPhotoVOList = comActEasyPhotoDAO.selectStatisticsList(communityId); |
| | | List<StatisticsCommVO> easyPhotoHistogram = comActEasyPhotoDAO.selectStatisticsList(communityId); |
| | | //随手拍总数 |
| | | Integer easyPhotoTotalCount = 0; |
| | | //随手拍柱状统计 |
| | | List<StatisticsCommVO> easyPhotoHistogram = new ArrayList<>(); |
| | | if (Objects.nonNull(easyPhotoVOList) && !easyPhotoVOList.isEmpty()) { |
| | | Map<String, List<ComActEasyPhotoVO>> easyPhotoVOMap = easyPhotoVOList.stream().collect(Collectors.groupingBy(ComActEasyPhotoVO::getClassifyName)); |
| | | for (Map.Entry<String, List<ComActEasyPhotoVO>> entry : easyPhotoVOMap.entrySet()) { |
| | | StatisticsCommVO commVO = new StatisticsCommVO(); |
| | | commVO.setFiled(entry.getKey()); |
| | | commVO.setNum(entry.getValue().size()); |
| | | easyPhotoHistogram.add(commVO); |
| | | } |
| | | easyPhotoTotalCount = easyPhotoVOList.size(); |
| | | if (Objects.nonNull(easyPhotoHistogram) && !easyPhotoHistogram.isEmpty()) { |
| | | easyPhotoTotalCount = easyPhotoHistogram.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum(); |
| | | } |
| | | statisticsVO.setEasyPhotoTotalCount(easyPhotoTotalCount); |
| | | statisticsVO.setEasyPhotoHistogram(easyPhotoHistogram); |
| | |
| | | statisticsVO.setNeighborContents(neighborContents); |
| | | |
| | | //报事报修新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> repairAddPolylineData = comPropertyDao.getRepairPolylineDate(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = repairAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | repairAddPolylineData.add(other); |
| | | } |
| | | } |
| | | repairAddPolylineData = repairAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsVO.setRepairAddPolylineData(repairAddPolylineData); |
| | | //报事报修累计折线数据 |
| | | List<StatisticsCommVO> repairTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | repairAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comPropertyDao.getRepairTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = comPropertyDao.getRepairTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | repairTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | 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(actAddPolylineData); |
| | | //业主委员会党员占比 |
| | | List<StatisticsCommVO> committeePartyPercent = comActCommitteeDao.selectCommitteePartyPercent(communityId); |
| | |
| | | } |
| | | statisticsVO.setVillageStatisticsList(villageStatisticsList); |
| | | //事件分析新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> eventAddPolylineData = comPropertyDao.getEventAddPolylineData(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = eventAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | eventAddPolylineData.add(other); |
| | | } |
| | | } |
| | | eventAddPolylineData = eventAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsVO.setEventAddPolylineData(eventAddPolylineData); |
| | | //事件分析累计折线数据 |
| | | List<StatisticsCommVO> eventTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | eventAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comPropertyDao.getEventTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = comPropertyDao.getEventTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | eventTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | //微心愿新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> microWishAddPolylineData = comActMicroWishDAO.getMicroWishAddPolylineData(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = microWishAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | microWishAddPolylineData.add(other); |
| | | } |
| | | } |
| | | microWishAddPolylineData = microWishAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsInfo.setMicroWishAddPolylineData(microWishAddPolylineData); |
| | | //微心愿累计折线数据 |
| | | List<StatisticsCommVO> microWishTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | microWishAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActMicroWishDAO.getMicroWishTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = comActMicroWishDAO.getMicroWishTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | microWishTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | //随手拍新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> easyPhotoAddPolylineData = comActEasyPhotoDAO.getEasyPhotoAddPolylineData(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = easyPhotoAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | easyPhotoAddPolylineData.add(other); |
| | | } |
| | | } |
| | | easyPhotoAddPolylineData = easyPhotoAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsInfo.setEasyPhotoAddPolylineData(easyPhotoAddPolylineData); |
| | | //随手拍累计折线数据 |
| | | List<StatisticsCommVO> easyPhotoTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | easyPhotoAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActEasyPhotoDAO.getEasyPhotoTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = comActEasyPhotoDAO.getEasyPhotoTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | easyPhotoTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | public R indexQuestionnaire(Long communityId) { |
| | | BigScreenQuestionnaireStatisticsInfo statisticsInfo = comActQuestnaireDAO.getIndexQuestionnaireBaseData(communityId); |
| | | //社区问卷新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> questionnaireAddPolylineData = comActQuestnaireDAO.getQuestionnaireAddPolylineData(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = questionnaireAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | questionnaireAddPolylineData.add(other); |
| | | } |
| | | } |
| | | questionnaireAddPolylineData = questionnaireAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsInfo.setQuestionnaireAddPolylineData(questionnaireAddPolylineData); |
| | | //社区问卷累计折线数据 |
| | | List<StatisticsCommVO> questionnaireTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | questionnaireAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActQuestnaireDAO.getQuestionnaireTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = comActQuestnaireDAO.getQuestionnaireTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | questionnaireTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | statisticsInfo.setDynNum(dynCircleData.stream().map(StatisticsCommVO::getNum).mapToInt(Integer::intValue).sum()); |
| | | } |
| | | //社区动态新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> dynAddPolylineData = comActDynDAO.getDynAddPolylineData(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = dynAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | dynAddPolylineData.add(other); |
| | | } |
| | | } |
| | | dynAddPolylineData = dynAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsInfo.setDynAddPolylineData(dynAddPolylineData); |
| | | //社区动态累计折线数据 |
| | | List<StatisticsCommVO> dynTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | dynAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActDynDAO.getDynTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = comActDynDAO.getDynTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | dynTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | statisticsInfo.setPublishTopicNum(neighborCircleData.stream().filter(e -> !"无话题".equals(e.getFiled())).collect(Collectors.toList()).size()); |
| | | } |
| | | //邻里圈新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> neighborAddPolylineData = comActNeighborCircleDAO.getNeighborAddPolylineData(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = neighborAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | neighborAddPolylineData.add(other); |
| | | } |
| | | } |
| | | neighborAddPolylineData = neighborAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsInfo.setNeighborAddPolylineData(neighborAddPolylineData); |
| | | //邻里圈累计折线数据 |
| | | List<StatisticsCommVO> neighborTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | neighborAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActNeighborCircleDAO.getNeighborTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = comActNeighborCircleDAO.getNeighborTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | neighborTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | statisticsInfo.setServiceTypeNum(serviceTypeCircleData.size()); |
| | | } |
| | | //服务次数(目前暂时使用浏览量)新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> serviceTimesAddPolylineData = convenientMerchantDAO.getServiceTimesAddPolylineData(communityId); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | for (int i = 1; i <= currentMon; i++) { |
| | | String temp; |
| | | if (i > 9) { |
| | | temp = "" + i; |
| | | } else { |
| | | temp = "0" + i; |
| | | } |
| | | boolean isExist = serviceTimesAddPolylineData.stream().anyMatch(e -> nonNull(e.getFiled()) && |
| | | e.getFiled().endsWith(temp)); |
| | | if (!isExist) { |
| | | StatisticsCommVO other = new StatisticsCommVO(); |
| | | other.setFiled(temp); |
| | | other.setNum(0); |
| | | serviceTimesAddPolylineData.add(other); |
| | | } |
| | | } |
| | | serviceTimesAddPolylineData = serviceTimesAddPolylineData.stream().filter(e -> nonNull(e.getFiled())) |
| | | .sorted(Comparator.comparing(e -> e.getFiled())).collect(Collectors.toList()); |
| | | statisticsInfo.setServiceTimesAddPolylineData(serviceTimesAddPolylineData); |
| | | //服务次数(目前暂时使用浏览量)累计折线数据 |
| | | List<StatisticsCommVO> serviceTimesTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | serviceTimesAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = convenientMerchantDAO.getServiceTimesTotalPolylineDate(communityId, year + e.getFiled()); |
| | | StatisticsCommVO temp = convenientMerchantDAO.getServiceTimesTotalPolylineDate(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | serviceTimesTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | } |
| | | statisticsInfo.setPublishNum(publishNum); |
| | | //居民活动新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> actAddPolylineData = comActActivityDAO.getActAddPolylineData(communityId, true); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | 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()); |
| | | statisticsInfo.setActAddPolylineData(actAddPolylineData); |
| | | //居民活动累计折线数据 |
| | | List<StatisticsCommVO> actTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | actAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, true, year + e.getFiled()); |
| | | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, true, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | actTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | } |
| | | statisticsInfo.setPublishNum(publishNum); |
| | | //志愿者活动新增折线数据 |
| | | Date nowDate = new Date(); |
| | | List<StatisticsCommVO> actAddPolylineData = comActActivityDAO.getActAddPolylineData(communityId, false); |
| | | int currentMon = Integer.parseInt(new SimpleDateFormat("MM").format(nowDate)); |
| | | 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()); |
| | | statisticsInfo.setActAddPolylineData(actAddPolylineData); |
| | | //志愿者活动累计折线数据 |
| | | List<StatisticsCommVO> actTotalPolylineData = new ArrayList<>(); |
| | | String year = new SimpleDateFormat("yyyy").format(nowDate); |
| | | actAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, false, year + e.getFiled()); |
| | | StatisticsCommVO temp = comActActivityDAO.getActTotalPolylineData(communityId, false, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | actTotalPolylineData.add(temp); |
| | | }); |
| | |
| | | ) temp2 |
| | | </select> |
| | | <select id="getActAddPolylineData" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( publish_at, '%m' ) AS filed, COUNT(id) AS num |
| | | FROM com_act_activity |
| | | WHERE community_id = ${communityId} |
| | | <if test="isResidentAct"> |
| | | AND volunteer_max = 0 |
| | | </if> |
| | | <if test="!isResidentAct"> |
| | | AND volunteer_max != 0 |
| | | </if> |
| | | AND DATE_FORMAT( publish_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( publish_at, '%Y-%m' ) AS filed, COUNT(id) AS num |
| | | FROM com_act_activity |
| | | WHERE community_id = ${communityId} |
| | | <if test="isResidentAct"> |
| | | AND volunteer_max = 0 |
| | | </if> |
| | | <if test="!isResidentAct"> |
| | | AND volunteer_max != 0 |
| | | </if> |
| | | AND AND DATE_FORMAT( publish_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getActTotalPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | |
| | | <if test="!isResidentAct"> |
| | | AND volunteer_max != 0 |
| | | </if> |
| | | AND DATE_FORMAT( publish_at, '%Y%m' ) <= #{date} |
| | | AND DATE_FORMAT( publish_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="indexActList" resultType="com.panzhihua.common.model.vos.community.ComActActivityVO"> |
| | | SELECT id, `status`, activity_type, activity_name, cover |
| | |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` = 1) temp2 |
| | | </select> |
| | | <select id="getDynAddPolylineData" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( create_at, '%m' ) AS filed, COUNT(id) AS num |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num |
| | | FROM com_act_dyn |
| | | WHERE community_id = ${communityId} AND `status` = 1 |
| | | AND DATE_FORMAT( create_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | AND DATE_FORMAT( create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getDynTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(id) AS num FROM com_act_dyn |
| | | WHERE community_id = ${communityId} AND `status` = 1 AND DATE_FORMAT( create_at, '%Y%m' ) <= #{date} |
| | | WHERE community_id = ${communityId} AND `status` = 1 AND DATE_FORMAT( create_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="indexDynList" resultType="com.panzhihua.common.model.vos.community.ComActDynVO"> |
| | | SELECT t1.id, t1.title, t1.cover, t2.`name` AS typeName |
| | |
| | | select id,logo as cover,release_at as show_time,7 as type,"" as jump_url,"" as jump_type from com_act_easy_photo_activity where status =2 and community_id = ${communityId} |
| | | order by show_time desc limit 30 |
| | | </select> |
| | | <select id="selectStatisticsList" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO"> |
| | | SELECT t1.id, IF(`name` IS NULL,'其他',`name`) AS classifyName |
| | | FROM com_act_easy_photo t1 |
| | | LEFT JOIN com_act_easy_photo_classify t2 ON t1.classify_id = t2.id |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (1,2,4) AND del_tag = 0 |
| | | <select id="selectStatisticsList" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT t1.`name` AS filed, COUNT(t2.id) AS num |
| | | FROM com_act_easy_photo_classify t1 |
| | | LEFT JOIN (SELECT * FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) AND del_tag = 0) t2 ON t1.id = t2.classify_id |
| | | WHERE t1.`status` = 1 GROUP BY filed |
| | | </select> |
| | | <select id="selectResidentAutonomyStatistics" |
| | | resultType="com.panzhihua.common.model.vos.community.bigscreen.ResidentAutonomyStatisticsVO"> |
| | |
| | | </select> |
| | | <select id="getEasyPhotoAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( create_at, '%m' ) AS filed, COUNT(id) AS num |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num |
| | | FROM com_act_easy_photo |
| | | WHERE community_id = ${communityId} AND del_tag = 0 |
| | | AND DATE_FORMAT( create_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | AND DATE_FORMAT( create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getEasyPhotoTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(id) AS num FROM com_act_easy_photo |
| | | WHERE community_id = ${communityId} AND del_tag = 0 |
| | | AND DATE_FORMAT( create_at, '%Y%m' ) <= #{date} |
| | | AND DATE_FORMAT( create_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="indexEasyPhotoList" resultType="com.panzhihua.common.model.vos.community.ComActEasyPhotoVO"> |
| | | SELECT t1.id, t1.detail, t1.photo_path_list, t1.`status`, t2.`name` AS classifyName |
| | |
| | | </select> |
| | | <select id="getMicroWishAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( create_at, '%m' ) AS filed, COUNT(id) AS num FROM com_act_micro_wish |
| | | WHERE community_id = ${communityId} AND `status` NOT IN(1,4) AND DATE_FORMAT( create_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num FROM com_act_micro_wish |
| | | WHERE community_id = ${communityId} AND `status` NOT IN(1,4) AND DATE_FORMAT( create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getMicroWishTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(id) AS num FROM com_act_micro_wish |
| | | WHERE community_id = ${communityId} AND `status` NOT IN(1,4) AND DATE_FORMAT( create_at, '%Y%m' ) <= #{date} |
| | | WHERE community_id = ${communityId} AND `status` NOT IN(1,4) AND DATE_FORMAT( create_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="selectScreenDisplayList" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActMicroWishVO"> |
| | |
| | | </select> |
| | | <select id="getNeighborAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( t1.create_at, '%m' ) AS filed, COUNT(t1.id) AS num |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( t1.create_at, '%Y-%m' ) AS filed, COUNT(t1.id) AS num |
| | | FROM com_act_neighbor_circle t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic t2 ON t1.topic_id = t2.id |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) |
| | | AND DATE_FORMAT( t1.create_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | AND DATE_FORMAT( t1.create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getNeighborTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(t1.id) AS num FROM com_act_neighbor_circle t1 |
| | | LEFT JOIN com_act_neighbor_circle_topic t2 ON t1.topic_id = t2.id |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) AND DATE_FORMAT( t1.create_at, '%Y%m' ) <= #{date} |
| | | WHERE t1.community_id = ${communityId} AND t1.`status` IN (2,3) AND t1.is_del = 2 AND (t2.`status` = 1 OR t2.id IS NULL) AND DATE_FORMAT( t1.create_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="indexNeighborList" |
| | | resultType="com.panzhihua.common.model.vos.neighbor.ComActNeighborCircleAdminVO"> |
| | |
| | | </select> |
| | | <select id="getQuestionnaireAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( create_at, '%m' ) AS filed, COUNT(id) AS num |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num |
| | | FROM com_act_questnaire |
| | | WHERE community_id = ${communityId} AND state IN (2,3) |
| | | AND DATE_FORMAT( create_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | AND DATE_FORMAT( create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getQuestionnaireTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(id) AS num FROM com_act_questnaire |
| | | WHERE community_id = ${communityId} AND state IN (2,3) AND DATE_FORMAT( create_at, '%Y%m' ) <= #{date} |
| | | WHERE community_id = ${communityId} AND state IN (2,3) AND DATE_FORMAT( create_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="selectQuestionnaireDisplayList" |
| | | resultType="com.panzhihua.common.model.vos.community.ComActQuestnaireVO"> |
| | |
| | | WHEN classify_id = 1 THEN 10 |
| | | END type, IFNULL( NULL, 2 ) AS eventType, id AS eventId, lng_lat AS latLng, detail AS content, substring_index(photo_path_list, ',', 1) AS cover, create_at, |
| | | CASE |
| | | WHEN handle_status = 2 THEN 1 |
| | | WHEN `status` = 4 THEN 1 |
| | | ELSE 2 END `status` |
| | | FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) |
| | | AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) AND TO_DAYS(NOW()) - TO_DAYS(create_at) <= 30 |
| | |
| | | WHEN classify_id = 1 THEN 10 |
| | | END type, IFNULL( NULL, 2 ) AS eventType, id AS eventId, lng_lat AS latLng, detail AS content, substring_index(photo_path_list, ',', 1) AS cover, create_at, |
| | | CASE |
| | | WHEN handle_status = 2 THEN 1 |
| | | WHEN `status` = 4 THEN 1 |
| | | ELSE 2 END `status` |
| | | FROM com_act_easy_photo WHERE community_id = ${pageBaseDTO.communityId} AND `status` IN (1,2,4) |
| | | AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) |
| | | <if test="pageBaseDTO.param3 != null and pageBaseDTO.param3 == 1"> |
| | | AND handle_status = 2 |
| | | AND `status` = 4 |
| | | </if> |
| | | <if test="pageBaseDTO.param3 != null and pageBaseDTO.param3 == 2"> |
| | | AND handle_status != 2 |
| | | AND `status` != 4 |
| | | </if> |
| | | ) ORDER BY create_at DESC |
| | | </select> |
| | |
| | | order by t.create_time desc |
| | | </select> |
| | | <select id="getRepairPolylineDate" resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( p1.create_time, '%m' ) AS filed, COUNT(1) AS num FROM com_property_repair p1 |
| | | LEFT JOIN com_property p2 ON p1.property_id = p2.id |
| | | WHERE p2.community_id = ${communityId} AND DATE_FORMAT( p1.create_time, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( p1.create_time, '%Y-%m' ) AS filed, COUNT(1) AS num FROM com_property_repair p1 |
| | | LEFT JOIN com_property p2 ON p1.property_id = p2.id |
| | | WHERE p2.community_id = ${communityId} AND DATE_FORMAT( p1.create_time, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getRepairTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(1) AS num FROM com_property_repair p1 |
| | | LEFT JOIN com_property p2 ON p1.property_id = p2.id |
| | | WHERE p2.community_id = ${communityId} AND DATE_FORMAT( p1.create_time, '%Y%m' ) <= #{date} |
| | | WHERE p2.community_id = ${communityId} AND DATE_FORMAT( p1.create_time, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="getEventAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( e.create_at, '%m' ) AS filed, COUNT(e.id) AS num |
| | | SELECT DATE_FORMAT( e.create_at, '%Y-%m' ) AS filed, COUNT(e.id) AS num |
| | | FROM `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | WHERE e.event_category = 1 AND e.event_type IN ( 1, 2, 3, 5, 6 ) AND e.event_status = 2 AND egd.grid_community_id = ${communityId} |
| | | AND DATE_FORMAT( e.create_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | AND DATE_FORMAT( e.create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT |
| | | DATE_FORMAT( create_at, '%m' ) AS filed, COUNT(id) AS num |
| | | FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) AND DATE_FORMAT( create_at, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | ) temp GROUP BY filed |
| | | DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(id) AS num |
| | | FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) |
| | | AND DATE_FORMAT( create_at, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getEventTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | |
| | | FROM `event` AS e |
| | | LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id |
| | | WHERE e.event_category = 1 AND e.event_type IN ( 1, 2, 3, 5, 6 ) AND e.event_status = 2 AND egd.grid_community_id = ${communityId} |
| | | AND DATE_FORMAT( e.create_at, '%Y%m' ) <= #{date} |
| | | AND DATE_FORMAT( e.create_at, '%Y-%m' ) <= #{date} |
| | | UNION ALL SELECT |
| | | COUNT(id) AS num |
| | | FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) AND DATE_FORMAT( create_at, '%Y%m' ) <= #{date} |
| | | FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) AND DATE_FORMAT( create_at, '%Y-%m' ) <= #{date} |
| | | ) temp |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | <select id="getServiceTimesAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT DATE_FORMAT( t1.statistic_date, '%m' ) AS filed, SUM(t1.consultation_volume) AS num |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( t1.statistic_date, '%Y-%m' ) AS filed, SUM(t1.consultation_volume) AS num |
| | | FROM com_convenient_consultation_statistics t1 |
| | | LEFT JOIN com_convenient_merchants t2 ON t1.merchant_id = t2.id |
| | | WHERE (t2.community_id = ${communityId} OR t2.community_id = 0) AND DATE_FORMAT( t1.statistic_date, '%Y' ) = DATE_FORMAT( CURDATE( ) , '%Y' ) GROUP BY filed |
| | | WHERE (t2.community_id = ${communityId} OR t2.community_id = 0) AND DATE_FORMAT( t1.statistic_date, '%Y-%m' ) > DATE_FORMAT(date_sub(curdate(), interval 12 month),'%Y-%m') GROUP BY filed |
| | | UNION ALL SELECT * FROM |
| | | ( |
| | | SELECT DATE_FORMAT(curdate(),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 1 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 2 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 3 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 4 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 5 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 6 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 7 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 8 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 9 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 10 month),'%Y-%m') AS filed, 0 AS num union |
| | | SELECT DATE_FORMAT(date_sub(curdate(), interval 11 month),'%Y-%m') AS filed, 0 AS num |
| | | ) temT |
| | | ) temp GROUP BY filed ORDER BY filed ASC |
| | | </select> |
| | | <select id="getServiceTimesTotalPolylineDate" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT IF(SUM(t1.consultation_volume) IS NULL,0,SUM(t1.consultation_volume)) AS num |
| | | FROM com_convenient_consultation_statistics t1 |
| | | LEFT JOIN com_convenient_merchants t2 ON t1.merchant_id = t2.id |
| | | WHERE (t2.community_id = ${communityId} OR t2.community_id = 0) AND DATE_FORMAT( t1.statistic_date, '%Y%m' ) <= #{date} |
| | | WHERE (t2.community_id = ${communityId} OR t2.community_id = 0) AND DATE_FORMAT( t1.statistic_date, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | <select id="indexMerchantList" |
| | | resultType="com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO"> |
| | |
| | | WHEN classify_id = 1 THEN 10 |
| | | END type, IFNULL( NULL, 2 ) AS eventType, id AS eventId, lng_lat AS latLng, detail AS content, substring_index(photo_path_list, ',', 1) AS cover, create_at, |
| | | CASE |
| | | WHEN handle_status = 2 THEN 1 |
| | | WHEN `status` = 4 THEN 1 |
| | | ELSE 2 END `status` |
| | | FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) |
| | | </select> |