diff --git a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml index 62574e14..c52ed662 100644 --- a/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml +++ b/xhpc-modules/xhpc-charging-station/src/main/resources/mapper/XhpcChargingStationMapper.xml @@ -351,7 +351,7 @@ xr.power_fee as powerFee, xr.service_fee as serviceFee from xhpc_rate_time as xrt - left join xhpc_rate as xr on xr.rate_id = xrt.rate_id + left join xhpc_rate as xr on xr.rate_id = xrt.rate_id where xrt.charging_station_id = #{chargingStationId} and xrt.status = 0 and xrt.del_flag = 0 @@ -366,7 +366,7 @@ te.serial_number as serialNumber, cp.input_voltage as inputVoltage from xhpc_terminal as te - left join xhpc_charging_pile as cp on cp.charging_pile_id = te.charging_pile_id + left join xhpc_charging_pile as cp on cp.charging_pile_id = te.charging_pile_id where te.charging_station_id = #{chargingStationId} and te.status = 0 and te.del_flag = 0 @@ -793,7 +793,7 @@ ra.power_fee as powerFee, ra.service_fee as serviceFee from xhpc_rate_time as rt - left join xhpc_rate as ra on ra.rate_id = rt.rate_id + left join xhpc_rate as ra on ra.rate_id = rt.rate_id where rt.charging_station_id = #{chargingStationId} and rt.del_flag = 0 diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java index c185d31a..26393506 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/controller/XhpcStatisticsController.java @@ -3,13 +3,14 @@ package com.xhpc.order.controller; import com.xhpc.common.core.web.controller.BaseController; import com.xhpc.common.core.web.domain.BaseEntity; import com.xhpc.common.core.web.page.TableDataInfo; +import com.xhpc.order.service.IXhpcStatisticsService; import io.swagger.annotations.Api; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -23,17 +24,119 @@ import java.util.Map; @Api(value = "统计接口", tags = "统计接口") public class XhpcStatisticsController extends BaseController { + @Autowired + private IXhpcStatisticsService xhpcStatisticsService; /** * 小时统计 + * @param chargingPileIds 电站id集合 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return */ @GetMapping("/getTimeIntervalPage") - public TableDataInfo getTimeIntervalPage(String phone, String transactionNumber, @RequestParam("status")Integer status, String chargingStationName, Long operatorId, Integer source, String startTime, String endTime, @RequestParam("userId") Long userId, Integer type) + public TableDataInfo getTimeIntervalPage(String chargingPileIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { startPage(); - //List> listPage = xhpcHistoryOrderService.getListPage(phone, transactionNumber, status, chargingStationName, operatorId, source, startTime, endTime, userId, type); - return getDataTable(new ArrayList<>()); + List> list = xhpcStatisticsService.getTimeIntervalPage(chargingPileIds,internetUserId,operatorId,startTime,endTime,userId,type); + return getDataTable(list); + } + + /** + * 日期统计 + * @param chargingPileIds 电站id集合 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getDateIntervalPage") + public TableDataInfo getDateIntervalPage(String chargingPileIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + startPage(); + List> list = xhpcStatisticsService.getDateIntervalPage(chargingPileIds,internetUserId,operatorId,startTime,endTime,userId,type); + return getDataTable(list); + } + + /** + * 电站统计 + * @param stationName 电站名称 + * @param operatorName 运营商名称 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getStationIntervalPage") + public TableDataInfo getStationIntervalPage(String stationName,String operatorName,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + startPage(); + List> list = xhpcStatisticsService.getStationIntervalPage(stationName,operatorName,internetUserId,operatorId,startTime,endTime,userId,type); + return getDataTable(list); + } + + /** + * 运营商统计 + * @param operatorName 运营商名称 + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getOperatorIntervalPage") + public TableDataInfo getOperatorIntervalPage(String operatorName, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + startPage(); + List> list = xhpcStatisticsService.getOperatorIntervalPage(operatorName,operatorId,startTime,endTime,userId,type); + return getDataTable(list); + } + + /** + * 流量方统计 + * @param internetUserName 流量方名称 + * @param internetUserId 流量方id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getInternetUserIntervalPage") + public TableDataInfo getInternetUserIntervalPage(String internetUserName,Long internetUserId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + startPage(); + List> list = xhpcStatisticsService.getInternetUserIntervalPage(internetUserName,internetUserId,startTime,endTime,userId,type); + return getDataTable(list); } - + /** + * 终端统计 + * @param chargingStationName 电站名称 + * @param terminalName 电桩名称 + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getTerminalIntervalPage") + public TableDataInfo getTerminalIntervalPage(String chargingStationName,String terminalName,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + startPage(); + List> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationName,terminalName,operatorId,startTime,endTime,userId,type); + return getDataTable(list); + } } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/domain/XhpcStatisticsTimeInterval.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/domain/XhpcStatisticsTimeInterval.java index 4f59ee54..2e4c0c39 100644 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/domain/XhpcStatisticsTimeInterval.java +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/domain/XhpcStatisticsTimeInterval.java @@ -78,7 +78,7 @@ public class XhpcStatisticsTimeInterval extends BaseEntity { */ private BigDecimal platformSvcCommisssion; /** - * 运维总抽成 + * 运维总金额抽成 */ private BigDecimal operationCommission; /** @@ -86,13 +86,19 @@ public class XhpcStatisticsTimeInterval extends BaseEntity { */ private BigDecimal operationSvcCommission; /** - * 0 平台 1 运营商 2流量方 + * 流量方id */ - private Integer type; + private Long internetUserId; /** - * 运营商和流量方id + * 运营商id */ - private BigDecimal operatorInternetId; + private Long operatorId; + + /** + * 电站id + */ + private Long chargingPileId; + /** * 删除标志(0代表存在 2代表删除) */ @@ -279,24 +285,24 @@ public class XhpcStatisticsTimeInterval extends BaseEntity { this.operationSvcCommission = operationSvcCommission; } - public Integer getType() { + public Long getInternetUserId() { - return type; + return internetUserId; } - public void setType(Integer type) { + public void setInternetUserId(Long internetUserId) { - this.type = type; + this.internetUserId = internetUserId; } - public BigDecimal getOperatorInternetId() { + public Long getOperatorId() { - return operatorInternetId; + return operatorId; } - public void setOperatorInternetId(BigDecimal operatorInternetId) { + public void setOperatorId(Long operatorId) { - this.operatorInternetId = operatorInternetId; + this.operatorId = operatorId; } public Integer getDelFlag() { @@ -309,4 +315,14 @@ public class XhpcStatisticsTimeInterval extends BaseEntity { this.delFlag = delFlag; } + public Long getChargingPileId() { + + return chargingPileId; + } + + public void setChargingPileId(Long chargingPileId) { + + this.chargingPileId = chargingPileId; + } + } diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java new file mode 100644 index 00000000..2e166865 --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/mapper/XhpcStatisticsServiceMapper.java @@ -0,0 +1,87 @@ +package com.xhpc.order.mapper; + +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import java.util.Map; + +/** + * @author yuyang + * @date 2021/9/1 10:00 + * @Version 1.0 + */ +public interface XhpcStatisticsServiceMapper { + + /** + * 小时统计 + * @param chargingPileIds 电站id集合 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getTimeIntervalPage(@Param("chargingPileIds") List chargingPileIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); + + + /** + * 日期统计 + * @param chargingPileIds 电站id集合 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getDateIntervalPage(@Param("chargingPileIds") List chargingPileIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); + + /** + * 电站统计 + * @param stationName 电站名称 + * @param operatorName 运营商名称 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getStationIntervalPage(@Param("stationName") String stationName,@Param("operatorName") String operatorName,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); + + /** + * 运营商统计 + * @param operatorName 运营商名称 + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getOperatorIntervalPage(@Param("operatorName") String operatorName,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); + + /** + * 流量方统计 + * @param internetUserName 流量方名称 + * @param internetUserId 流量方id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getInternetUserIntervalPage(@Param("internetUserName") String internetUserName,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); + + + /** + * 终端统计 + * @param chargingStationName 电站名称 + * @param terminalName 电桩名称 + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getTerminalIntervalPage(@Param("chargingStationName") String chargingStationName,@Param("terminalName") String terminalName,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); +} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IStatisticsService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IStatisticsService.java deleted file mode 100644 index f41c87e4..00000000 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IStatisticsService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.xhpc.order.service; - -/** - * @author yuyang - * @date 2021/8/31 16:21 - * @Version 1.0 - */ -public interface IStatisticsService { - -} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java new file mode 100644 index 00000000..62a4e46e --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/IXhpcStatisticsService.java @@ -0,0 +1,93 @@ +package com.xhpc.order.service; + +import java.util.List; +import java.util.Map; + +/** + * @author yuyang + * @date 2021/8/31 16:21 + * @Version 1.0 + */ +public interface IXhpcStatisticsService { + + /** + * 小时统计 + * @param chargingPileIds 电站id集合 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getTimeIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + + + /** + * 日期统计 + * @param chargingPileIds 电站id集合 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getDateIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + + /** + * 电站统计 + * @param stationName 电站名称 + * @param operatorName 运营商名称 + * @param internetUserId 流量方id + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getStationIntervalPage(String stationName,String operatorName, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + + /** + * 运营商统计 + * @param operatorName 运营商名称 + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getOperatorIntervalPage(String operatorName,Long operatorId, String startTime, String endTime, Long userId, Integer type); + + + /** + * 流量方统计 + * @param internetUserName 流量方名称 + * @param internetUserId 流量方id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getInternetUserIntervalPage(String internetUserName, Long internetUserId, String startTime, String endTime, Long userId, Integer type); + + + /** + * 终端统计 + * @param chargingStationName 电站名称 + * @param terminalName 电桩名称 + * @param operatorId 运营商id + * @param startTime 订单开始时间 + * @param endTime 订单结束时间 + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getTerminalIntervalPage(String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime, Long userId, Integer type); + +} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/StatisticsServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/StatisticsServiceImpl.java deleted file mode 100644 index b90331be..00000000 --- a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/StatisticsServiceImpl.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.xhpc.order.service.impl; - -import com.xhpc.order.service.IStatisticsService; - -/** - * @author yuyang - * @date 2021/8/31 16:22 - * @Version 1.0 - */ -public class StatisticsServiceImpl implements IStatisticsService { - -} diff --git a/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java new file mode 100644 index 00000000..e35535aa --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/java/com/xhpc/order/service/impl/XhpcStatisticsServiceImpl.java @@ -0,0 +1,256 @@ +package com.xhpc.order.service.impl; + + +import com.xhpc.order.mapper.XhpcStatisticsServiceMapper; +import com.xhpc.order.service.IXhpcStatisticsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; + +/** + * @author yuyang + * @date 2021/8/31 16:22 + * @Version 1.0 + */ +@Service +public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { + + @Autowired + private XhpcStatisticsServiceMapper xhpcStatisticsServiceMapper; + @Override + public List> getTimeIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + + if(type==null){ + return new ArrayList<>(); + } + if(type==2){ + if(operatorId==null){ + return new ArrayList<>(); + } + }else if(type==3){ + if(internetUserId==null){ + return new ArrayList<>(); + } + }else if(type!=1){ + return new ArrayList<>(); + } + List chargingPileId =new ArrayList<>(); + if(!"".equals(chargingPileIds) && chargingPileIds !=null){ + chargingPileId= Arrays.asList(chargingPileIds.split(",")); + } + List> list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingPileId, internetUserId, operatorId, startTime, endTime, type); + List> page =new ArrayList<>(); + if(list !=null && list.size()>0){ + for (int i = 1; i <=24 ; i++) { + boolean fan = true; + for (Map map:list) { + int status = (int)map.get("status"); + if(status==i){ + page.add(map); + fan=false; + break; + } + } + if(fan){ + if(i==1){ + page.add(getStatistics("00:00-01:00")); + }else if(i==2){ + page.add(getStatistics("01:00-02:00")); + }else if(i==3){ + page.add(getStatistics("02:00-03:00")); + }else if(i==4){ + page.add(getStatistics("03:00-04:00")); + }else if(i==5){ + page.add(getStatistics("04:00-05:00")); + }else if(i==6){ + page.add(getStatistics("05:00-06:00")); + }else if(i==7){ + page.add(getStatistics("06:00-07:00")); + }else if(i==8){ + page.add(getStatistics("07:00-08:00")); + }else if(i==9){ + page.add(getStatistics("08:00-09:00")); + }else if(i==10){ + page.add(getStatistics("09:00-10:00")); + }else if(i==11){ + page.add(getStatistics("10:00-11:00")); + }else if(i==12){ + page.add(getStatistics("11:00-12:00")); + }else if(i==13){ + page.add(getStatistics("12:00-13:00")); + }else if(i==14){ + page.add(getStatistics("13:00-14:00")); + }else if(i==15){ + page.add(getStatistics("14:00-15:00")); + }else if(i==16){ + page.add(getStatistics("15:00-16:00")); + }else if(i==17){ + page.add(getStatistics("16:00-17:00")); + }else if(i==18){ + page.add(getStatistics("17:00-18:00")); + }else if(i==19){ + page.add(getStatistics("18:00-19:00")); + }else if(i==20){ + page.add(getStatistics("19:00-20:00")); + }else if(i==21){ + page.add(getStatistics("20:00-21:00")); + }else if(i==22){ + page.add(getStatistics("21:00-22:00")); + }else if(i==23){ + page.add(getStatistics("22:00-23:00")); + }else if(i==24){ + page.add(getStatistics("23:00-24:00")); + } + } + } + }else{ + page.add(getStatistics("00:00-01:00")); + page.add(getStatistics("01:00-02:00")); + page.add(getStatistics("02:00-03:00")); + page.add(getStatistics("03:00-04:00")); + page.add(getStatistics("04:00-05:00")); + page.add(getStatistics("05:00-06:00")); + page.add(getStatistics("06:00-07:00")); + page.add(getStatistics("07:00-08:00")); + page.add(getStatistics("08:00-09:00")); + page.add(getStatistics("09:00-10:00")); + page.add(getStatistics("10:00-11:00")); + page.add(getStatistics("11:00-12:00")); + page.add(getStatistics("12:00-13:00")); + page.add(getStatistics("13:00-14:00")); + page.add(getStatistics("14:00-15:00")); + page.add(getStatistics("15:00-16:00")); + page.add(getStatistics("16:00-17:00")); + page.add(getStatistics("17:00-18:00")); + page.add(getStatistics("18:00-19:00")); + page.add(getStatistics("19:00-20:00")); + page.add(getStatistics("20:00-21:00")); + page.add(getStatistics("21:00-22:00")); + page.add(getStatistics("22:00-23:00")); + page.add(getStatistics("23:00-24:00")); + } + return page; + } + + @Override + public List> getDateIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + if(type==null){ + return new ArrayList<>(); + } + if(type==2){ + if(operatorId==null){ + return new ArrayList<>(); + } + }else if(type==3){ + if(internetUserId==null){ + return new ArrayList<>(); + } + }else if(type!=1){ + return new ArrayList<>(); + } + List chargingPileId =new ArrayList<>(); + if(!"".equals(chargingPileIds) && chargingPileIds !=null){ + chargingPileId= Arrays.asList(chargingPileIds.split(",")); + } + + return xhpcStatisticsServiceMapper.getDateIntervalPage(chargingPileId, internetUserId, operatorId, startTime, endTime, type); + } + + @Override + public List> getStationIntervalPage(String stationName, String operatorName, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + if(type==null){ + return new ArrayList<>(); + } + if(type==2){ + if(operatorId==null){ + return new ArrayList<>(); + } + }else if(type==3){ + if(internetUserId==null){ + return new ArrayList<>(); + } + }else if(type!=1){ + return new ArrayList<>(); + } + return xhpcStatisticsServiceMapper.getStationIntervalPage(stationName,operatorName,internetUserId,operatorId,startTime,endTime,type); + } + + @Override + public List> getOperatorIntervalPage(String operatorName, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + if(type==null){ + return new ArrayList<>(); + } + if(type==2){ + if(operatorId==null){ + return new ArrayList<>(); + } + }else if(type==3){ + return new ArrayList<>(); + }else if(type!=1){ + return new ArrayList<>(); + } + + return xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorName, operatorId, startTime, endTime, type); + } + + @Override + public List> getInternetUserIntervalPage(String internetUserName, Long internetUserId, String startTime, String endTime, Long userId, Integer type) { + if(type==null){ + return new ArrayList<>(); + } + if(type==2){ + return new ArrayList<>(); + }else if(type==3){ + if(internetUserId==null){ + return new ArrayList<>(); + } + }else if(type!=1){ + return new ArrayList<>(); + } + return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetUserName, internetUserId, startTime, endTime, type); + } + + @Override + public List> getTerminalIntervalPage(String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + if(type==null){ + return new ArrayList<>(); + } + if(type==2){ + if(operatorId==null){ + return new ArrayList<>(); + } + }else if(type==3){ + return new ArrayList<>(); + }else if(type!=1){ + return new ArrayList<>(); + } + return xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationName, terminalName, operatorId, startTime, endTime, type); + } + + + private Map getStatistics(String time){ + Map map =new HashMap<>(); + map.put("chargingDegree",0.00); + map.put("chargingTime",0.00); + map.put("chargingNumber",0); + map.put("powerPrice",0.00); + map.put("servicePrice",0.00); + map.put("totalPrice",0.00); + map.put("promotionDiscount",0.00); + map.put("actPrice",0.00); + map.put("actPowerPrice",0.00); + map.put("actServicePrice",0.00); + map.put("internetCommission",0.00); + map.put("internetSvcCommission",0.00); + map.put("platformCommission",0.00); + map.put("platformSvcCommisssion",0.00); + map.put("operationCommission",0.00); + map.put("operationSvcCommission",0.00); + map.put("time",time); + return map; + } + + + +} diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml new file mode 100644 index 00000000..9147ae2c --- /dev/null +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -0,0 +1,282 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +