package com.ho.business.service;


import com.ho.business.entity.DeviceCall;
import com.ho.business.vo.req.DeviceReqVO;
import com.ho.business.vo.req.device.DeviceIntervalReqVo;
import com.ho.business.vo.req.device.DeviceTreeReq;
import com.ho.business.vo.resp.DeviceRespVO;
import com.ho.business.vo.resp.cabin.TemperatureVoltageResp;
import com.ho.business.vo.resp.chargepile.ChargePileRespVO;
import com.ho.common.tools.util.PageResult;

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

/**
* @author yule
* @description 针对表【device】的数据库操作Service
* @createDate 2022-08-25 16:11:14
*/
public interface DeviceCallService {

    PageResult<DeviceRespVO> getPageListByInfo(DeviceReqVO deviceReqVO);

    /**
     * 根据deviceType，返回同一类型的设备
     * @param deviceReqVO
     * @return
     */
    List<DeviceRespVO> getListByDeviceType(DeviceReqVO deviceReqVO);

    List<DeviceRespVO> getListByInfo(List<String> deviceTypeList,DeviceReqVO deviceReqVO);

    List<DeviceRespVO> getList(DeviceReqVO deviceReqVO);

    //电站的设备类型
    List<DeviceRespVO> getListByDeviceType(Integer stationId, String deviceType);

    List<DeviceRespVO> getListByDeviceTypeAndPid(Integer stationId,Integer pid, String deviceType);

    //入库新增
    int insertSelective(DeviceCall device);

    //修改充电桩
    int updateChargePile(DeviceCall device);

    int updateDevice(DeviceCall device);

    DeviceCall selectById(Integer id);


    List<ChargePileRespVO> selectBySrcIds(Integer stationId, List<Integer> srcIds);

    DeviceRespVO getDeviceRespVO(Integer id);

    //根据电站id和srcId查询
    DeviceCall selectByStationIdAndSrcId(Integer stationId,Integer srcId);

    List<DeviceRespVO> selectByGroup(Integer groupId);

    List<String> selectDistinctDeviceTypeByStationId(Integer stationId);

    List<DeviceRespVO> getDeviceByStationId(Integer stationId);

    List<DeviceRespVO> getDeviceByStationIds(List<Integer> stationIds);

    List<DeviceRespVO> selectByIds(List<Integer> deviceIds);

    List<DeviceRespVO> selectByStation(Integer stationId);

    /**
     * 根据电站id和设备的pid查询设备
     * @param stationId 电站id
     * @param pId 设备的父id
     * @return
     */
    List<DeviceRespVO> selectByStationIdAndPId(Integer stationId, Integer pId);

    /**
     * 判断设备是否在线
     * @param device 设备
     * @return
     */
    boolean isOnLine(DeviceCall device);

    List<DeviceRespVO> getIntervalDevice(DeviceIntervalReqVo vo);

    /**
     * 根据电站id以及设备srcId查询设备
     * @param map (k = 电站id,v = 设备srcId集合)
     * @return
     */
    List<DeviceRespVO> selectByStationIdAndSrcIds(Map<Integer, List<Integer>> map);

    /**
     * 根据电站id查询设备srcId不为0的
     * @param stationId
     * @return
     */
    List<DeviceRespVO> selectByIdAndSrcIdNotZero(Integer stationId);

    /**
     * 查询设备需要设备接入点
     * @param stationId
     * @return
     */
    List<DeviceRespVO> selectDeviceByStationId(Integer stationId);

    /**
     * 获取电压电流正太分布数据
     * @return
     */
    TemperatureVoltageResp getTemperatureVoltageData(DeviceTreeReq vo);

}
