package com.xhpc.pp.mapper;


import com.xhpc.evcs.cdjgpc.dto.*;
import com.xhpc.evcs.domain.XhpcChargingPile;
import com.xhpc.pp.domain.XhpcDeviceMessage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface XhpcDeviceMessageMapper {

    int insertByDomain(XhpcDeviceMessage xhpcDeviceMessage);

    //桩离线统计
    int insertChargingPileStatus(@Param("serialNumber") String serialNumber,@Param("pileSerialNumber") String pileSerialNumber,@Param("stationId")String stationId,@Param("statusName")String statusName);
    void deleteByLastThreeMonth(String expireDate);

    XhpcChargingPile getXhpcChargingPile(@Param("pileNo") String pileNo);

    CDStationInfo getXhpcChargingStation(@Param("chargingStationId") Long chargingStationId);

    //统计电站--枪电量
    double getConnectorEquipmentElectricity(@Param("stationId")Long stationId,@Param("chargingPileId")Long chargingPileId,@Param("terminalId")Long terminalId,@Param("startTime")String startTime,@Param("endTime")String endTime);
    //统计电站--桩电量
    double getEquipmentEquipmentElectricity(@Param("stationId")Long stationId,@Param("chargingPileId")Long chargingPileId,@Param("startTime")String startTime,@Param("endTime")String endTime);
    //查询站点统计信息
    CDStationStatslnfo getStationEquipmentElectricity(@Param("stationId")Long stationId, @Param("startTime")String startTime, @Param("endTime")String endTime);

    //查询充电设备运行统计信息
    CDSuqEquipmentStatslnfo getSupEquipmentStatsInfo(@Param("stationId")Long stationId, @Param("chargingPileId")Long chargingPileId, @Param("startTime")String startTime, @Param("endTime")String endTime);


    List<CDSupConnectorStatslnfo> getSupConnectorStatslnfo(@Param("stationId")Long stationId, @Param("chargingPileId")Long chargingPileId, @Param("startTime")String startTime, @Param("endTime")String endTime);


    List<Long> getStationId();

    //获取桩id
    List<Long> getchargingPileId(@Param("stationId")Long stationId);

    //获取枪
    List<Long> getterminalId(@Param("stationId")Long stationId,@Param("chargingPileId")Long chargingPileId);

    //查询电站费率变化
    List<CDChargeFeeDetail> getNotificationStationFee(@Param("stationId")Long stationId);

    //获取场站当前时间实时功率
    List<CDSupStationPowerInfo> getSuperviseQueryStationPowerInfo(@Param("stationIds")List<Long> stationIds,@Param("subTime")String subTime,@Param("number")Integer number);

    //获取桩当前时间实时功率
    List<CDSupEquipmentPowerInfo> getPileSuperviseQueryStationPowerInfo(@Param("chargingStationId")Long chargingStationId, @Param("subTime")String subTime, @Param("number")Integer number);

    //获取枪当前时间实时功率
    List<CDSupConnectorPowerInfo> getTerminalSuperviseQueryStationPowerInfo(@Param("chargingPileId")Long chargingPileId,@Param("subTime")String subTime,@Param("number")Integer number);

    //获取充电事故
    List<CDSupEquipmentAccidentInfo> getSuperviseQueryAccidentInfo();

    //充电站统计信息
    List<CDStationStatslnfo> getCDStationStatslnfoList(@Param("startTime")String startTime,@Param("endTime")String endTime);


    //设置电桩最大功率
    void updateXhpcChargingPile(@Param("serialNumber")String serialNumber,@Param("powerNumber")Integer powerNumber);

}
