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 26393506..e9bfb20e 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 @@ -1,6 +1,7 @@ package com.xhpc.order.controller; import com.xhpc.common.core.web.controller.BaseController; +import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.common.core.web.domain.BaseEntity; import com.xhpc.common.core.web.page.TableDataInfo; import com.xhpc.order.service.IXhpcStatisticsService; @@ -28,7 +29,7 @@ public class XhpcStatisticsController extends BaseController { private IXhpcStatisticsService xhpcStatisticsService; /** * 小时统计 - * @param chargingPileIds 电站id集合 + * @param chargingStationIds 电站id集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -38,16 +39,16 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTimeIntervalPage") - public TableDataInfo getTimeIntervalPage(String chargingPileIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getTimeIntervalPage(String chargingStationIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) { startPage(); - List> list = xhpcStatisticsService.getTimeIntervalPage(chargingPileIds,internetUserId,operatorId,startTime,endTime,userId,type); + List> list = xhpcStatisticsService.getTimeIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } /** * 日期统计 - * @param chargingPileIds 电站id集合 + * @param chargingStationIds 电站id集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -57,17 +58,17 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getDateIntervalPage") - public TableDataInfo getDateIntervalPage(String chargingPileIds,Long internetUserId, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getDateIntervalPage(String chargingStationIds,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); + List> list = xhpcStatisticsService.getDateIntervalPage(chargingStationIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } /** * 电站统计 - * @param stationName 电站名称 - * @param operatorName 运营商名称 + * @param chargingStationIds 电站集合 + * @param operatorIds 运营商集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -77,16 +78,16 @@ public class XhpcStatisticsController extends BaseController { * @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) + public TableDataInfo getStationIntervalPage(String chargingStationIds,String operatorIds,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); + List> list = xhpcStatisticsService.getStationIntervalPage(chargingStationIds,operatorIds,internetUserId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } /** * 运营商统计 - * @param operatorName 运营商名称 + * @param operatorIds 运营商集合 * @param operatorId 运营商id * @param startTime 订单开始时间 * @param endTime 订单结束时间 @@ -95,16 +96,16 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getOperatorIntervalPage") - public TableDataInfo getOperatorIntervalPage(String operatorName, Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getOperatorIntervalPage(String operatorIds, 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); + List> list = xhpcStatisticsService.getOperatorIntervalPage(operatorIds,operatorId,startTime,endTime,userId,type); return getDataTable(list); } /** * 流量方统计 - * @param internetUserName 流量方名称 + * @param internetUserIds 流量方集合 * @param internetUserId 流量方id * @param startTime 订单开始时间 * @param endTime 订单结束时间 @@ -113,18 +114,18 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getInternetUserIntervalPage") - public TableDataInfo getInternetUserIntervalPage(String internetUserName,Long internetUserId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getInternetUserIntervalPage(String internetUserIds,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); + List> list = xhpcStatisticsService.getInternetUserIntervalPage(internetUserIds,internetUserId,startTime,endTime,userId,type); return getDataTable(list); } /** * 终端统计 - * @param chargingStationName 电站名称 - * @param terminalName 电桩名称 + * @param chargingStationId 电站集合 + * @param terminalId 终端集合 * @param operatorId 运营商id * @param startTime 订单开始时间 * @param endTime 订单结束时间 @@ -133,10 +134,74 @@ public class XhpcStatisticsController extends BaseController { * @return */ @GetMapping("/getTerminalIntervalPage") - public TableDataInfo getTerminalIntervalPage(String chargingStationName,String terminalName,Long operatorId,String startTime, String endTime, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + public TableDataInfo getTerminalIntervalPage(String chargingStationId,String terminalId,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); + List> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationId,terminalId,operatorId,startTime,endTime,userId,type); return getDataTable(list); } + + /** + * 电站列表 + * @param operatorId 运营商id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getChargingStationList") + public AjaxResult getChargingStationList(Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + if (type == null || type==3) { + return AjaxResult.success(); + } + return xhpcStatisticsService.getChargingStationList(operatorId, userId, type); + } + + /** + * 运营商列表 + * @param operatorId 运营商id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getOperatorList") + public AjaxResult getOperatorList(Long operatorId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + if (type == null || type==3) { + return AjaxResult.success(); + } + return xhpcStatisticsService.getOperatorList(operatorId, userId, type); + } + + /** + * 流量方列表 + * @param internetUserId 流量方id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getInternetUserIList") + public AjaxResult getInternetUserIList(Long internetUserId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + if (type == null || type==2) { + return AjaxResult.success(); + } + return xhpcStatisticsService.getInternetUserIList(internetUserId, userId, type); + } + + /** + * 终端列表 + * @param chargingStationId 电站id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + @GetMapping("/getTerminalList") + public AjaxResult getTerminalList(Long chargingStationId, @RequestParam("userId") Long userId, @RequestParam("type")Integer type) + { + if (type == null || type==3) { + return AjaxResult.success(); + } + return xhpcStatisticsService.getTerminalList(chargingStationId, userId, type); + } } 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 index 2e166865..b91cc040 100644 --- 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 @@ -14,7 +14,7 @@ public interface XhpcStatisticsServiceMapper { /** * 小时统计 - * @param chargingPileIds 电站id集合 + * @param chargingStationIds 电站id集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -22,12 +22,12 @@ public interface XhpcStatisticsServiceMapper { * @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); + List> getTimeIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); /** * 日期统计 - * @param chargingPileIds 电站id集合 + * @param chargingStationIds 电站id集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -35,12 +35,12 @@ public interface XhpcStatisticsServiceMapper { * @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); + List> getDateIntervalPage(@Param("chargingStationIds") List chargingStationIds,@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 chargingStationIds 电站集合 + * @param operatorUserId 运营商集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -48,40 +48,78 @@ public interface XhpcStatisticsServiceMapper { * @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); + List> getStationIntervalPage(@Param("chargingStationIds") List chargingStationIds,@Param("operatorUserId") List operatorUserId,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); /** * 运营商统计 - * @param operatorName 运营商名称 + * @param operatorUserId 运营商集合 * @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); + List> getOperatorIntervalPage(@Param("operatorUserId") List operatorUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); /** * 流量方统计 - * @param internetUserName 流量方名称 + * @param internetIds 流量方名称 * @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); + List> getInternetUserIntervalPage(@Param("internetIds") List internetIds,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); /** * 终端统计 - * @param chargingStationName 电站名称 - * @param terminalName 电桩名称 + * @param chargingStationId 电站id + * @param terminalId 终端id * @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); + List> getTerminalIntervalPage(@Param("chargingStationId") String chargingStationId,@Param("terminalId") String terminalId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type); + + + /** + * 电站列表 + * @param operatorId 运营商id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getChargingStationList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type); + + /** + * 运营商列表 + * @param operatorId 运营商id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getOperatorList(@Param("operatorId")Long operatorId,@Param("userId")Long userId,@Param("type")Integer type); + + + /** + * 流量方列表 + * @param internetUserId 流量方id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getInternetUserIList(@Param("internetUserId")Long internetUserId,@Param("userId")Long userId,@Param("type")Integer type); + + /** + * 终端列表 + * @param chargingStationId 流量方id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + List> getTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("userId")Long userId,@Param("type")Integer type); } 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 index 62a4e46e..04327408 100644 --- 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 @@ -1,5 +1,7 @@ package com.xhpc.order.service; +import com.xhpc.common.core.web.domain.AjaxResult; + import java.util.List; import java.util.Map; @@ -12,7 +14,7 @@ public interface IXhpcStatisticsService { /** * 小时统计 - * @param chargingPileIds 电站id集合 + * @param chargingStationIds 电站id集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -21,12 +23,12 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTimeIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 日期统计 - * @param chargingPileIds 电站id集合 + * @param chargingStationIds 电站id集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -35,12 +37,12 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getDateIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 电站统计 - * @param stationName 电站名称 - * @param operatorName 运营商名称 + * @param chargingStationIds 电站集合 + * @param operatorIds 运营集合 * @param internetUserId 流量方id * @param operatorId 运营商id * @param startTime 订单开始时间 @@ -49,11 +51,11 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getStationIntervalPage(String stationName,String operatorName, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getStationIntervalPage(String chargingStationIds,String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 运营商统计 - * @param operatorName 运营商名称 + * @param operatorIds 运营商集合 * @param operatorId 运营商id * @param startTime 订单开始时间 * @param endTime 订单结束时间 @@ -61,12 +63,12 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getOperatorIntervalPage(String operatorName,Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getOperatorIntervalPage(String operatorIds,Long operatorId, String startTime, String endTime, Long userId, Integer type); /** * 流量方统计 - * @param internetUserName 流量方名称 + * @param internetUserIds 流量方集合 * @param internetUserId 流量方id * @param startTime 订单开始时间 * @param endTime 订单结束时间 @@ -74,13 +76,13 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getInternetUserIntervalPage(String internetUserName, Long internetUserId, String startTime, String endTime, Long userId, Integer type); + List> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type); /** * 终端统计 - * @param chargingStationName 电站名称 - * @param terminalName 电桩名称 + * @param chargingStationId 电站id + * @param terminalId 终端di * @param operatorId 运营商id * @param startTime 订单开始时间 * @param endTime 订单结束时间 @@ -88,6 +90,42 @@ public interface IXhpcStatisticsService { * @param type 1 平台 2 运营商 3流量方 * @return */ - List> getTerminalIntervalPage(String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime, Long userId, Integer type); + List> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type); + /** + * 电站列表 + * @param operatorId 运营商id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + AjaxResult getChargingStationList(Long operatorId,Long userId,Integer type); + + /** + * 运营商列表 + * @param operatorId 运营商id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + AjaxResult getOperatorList(Long operatorId,Long userId,Integer type); + + /** + * 流量方列表 + * @param internetUserId 流量方id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + AjaxResult getInternetUserIList(Long internetUserId,Long userId,Integer type); + + + /** + * 终端列表 + * @param chargingStationId 电站id + * @param userId 用户id + * @param type 1 平台 2 运营商 3流量方 + * @return + */ + AjaxResult getTerminalList(Long chargingStationId,Long userId,Integer type); } 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 index 22a9cd3d..101905e9 100644 --- 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 @@ -1,6 +1,7 @@ package com.xhpc.order.service.impl; +import com.xhpc.common.core.web.domain.AjaxResult; import com.xhpc.order.mapper.XhpcStatisticsServiceMapper; import com.xhpc.order.service.IXhpcStatisticsService; import org.springframework.beans.factory.annotation.Autowired; @@ -19,15 +20,15 @@ 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) { + public List> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } - List chargingPileId =new ArrayList<>(); - if(!"".equals(chargingPileIds) && chargingPileIds !=null){ - chargingPileId= Arrays.asList(chargingPileIds.split(",")); + List chargingStationId =new ArrayList<>(); + if(!"".equals(chargingStationIds) && chargingStationIds !=null){ + chargingStationId= Arrays.asList(chargingStationIds.split(",")); } - List> list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingPileId, internetUserId, operatorId, startTime, endTime, type); + List> list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, type); List> page =new ArrayList<>(); if(list !=null && list.size()>0){ for (int i = 1; i <=24 ; i++) { @@ -121,48 +122,86 @@ public class XhpcStatisticsServiceImpl implements IXhpcStatisticsService { return page; } @Override - public List> getDateIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } - List chargingPileId =new ArrayList<>(); - if(!"".equals(chargingPileIds) && chargingPileIds !=null){ - chargingPileId= Arrays.asList(chargingPileIds.split(",")); + List chargingStationId =new ArrayList<>(); + if(!"".equals(chargingStationIds) && chargingStationIds !=null){ + chargingStationId= Arrays.asList(chargingStationIds.split(",")); } - return xhpcStatisticsServiceMapper.getDateIntervalPage(chargingPileId, internetUserId, operatorId, startTime, endTime, type); + return xhpcStatisticsServiceMapper.getDateIntervalPage(chargingStationId, 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) { + public List> getStationIntervalPage(String chargingStationIds, String operatorIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if (getJudge(internetUserId, operatorId, type)){ return new ArrayList<>(); } - return xhpcStatisticsServiceMapper.getStationIntervalPage(stationName,operatorName,internetUserId,operatorId,startTime,endTime,type); + List chargingStationId =new ArrayList<>(); + if(!"".equals(chargingStationIds) && chargingStationIds !=null){ + chargingStationId= Arrays.asList(chargingStationIds.split(",")); + } + List operatorUserId =new ArrayList<>(); + if(!"".equals(operatorIds) && operatorIds !=null){ + operatorUserId= Arrays.asList(operatorIds.split(",")); + } + return xhpcStatisticsServiceMapper.getStationIntervalPage(chargingStationId,operatorUserId,internetUserId,operatorId,startTime,endTime,type); } @Override - public List> getOperatorIntervalPage(String operatorName, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getOperatorIntervalPage(String operatorIds, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if(getJudge(null,operatorId,type)){ return new ArrayList<>(); } - return xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorName, operatorId, startTime, endTime, type); + List operatorUserId =new ArrayList<>(); + if(!"".equals(operatorIds) && operatorIds !=null){ + operatorUserId= Arrays.asList(operatorIds.split(",")); + } + return xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, type); } @Override - public List> getInternetUserIntervalPage(String internetUserName, Long internetUserId, String startTime, String endTime, Long userId, Integer type) { + public List> getInternetUserIntervalPage(String internetUserIds, Long internetUserId, String startTime, String endTime, Long userId, Integer type) { if(getJudge(internetUserId,null,type)){ return new ArrayList<>(); } - return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetUserName, internetUserId, startTime, endTime, type); + List internetIds =new ArrayList<>(); + if(!"".equals(internetUserIds) && internetUserIds !=null){ + internetIds= Arrays.asList(internetUserIds.split(",")); + } + return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetIds, internetUserId, startTime, endTime, type); } @Override - public List> getTerminalIntervalPage(String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime, Long userId, Integer type) { + public List> getTerminalIntervalPage(String chargingStationId, String terminalId, Long operatorId, String startTime, String endTime, Long userId, Integer type) { if(getJudge(null,operatorId,type)){ return new ArrayList<>(); } - return xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationName, terminalName, operatorId, startTime, endTime, type); + return xhpcStatisticsServiceMapper.getTerminalIntervalPage(chargingStationId, terminalId, operatorId, startTime, endTime, type); + } + + @Override + public AjaxResult getChargingStationList(Long operatorId, Long userId, Integer type) { + return AjaxResult.success(xhpcStatisticsServiceMapper.getChargingStationList(operatorId, userId, type)); + } + + @Override + public AjaxResult getOperatorList(Long operatorId, Long userId, Integer type) { + + return AjaxResult.success(xhpcStatisticsServiceMapper.getOperatorList(operatorId, userId, type)); + } + + @Override + public AjaxResult getInternetUserIList(Long internetUserId, Long userId, Integer type) { + return AjaxResult.success(xhpcStatisticsServiceMapper.getInternetUserIList(internetUserId, userId, type)); + } + + @Override + public AjaxResult getTerminalList(Long chargingStationId, Long userId, Integer type) { + + return AjaxResult.success(xhpcStatisticsServiceMapper.getTerminalList(chargingStationId, userId, type)); } private boolean getJudge(Long internetUserId, Long operatorId, Integer type) { diff --git a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml index 7015e3f4..abd295bc 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -75,10 +75,10 @@ end time from xhpc_statistics_time_interval where del_flag=0 - - and charging_pile_id in - - #{chargingPileId} + + and charging_station_id in + + #{chargingStationId} @@ -113,10 +113,10 @@ DATE_FORMAT(create_time,'%Y-%m-%d') createTime from xhpc_statistics_station where del_flag=0 and type=1 - - and charging_pile_id in - - #{chargingPileId} + + and charging_station_id in + + #{chargingStationId} @@ -129,8 +129,8 @@ and internet_user_id=#{internetUserId} - group by create_time - order by create_time desc + group by DATE_FORMAT(create_time,'%Y-%m-%d') + order by DATE_FORMAT(create_time,'%Y-%m-%d') desc @@ -235,7 +246,12 @@ and ss.create_time <=#{endTime} - and ss.internet_user_id=#{internetUserId} + + and ss.internet_user_id + + #{internetId} + + and iu.name like concat('%', #{internetUserName}, '%') @@ -272,12 +288,57 @@ and ss.operator_id=#{operatorId} - - and cs.name like concat('%', #{chargingStationName}, '%') + + and cs.charging_station_id=#{chargingStationId} - - and te.name like concat('%', #{terminalName}, '%') + + and te.terminal_id=#{terminalId} group by ss.terminal_id + + + + + + + + +