统计新增列表

This commit is contained in:
yuyang 2021-09-06 16:15:37 +08:00
parent d690d99ab6
commit 0ce055e9b0
5 changed files with 328 additions and 87 deletions

View File

@ -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<Map<String, Object>> list = xhpcStatisticsService.getTimeIntervalPage(chargingPileIds,internetUserId,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getDateIntervalPage(chargingPileIds,internetUserId,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getStationIntervalPage(stationName,operatorName,internetUserId,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getOperatorIntervalPage(operatorName,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getInternetUserIntervalPage(internetUserName,internetUserId,startTime,endTime,userId,type);
List<Map<String, Object>> 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<Map<String, Object>> list = xhpcStatisticsService.getTerminalIntervalPage(chargingStationName,terminalName,operatorId,startTime,endTime,userId,type);
List<Map<String, Object>> 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);
}
}

View File

@ -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<Map<String, Object>> getTimeIntervalPage(@Param("chargingPileIds") List<String> chargingPileIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type);
List<Map<String, Object>> getTimeIntervalPage(@Param("chargingStationIds") List<String> 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<Map<String, Object>> getDateIntervalPage(@Param("chargingPileIds") List<String> chargingPileIds,@Param("internetUserId") Long internetUserId,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type);
List<Map<String, Object>> getDateIntervalPage(@Param("chargingStationIds") List<String> 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<Map<String, Object>> 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<Map<String, Object>> getStationIntervalPage(@Param("chargingStationIds") List<String> chargingStationIds,@Param("operatorUserId") List<String> 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<Map<String, Object>> getOperatorIntervalPage(@Param("operatorName") String operatorName,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type);
List<Map<String, Object>> getOperatorIntervalPage(@Param("operatorUserId") List<String> 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<Map<String, Object>> getInternetUserIntervalPage(@Param("internetUserName") String internetUserName,@Param("internetUserId") Long internetUserId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("type") Integer type);
List<Map<String, Object>> getInternetUserIntervalPage(@Param("internetIds") List<String> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> 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<Map<String, Object>> getTerminalList(@Param("chargingStationId")Long chargingStationId,@Param("userId")Long userId,@Param("type")Integer type);
}

View File

@ -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<Map<String, Object>> getTimeIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getDateIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getStationIntervalPage(String stationName,String operatorName, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getOperatorIntervalPage(String operatorName,Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getInternetUserIntervalPage(String internetUserName, Long internetUserId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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<Map<String, Object>> getTerminalIntervalPage(String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime, Long userId, Integer type);
List<Map<String, Object>> 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);
}

View File

@ -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<Map<String, Object>> getTimeIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> getTimeIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
if (getJudge(internetUserId, operatorId, type)){
return new ArrayList<>();
}
List<String> chargingPileId =new ArrayList<>();
if(!"".equals(chargingPileIds) && chargingPileIds !=null){
chargingPileId= Arrays.asList(chargingPileIds.split(","));
List<String> chargingStationId =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationId= Arrays.asList(chargingStationIds.split(","));
}
List<Map<String, Object>> list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingPileId, internetUserId, operatorId, startTime, endTime, type);
List<Map<String, Object>> list = xhpcStatisticsServiceMapper.getTimeIntervalPage(chargingStationId, internetUserId, operatorId, startTime, endTime, type);
List<Map<String, Object>> 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<Map<String, Object>> getDateIntervalPage(String chargingPileIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> getDateIntervalPage(String chargingStationIds, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
if (getJudge(internetUserId, operatorId, type)){
return new ArrayList<>();
}
List<String> chargingPileId =new ArrayList<>();
if(!"".equals(chargingPileIds) && chargingPileIds !=null){
chargingPileId= Arrays.asList(chargingPileIds.split(","));
List<String> 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<Map<String, Object>> getStationIntervalPage(String stationName, String operatorName, Long internetUserId, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<String> chargingStationId =new ArrayList<>();
if(!"".equals(chargingStationIds) && chargingStationIds !=null){
chargingStationId= Arrays.asList(chargingStationIds.split(","));
}
List<String> 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<Map<String, Object>> getOperatorIntervalPage(String operatorName, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<String> operatorUserId =new ArrayList<>();
if(!"".equals(operatorIds) && operatorIds !=null){
operatorUserId= Arrays.asList(operatorIds.split(","));
}
return xhpcStatisticsServiceMapper.getOperatorIntervalPage(operatorUserId, operatorId, startTime, endTime, type);
}
@Override
public List<Map<String, Object>> getInternetUserIntervalPage(String internetUserName, Long internetUserId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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<String> internetIds =new ArrayList<>();
if(!"".equals(internetUserIds) && internetUserIds !=null){
internetIds= Arrays.asList(internetUserIds.split(","));
}
return xhpcStatisticsServiceMapper.getInternetUserIntervalPage(internetIds, internetUserId, startTime, endTime, type);
}
@Override
public List<Map<String, Object>> getTerminalIntervalPage(String chargingStationName, String terminalName, Long operatorId, String startTime, String endTime, Long userId, Integer type) {
public List<Map<String, Object>> 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) {

View File

@ -75,10 +75,10 @@
end time
from xhpc_statistics_time_interval
where del_flag=0
<if test="chargingPileIds !=null and chargingPileIds.size()>0">
and charging_pile_id in
<foreach collection="chargingPileIds" open="(" item="chargingPileId" separator="," close=")" >
#{chargingPileId}
<if test="chargingStationIds !=null and chargingStationIds.size()>0">
and charging_station_id in
<foreach collection="chargingStationIds" open="(" item="chargingStationId" separator="," close=")" >
#{chargingStationId}
</foreach>
</if>
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
@ -113,10 +113,10 @@
DATE_FORMAT(create_time,'%Y-%m-%d') createTime
from xhpc_statistics_station
where del_flag=0 and type=1
<if test="chargingPileIds !=null and chargingPileIds.size()>0">
and charging_pile_id in
<foreach collection="chargingPileIds" open="(" item="chargingPileId" separator="," close=")" >
#{chargingPileId}
<if test="chargingStationIds !=null and chargingStationIds.size()>0">
and charging_station_id in
<foreach collection="chargingStationIds" open="(" item="chargingStationId" separator="," close=")" >
#{chargingStationId}
</foreach>
</if>
<if test="startTime !=null and startTime !='' and endTime !=null and endTime !=''">
@ -129,8 +129,8 @@
<if test="type==3">
and internet_user_id=#{internetUserId}
</if>
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
</select>
<select id="getStationIntervalPage" resultType="map">
@ -165,8 +165,17 @@
<if test="type==3">
and ss.internet_user_id=#{internetUserId}
</if>
<if test="stationName !=null and stationName !=''">
and cs.name like concat('%', #{stationName}, '%')
<if test="chargingStationIds !=null and chargingStationIds.size()>0">
and charging_station_id in
<foreach collection="chargingStationIds" open="(" item="chargingStationId" separator="," close=")" >
#{chargingStationId}
</foreach>
</if>
<if test="operatorUserId !=null and operatorUserId.size()>0">
and operator_id in
<foreach collection="operatorUserId" open="(" item="operatorId" separator="," close=")" >
#{operatorId}
</foreach>
</if>
<if test="operatorName !=null and operatorName !=''">
and op.name like concat('%', #{operatorName}, '%')
@ -199,14 +208,16 @@
and ss.create_time &lt;=#{endTime}
</if>
<if test="type==2">
and ss.operator_id=#{operatorId}
<if test="operatorUserId !=null and operatorUserId.size()>0">
and ss.operator_id in
<foreach collection="operatorUserId" open="(" item="operatorId" separator="," close=")" >
#{operatorId}
</foreach>
</if>
</if>
<if test="type==3">
and ss.internet_user_id=#{internetUserId}
</if>
<if test="operatorName !=null and operatorName !=''">
and op.name like concat('%', #{operatorName}, '%')
</if>
group by ss.operator_id
</select>
@ -235,7 +246,12 @@
and ss.create_time &lt;=#{endTime}
</if>
<if test="type==3">
and ss.internet_user_id=#{internetUserId}
<if test="internetIds !=null and internetIds.size()>0">
and ss.internet_user_id
<foreach collection="internetIds" open="(" item="internetId" separator="," close=")" >
#{internetId}
</foreach>
</if>
</if>
<if test="internetUserName !=null and internetUserName !=''">
and iu.name like concat('%', #{internetUserName}, '%')
@ -272,12 +288,57 @@
<if test="type==2">
and ss.operator_id=#{operatorId}
</if>
<if test="chargingStationName !=null and chargingStationName !=''">
and cs.name like concat('%', #{chargingStationName}, '%')
<if test="chargingStationId !=null">
and cs.charging_station_id=#{chargingStationId}
</if>
<if test="terminalName !=null and terminalName !=''">
and te.name like concat('%', #{terminalName}, '%')
<if test="terminalId !=null">
and te.terminal_id=#{terminalId}
</if>
group by ss.terminal_id
</select>
<select id="getChargingStationList" resultType="map">
select
name as stationName,
charging_station_id as chargingStationId
from xhpc_charging_station
where 1=1
<if test="type==2">
and operator_id =#{operatorId}
</if>
</select>
<select id="getOperatorList" resultType="map">
select
operator_id as operatorId,
name as operatorName
from xhpc_operator
where 1=1
<if test="type==2">
and operator_id =#{operatorId}
</if>
</select>
<select id="getInternetUserIList" resultType="map">
select
internet_user_id as operinternetUserId,
name as operinternetUserName
from xhpc_internet_user
where 1=1
<if test="type==2">
and internet_user_id =#{internetUserId}
</if>
</select>
<select id="getTerminalList" resultType="map">
select
terminal_id as terminalId,
name as terminalName
from xhpc_terminal
where 1=1
<if test="chargingStationId !=null">
and charging_station_id =#{chargingStationId}
</if>
</select>
</mapper>