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 5efbd8e5..782379a6 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 @@ -296,7 +296,7 @@ public interface IXhpcStatisticsService { List> getTodayTerminal(Long operatorId,Long chargingStationId,Long chargingPileId); /** - * 今日电枪实时状态 + * 充电数据 * * @param state 1 充电数据 2.创建订单量 */ 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 163fd844..415d6fc0 100644 --- a/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml +++ b/xhpc-modules/xhpc-order/src/main/resources/mapper/XhpcStatisticsMapper.xml @@ -1310,12 +1310,40 @@ ifnull(sum(total_price),0) totalPrice, ifnull(sum(power_price_total),0) powerPriceTotal, ifnull(sum(service_price_total),0)servicePriceTotal, - - date_format(end_time, '%Y-%m') time - - - DATE_FORMAT(end_time, '%Y-%m-%d') time - + format(ifnull(sum(total_power)/ + (select count(history_order_id) from xhpc_history_order + where end_time >=#{beginOfDay} and end_time <= #{endOfDay} and total_price !=0 + + and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{operatorId}) + + + and tenant_id = #{tenantId} + + + and charging_station_id=#{chargingStationId} + + + and terminal_id in (select terminal_id from xhpc_terminal where charging_pile_id=#{chargingPileId}) + + + and charging_station_id in (select charging_station_id from xhpc_charging_station where operator_id=#{logOperatorId}) + + + and charging_station_id in (select charging_station_id from xhpc_user_privilege where user_id=#{logOperatorId}) + + + GROUP BY date_format(end_time, '%Y-%m') + + + GROUP BY DATE_FORMAT(end_time, '%Y-%m-%d') + + ),0), 3) averagePower, + + date_format(end_time, '%Y-%m') time + + + DATE_FORMAT(end_time, '%Y-%m-%d') time + from xhpc_history_order where end_time >=#{beginOfDay} and end_time <= #{endOfDay}