package com.xhpc.card.mapper;

import com.xhpc.card.pojo.XhpcChargingStation;
import org.apache.ibatis.annotations.Param;

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

public interface XhpcChargingStationMapper {

    int deleteByPrimaryKey(Long chargingStationId);

    int insert(XhpcChargingStation record);

    int insertSelective(XhpcChargingStation record);

    XhpcChargingStation selectByPrimaryKey(Long chargingStationId);

    int updateByPrimaryKeySelective(XhpcChargingStation record);

    int updateByPrimaryKey(XhpcChargingStation record);

    /**
     * @author WH
     * @date 2022/2/28 17:50
     * @since version-1.0
     */
    List<Map<String, Object>> selectByTenantIdAndChargingStationId(@Param("tenantIdsStr") String tenantIdsStr, @Param("chargingStationId") Long chargingStationId);

    List<Map<String, Object>> returnCoreChargingStation(@Param("tenantIdsStr") String tenantIdsStr, @Param("chargingStationId") Long chargingStationId, @Param("areaCode") Integer areaCode,@Param("number") Integer number);

    /**
     * @author WH
     * @date 2022/3/3 15:20
     * @since version-1.0
     */
    List<Map<String, Object>> selectByTenantIdAndAreaCode(@Param("tenantIdsStr") String tenantIdsStr, @Param("areaCode") Integer areaCode,@Param("number") Integer number);

    int getXhpcAreaLevel(@Param("areaCode")Integer areaCode);

    /**
     * query id of charging station by list of tenant id
     *
     * @author WH
     * @date 2022/3/4 11:21
     * @since version-1.0
     */
    List<Long> selectChargingStationIds(@Param("tenantIdsStr") String tenantIdsStr);


    /**
     *  查询枪的使用率
     */
    List<String> getTerminal(@Param("chargingStationIds")List<Long> chargingStationIds,@Param("tenantIdsStr")String tenantIdsStr);

    /**
     *  查询枪的使用率
     */
    List<Map<String, Object>> getWorkOrderTerminal(@Param("chargingStationIds")List<Long> chargingStationIds,@Param("tenantIdsStr")String tenantIdsStr);

}