New file |
| | |
| | | package com.panzhihua.common.model.vos.community.bigscreen; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.panzhihua.common.model.vos.community.StatisticsCommVO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: BigScreenCourtyardStatisticsInfo |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 金沙定制页面-院落议事大屏统计数据 |
| | | * @author: hans |
| | | * @date: 2022/03/10 10:04 |
| | | */ |
| | | @Data |
| | | @ApiModel("金沙定制页面-院落议事大屏统计数据") |
| | | public class BigScreenCourtyardStatisticsInfo { |
| | | |
| | | @ApiModelProperty("院落议事数量") |
| | | private Integer discussTotal; |
| | | |
| | | @ApiModelProperty("议事类") |
| | | private Integer ysTotal; |
| | | |
| | | @ApiModelProperty("投票类") |
| | | private Integer tpTotal; |
| | | |
| | | @ApiModelProperty(value = "院落议事新增折线数据") |
| | | private List<StatisticsCommVO> discussAddPolylineData; |
| | | |
| | | @ApiModelProperty(value = "院落议事累计折线数据") |
| | | private List<StatisticsCommVO> discussTotalPolylineData; |
| | | } |
| | |
| | | */ |
| | | @PostMapping("/screen/fourMember/resolve") |
| | | R pageFourMemberResolve(@RequestBody PageBaseDTO pageBaseDTO); |
| | | |
| | | /** |
| | | * 金沙定制页面-四长四员院落议事展示列表 |
| | | * @param pageBaseDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/screen/courtyard/list") |
| | | R pageCourtyardDiscuss(@RequestBody PageBaseDTO pageBaseDTO); |
| | | |
| | | /** |
| | | * 金沙定制页面-院落议事 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/screen/courtyard/base") |
| | | R getCourtyardBaseData(@RequestParam("communityId") Long communityId); |
| | | } |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.EquipmentPointMapDataVO; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | communityRankDTO.setCommunityId(this.getCommunityId()); |
| | | return communityService.getIntegralCommunityRankApplets(communityRankDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "金沙定制页面-四长四员院落议事展示列表,param3(1.议事 2.投票)", response = ComActDiscussVO.class) |
| | | @PostMapping("/courtyard/list") |
| | | public R pageCourtyardDiscuss(@RequestBody PageBaseDTO pageBaseDTO) { |
| | | pageBaseDTO.setCommunityId(this.getCommunityId()); |
| | | return communityService.pageCourtyardDiscuss(pageBaseDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "金沙定制页面-院落议事", response = BigScreenCourtyardStatisticsInfo.class) |
| | | @GetMapping("/courtyard/base") |
| | | public R getCourtyardBaseData() { |
| | | return communityService.getCourtyardBaseData(this.getCommunityId()); |
| | | } |
| | | } |
| | |
| | | public R pageFourMemberResolve(@RequestBody PageBaseDTO pageBaseDTO) { |
| | | return bigScreenStatisticsService.pageFourMemberResolve(pageBaseDTO); |
| | | } |
| | | |
| | | /** |
| | | * 金沙定制页面-四长四员院落议事展示列表 |
| | | * @param pageBaseDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/courtyard/list") |
| | | public R pageCourtyardDiscuss(@RequestBody PageBaseDTO pageBaseDTO) { |
| | | return bigScreenStatisticsService.pageCourtyardDiscuss(pageBaseDTO); |
| | | } |
| | | |
| | | /** |
| | | * 金沙定制页面-院落议事 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @GetMapping("/courtyard/base") |
| | | public R getCourtyardBaseData(@RequestParam("communityId") Long communityId) { |
| | | return bigScreenStatisticsService.getCourtyardBaseData(communityId); |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.vos.community.StatisticsCommVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | |
| | | * @return |
| | | */ |
| | | List<String> getTitles(@Param("type") int type, @Param("communityId") Long communityId, @Param("pageSize") Integer pageSize); |
| | | |
| | | /** |
| | | * 金沙定制页面-四长四员院落议事展示列表 |
| | | * @param pageBaseDTO |
| | | * @return |
| | | */ |
| | | IPage<ComActDiscussVO> pageCourtyardDiscuss(@Param("page") Page page, @Param("pageBaseDTO") PageBaseDTO pageBaseDTO); |
| | | |
| | | /** |
| | | * 金沙定制页面-院落议事基础统计数据 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | BigScreenCourtyardStatisticsInfo getCourtyardBaseData(@Param("communityId") Long communityId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | StatisticsCommVO retrieveJJWTTotalPolylineData(@Param("communityId") Long communityId, @Param("date") String date); |
| | | |
| | | /** |
| | | * 新增院落议事数统计 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | List<StatisticsCommVO> retrieveYLYSAddPolylineData(@Param("communityId") Long communityId); |
| | | |
| | | /** |
| | | * 累计院落议事数统计 |
| | | * @param communityId |
| | | * @param date |
| | | * @return |
| | | */ |
| | | StatisticsCommVO retrieveYLYSTotalPolylineData(@Param("communityId") Long communityId, @Param("date") String date); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R pageFourMemberResolve(PageBaseDTO pageBaseDTO); |
| | | |
| | | /** |
| | | * 金沙定制页面-四长四员院落议事展示列表 |
| | | * @param pageBaseDTO |
| | | * @return |
| | | */ |
| | | R pageCourtyardDiscuss(PageBaseDTO pageBaseDTO); |
| | | |
| | | /** |
| | | * 金沙定制页面-院落议事 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | R getCourtyardBaseData(Long communityId); |
| | | } |
| | |
| | | import com.panzhihua.common.model.vos.community.ComActEasyPhotoVO; |
| | | import com.panzhihua.common.model.vos.community.ComMngVolunteerMngVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenAlarmStatisticsInfo; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenVolunteerStatisticsInfo; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.EquipmentPointMapDataVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.VolunteerOrgRelationVO; |
| | |
| | | jjwtTotalPolylineData.add(temp); |
| | | }); |
| | | statisticsInfo.setJjwtTotalPolylineData(jjwtTotalPolylineData); |
| | | //新增院落议事数 |
| | | List<StatisticsCommVO> ylysAddPolylineData = comActFourMemberDao.retrieveYLYSAddPolylineData(communityId); |
| | | statisticsInfo.setYlysAddPolylineData(ylysAddPolylineData); |
| | | //累计院落议事数 |
| | | List<StatisticsCommVO> ylysTotalPolylineData = new ArrayList<>(); |
| | | ylysAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActFourMemberDao.retrieveYLYSTotalPolylineData(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | ylysTotalPolylineData.add(temp); |
| | | }); |
| | | statisticsInfo.setYlysTotalPolylineData(ylysTotalPolylineData); |
| | | return R.ok(statisticsInfo); |
| | | } |
| | | |
| | |
| | | return R.ok(comActMicroWishDAO.pageFourMemberResolve(page, pageBaseDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 金沙定制页面-四长四员院落议事展示列表 |
| | | * @param pageBaseDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageCourtyardDiscuss(PageBaseDTO pageBaseDTO) { |
| | | Page page = retrievePage(pageBaseDTO); |
| | | return R.ok(comActDiscussDAO.pageCourtyardDiscuss(page, pageBaseDTO)); |
| | | } |
| | | |
| | | /** |
| | | * 金沙定制页面-院落议事 |
| | | * @param communityId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getCourtyardBaseData(Long communityId) { |
| | | BigScreenCourtyardStatisticsInfo statisticsInfo = comActDiscussDAO.getCourtyardBaseData(communityId); |
| | | //新增院落议事数 |
| | | List<StatisticsCommVO> discussAddPolylineData = comActFourMemberDao.retrieveYLYSAddPolylineData(communityId); |
| | | statisticsInfo.setDiscussAddPolylineData(discussAddPolylineData); |
| | | //累计院落议事数 |
| | | List<StatisticsCommVO> discussTotalPolylineData = new ArrayList<>(); |
| | | discussAddPolylineData.forEach(e -> { |
| | | StatisticsCommVO temp = comActFourMemberDao.retrieveYLYSTotalPolylineData(communityId, e.getFiled()); |
| | | temp.setFiled(e.getFiled()); |
| | | discussTotalPolylineData.add(temp); |
| | | }); |
| | | statisticsInfo.setDiscussTotalPolylineData(discussTotalPolylineData); |
| | | return R.ok(statisticsInfo); |
| | | } |
| | | |
| | | private Page retrievePage(PageBaseDTO pageBaseDTO) { |
| | | Long pageNum = pageBaseDTO.getPageNum(); |
| | | Long size = pageBaseDTO.getPageSize(); |
| | |
| | | WHERE |
| | | community_id = ${communityId} |
| | | </select> |
| | | <select id="pageCourtyardDiscuss" resultType="com.panzhihua.common.model.vos.community.ComActDiscussVO"> |
| | | SELECT id, `type`, discuss_subject, photo_pah FROM com_act_discuss |
| | | WHERE community_id = #{pageBaseDTO.communityId} |
| | | AND content_type = 2 AND is_del = 2 AND photo_pah IS NOT NULL |
| | | <if test="pageBaseDTO.param3 != null"> |
| | | AND `type` = #{pageBaseDTO.param3} |
| | | </if> |
| | | ORDER BY create_at DESC |
| | | </select> |
| | | <select id="getCourtyardBaseData" |
| | | resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenCourtyardStatisticsInfo"> |
| | | SELECT |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2) AS discussTotal, |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 AND `type` = 1) AS ysTotal, |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 AND `type` = 2) AS tpTotal |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | (SELECT COUNT(DISTINCT d2.user_id) FROM com_act_discuss d1 INNER JOIN com_act_discuss_comment d2 ON d1.id = d2.discuss_id WHERE d1.community_id = #{communityId} AND d1.is_del = 2) AS ystpcyTotal, |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND is_del = 2 AND `type` = 1) AS ysTotal, |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND is_del = 2 AND `type` = 2) AS tpTotal, |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2) AS ylysTotal, |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 1 AND is_del = 2) AS sqysTotal, |
| | | (SELECT COUNT(id) FROM com_pb_member WHERE community_id = #{communityId} AND audit_result = 1) AS dyTotal, |
| | | (SELECT COUNT(id) FROM com_act_four_member WHERE community_id = #{communityId}) AS szsyTotal, |
| | | (SELECT COUNT(id) FROM com_act_four_member WHERE community_id = #{communityId} AND (position LIKE CONCAT('%','居民小组长','%') OR position = '全部')) AS jmxzzTotal, |
| | |
| | | INNER JOIN com_act_micro_wish t2 ON t1.service_id = t2.id |
| | | WHERE t1.community_id = #{communityId} AND t1.`type` = 5 AND t1.service_type = 2 AND t2.`status` = 6 |
| | | ) |
| | | ) AS jjwtTotal |
| | | ) AS jjwtTotal, |
| | | (SELECT COUNT(id) FROM com_act_discuss WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2) AS ylysTotal |
| | | </select> |
| | | <select id="getFourMembers" resultType="com.panzhihua.common.model.vos.community.ComActFourMemberVO"> |
| | | SELECT |
| | |
| | | AND t1.service_type = 2 AND t2.`status` = 6 AND DATE_FORMAT( t2.create_at, '%Y-%m' ) <= #{date} |
| | | ) AS num |
| | | </select> |
| | | <select id="retrieveYLYSAddPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT filed, SUM(num) AS num FROM ( |
| | | SELECT DATE_FORMAT( create_at, '%Y-%m' ) AS filed, COUNT(1) AS num |
| | | FROM com_act_discuss |
| | | WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 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="retrieveYLYSTotalPolylineData" |
| | | resultType="com.panzhihua.common.model.vos.community.StatisticsCommVO"> |
| | | SELECT COUNT(1) AS num |
| | | FROM com_act_discuss |
| | | WHERE community_id = #{communityId} AND content_type = 2 AND is_del = 2 AND DATE_FORMAT( create_at, '%Y-%m' ) <= #{date} |
| | | </select> |
| | | |
| | | </mapper> |