package com.xhpc.order.mapper;

import com.xhpc.order.domain.XhpcChargeOrderCurrent;
import com.xhpc.order.domain.XhpcChargeOrderSoc;
import com.xhpc.order.domain.XhpcChargeOrderVoltage;
import com.xhpc.order.domain.XhpcRealTimeOrder;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author yuyang
 * @date 2021/8/7 15:09
 */
public interface XhpcRealTimeOrderMapper {

    /**
     * 添加实时充电订单
     * @param xhpcRealTimeOrder
     * @return
     */
    int addXhpcRealTimeOrder(XhpcRealTimeOrder xhpcRealTimeOrder);


    /**
     * 添加订单实时SOC
     * @param xhpcChargeOrderSoc
     * @return
     */
    int addSOC(XhpcChargeOrderSoc xhpcChargeOrderSoc);

    /**
     * 添加订单实时电流
     * @param XhpcChargeOrderCurrent
     * @return
     */
    int addCurrent(XhpcChargeOrderCurrent XhpcChargeOrderCurrent);

    /**
     * 添加订单实时电压
     * @param xhpcChargeOrderVoltage
     * @return
     */
    int addVoltage(XhpcChargeOrderVoltage xhpcChargeOrderVoltage);


    /**
     * 实时订单接口
     * @param phone                       用户账号
     * @param transactionNumber           订单编号
     * @param source                      用户类型  0C端用户 1流量用户
     * @param chargingStationName         电站名称
     * @param terminalName                终端名称
     * @param operatorId                  运营商
     * @param startTime                   订单开始时间
     * @param endTime                     订单结束时间
     * @param number                        0 都没有 1 phone 有  2 用户类型有  3 都有
     * @return
     */
    List<Map<String,Object>> list(@Param("phone") String phone,@Param("transactionNumber") String transactionNumber,@Param("source") Integer source,@Param("chargingStationName") String chargingStationName,@Param("terminalName")String terminalName,@Param("operatorId") Long operatorId,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("number") Integer number,@Param("status")Integer status,@Param("userId")Long userId,@Param("type")Integer type,
                                  @Param("affiliationOrganization")String affiliationOrganization,@Param("plateNum")String plateNum,@Param("internetId")Integer internetId,@Param("internetSerialNumber")String internetSerialNumber);

    /**
     * 实时订单详情接口(PC端)
     * @param realTimeOrderId
     * @return
     */
    Map<String,Object> getMessage(@Param("realTimeOrderId")Long realTimeOrderId);


    /**
     * 实时订单详情数据列表（PC）
     * @param chargingOrderId
     * @return
     */
    List<Map<String,Object>> timeList(@Param("chargingOrderId")Long chargingOrderId);

    /**
     * 实时订单详情数据图表SOC（PC）
     * @param chargingOrderId
     * @return
     */
    Map<String,Object> timeChartSOCList(Long chargingOrderId);

    /**
     * 实时订单详情数据图表电压（PC）
     * @param chargingOrderId
     * @return
     */
    Map<String,Object> timeChartVoltageList(Long chargingOrderId);

    /**
     * 实时订单详情数据图表电流（PC）
     * @param chargingOrderId
     * @return
     */
    Map<String,Object> timeChartCurrentList(Long chargingOrderId);

    /**
     * 删除之前的实时订单数据
     */
    void deleteRealTimeOrder(@Param("chargingOrderId")Long chargingOrderId);

    void deleteChargeVoltage(@Param("chargingOrderId")Long chargingOrderId);

    void deleteChargeOrderSoc(@Param("chargingOrderId")Long chargingOrderId);

    void deleteChargeOrderCurrent(@Param("chargingOrderId")Long chargingOrderId);

    /**
     * 获取一条实时数据
     */
    XhpcRealTimeOrder getChargingOrderId(@Param("chargingOrderId")Long chargingOrderId,@Param("type")Integer type);

    Map<String,Object> getChargeOrderById(@Param("chargingOrderId")Long chargingOrderId);


    /**
     * 根据第三方平台及监管平台的operatorId 查询
     * @param operatorIdEvcs
     * @return
     */
    Map<String, Object> getOperatorIdEvcs(String operatorIdEvcs);
}
