| | |
| | | private Integer y; |
| | | @ApiModelProperty("累计数") |
| | | private Integer countY; |
| | | |
| | | private String year; |
| | | } |
| | |
| | | private Integer homeCount; |
| | | @ApiModelProperty("总量") |
| | | private Integer count; |
| | | |
| | | private String year; |
| | | } |
| | |
| | | * @param date |
| | | * @return |
| | | */ |
| | | BigScreenStaticsReserveMonth biggestScreenMonth(@Param("communityId")Long communityId,@Param("date")String date); |
| | | BigScreenStaticsReserveMonth biggestScreenMonth(@Param("communityId")Long communityId,@Param("date")String date,@Param("year")String year); |
| | | } |
| | |
| | | * @param date |
| | | * @return |
| | | */ |
| | | BigScreenActivityLine selectActivityCountMonth(@Param("communityId")Long communityId, @Param("date")String date); |
| | | BigScreenActivityLine selectActivityCountMonth(@Param("communityId")Long communityId, @Param("date")String date,@Param("year")String year); |
| | | |
| | | /** |
| | | * 查询党员积分前3 |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.ComPbMemberDAO; |
| | |
| | | |
| | | @Override |
| | | public R partyActivityLine(Long communityId) { |
| | | List<BigScreenActivityLine> bigScreenActivityLines=this.getPoints(); |
| | | List<BigScreenActivityLine> bigScreenActivityLines=this.getPastMonth(); |
| | | bigScreenActivityLines.forEach(bigScreenActivityLine -> { |
| | | BigScreenActivityLine bigScreenActivityLine1=comPbMemberDAO.selectActivityCountMonth(communityId,bigScreenActivityLine.getX()); |
| | | BigScreenActivityLine bigScreenActivityLine1=comPbMemberDAO.selectActivityCountMonth(communityId,bigScreenActivityLine.getX(),bigScreenActivityLine.getYear()); |
| | | bigScreenActivityLine.setY(bigScreenActivityLine1.getY()); |
| | | bigScreenActivityLine.setCountY(bigScreenActivityLine1.getCountY()); |
| | | }); |
| | |
| | | return bigScreenActivityLines; |
| | | } |
| | | |
| | | public List<BigScreenActivityLine> getPastMonth(){ |
| | | List<BigScreenActivityLine> bigScreenActivityLines=new ArrayList<>(); |
| | | for(int i=11;i>=0;i--){ |
| | | BigScreenActivityLine bigScreenActivityLine=new BigScreenActivityLine(); |
| | | String date=DateUtils.getDateFormatString(DateUtils.addMonth(new Date(),-i),"MM"); |
| | | String year=DateUtils.getDateFormatString(DateUtils.addMonth(new Date(),-i),"yyyy"); |
| | | bigScreenActivityLine.setX(date); |
| | | bigScreenActivityLine.setYear(year); |
| | | bigScreenActivityLines.add(bigScreenActivityLine); |
| | | } |
| | | return bigScreenActivityLines; |
| | | } |
| | | |
| | | } |
| | |
| | | bigScreenStaticsReserve.setGasPercent(BigDecimal.valueOf(bigScreenStaticsReserve.getGasCount()*100d/ bigScreenStaticsReserve.getCount()).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | List<BigScreenStaticsReserveMonth> bigScreenStaticsReserveMonthList=this.getPoints(); |
| | | bigScreenStaticsReserveMonthList.forEach(bigScreenStaticsReserveMonth -> { |
| | | BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth1=comActReserveRecordMapper.biggestScreenMonth(communityId,bigScreenStaticsReserveMonth.getX()); |
| | | BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth1=comActReserveRecordMapper.biggestScreenMonth(communityId,bigScreenStaticsReserveMonth.getX(), bigScreenStaticsReserveMonth.getYear()); |
| | | bigScreenStaticsReserveMonth.setCount(bigScreenStaticsReserveMonth1.getCount()); |
| | | bigScreenStaticsReserveMonth.setReserveCount(bigScreenStaticsReserveMonth1.getReserveCount()); |
| | | bigScreenStaticsReserveMonth.setFireCount(bigScreenStaticsReserveMonth1.getFireCount()); |
| | |
| | | aDate=i+""; |
| | | } |
| | | BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth(); |
| | | bigScreenStaticsReserveMonth.setYear("2021"); |
| | | bigScreenStaticsReserveMonth.setX(aDate); |
| | | bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth); |
| | | } |
| | |
| | | } |
| | | BigScreenStaticsReserveMonth bigScreenStaticsReserveMonth=new BigScreenStaticsReserveMonth(); |
| | | bigScreenStaticsReserveMonth.setX(aDate); |
| | | bigScreenStaticsReserveMonth.setYear(nowYear); |
| | | bigScreenStaticsReserveMonths.add(bigScreenStaticsReserveMonth); |
| | | } |
| | | } |
| | |
| | | </select> |
| | | |
| | | <select id="biggestScreenMonth" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenStaticsReserveMonth"> |
| | | select (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' or t1.title like '%返攀%' or t1.title like '%来攀%' or t1.title like '%燃气%' or t1.title like '%防火%') and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at ) count, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%燃气%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) gasCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%防火%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) fireCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) homeCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%返攀%' or t1.title like '%来攀%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) reserveCount |
| | | select (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' or t1.title like '%返攀%' or t1.title like '%来攀%' or t1.title like '%燃气%' or t1.title like '%防火%') and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at ) count, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%燃气%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) gasCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%防火%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) fireCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%居家%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) homeCount, |
| | | (select count(*) from com_act_reserve_record t LEFT JOIN com_act_reserve t1 on t.reserve_id = t1.id where (t1.title like '%返攀%' or t1.title like '%来攀%' ) and t1.community_id = ${communityId} and t.create_at >= DATE_FORMAT( CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=t.create_at) reserveCount |
| | | </select> |
| | | </mapper> |
| | |
| | | </select> |
| | | |
| | | <select id="selectActivityCountMonth" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenActivityLine"> |
| | | select ( select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and release_time >= DATE_FORMAT( CONCAT(year(now()),'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) y, |
| | | (select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and DATE_FORMAT( LAST_DAY(CONCAT(year(now()),'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) countY |
| | | select ( select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and release_time >= DATE_FORMAT( CONCAT(#{year},'-',#{date},'-00'), '%Y-%m-00 00:00:00') and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) y, |
| | | (select count(id) from com_pb_activity where status!=6 and community_id = ${communityId} and DATE_FORMAT( LAST_DAY(CONCAT(#{year},'-',#{date},'-00')), '%Y-%m-%d 23:59:59') >=release_time) countY |
| | | </select> |
| | | |
| | | <select id="selectActivityTop" resultType="com.panzhihua.common.model.vos.community.bigscreen.BigScreenActivityTop"> |