package org.jeecg.modules.device.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.device.entity.BuDeviceOnline;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.device.model.DeviceRiskAnalysis;
import org.jeecg.modules.device.model.StatusData;
import org.jeecg.modules.statistics.model.LineStatistics;

import java.util.List;

/**
 * @Description: bu_device_online
 * @Author: jeecg-boot
 * @Date:   2024-05-09
 * @Version: V1.0
 */
public interface IBuDeviceOnlineService extends IService<BuDeviceOnline> {
    public List<BuDeviceOnline> getAllData();
    public List<BuDeviceOnline> getAllDataById(String deviceId);

    public IPage<BuDeviceOnline> getOnlineByDeviceId(Page<BuDeviceOnline> page, String deviceId);

    public BuDeviceOnline getDataByDeviceId(String deviceId);

    public List<BuDeviceOnline> getLastTimeData(String deviceId, String item);

    public List<StatusData> getDataByStatus(List<String> result);


    public int getRepairTotal(String year);
    public int getMaintainTotal(String year);
    public int getRepairComplete(String year);
    public int getMaintainComplete(String year);

    public int getAlarmStatus(String deviceName);
    public int getWarningStatus(String deviceName);
    public int getFaultStatus(String deviceName);
    public int getBearingStatus(String deviceName);
    public int getFaultDataNumber(String deviceId);

    public List<BuDeviceOnline> getAlarmStatusUnusual(String deviceName);
    public List<BuDeviceOnline> getWarningStatusUnusual(String deviceName);
    public List<BuDeviceOnline> getFaultStatusUnusual(String deviceName);
    public List<BuDeviceOnline> getBearingStatusUnusual(String deviceName);

    public List<LineStatistics> getTypeUnusual();
    public List<LineStatistics> getTypeUnusualByType(String typeId);
    public List<LineStatistics> getUnusual();
    public int getOneUnusual(String name,int month);

    public BuDeviceOnline getTimeData(String deviceName, String year, String month, int day);

    public List<BuDeviceOnline> getCalendarRemind(String deviceName, String year, String month, String day);

    public int queryDeviceRiskByTypeAndId(String date,String deviceType,String deviceId);

    public List<DeviceRiskAnalysis> queryDeviceRisk(String year);

    public List<DeviceRiskAnalysis> getDeviceByType(String typeId);
    public List<DeviceRiskAnalysis> getDevice();
    public List<DeviceRiskAnalysis> queryDeviceRiskByDeviceIds(String[] deviceIds,String year);

    public List<DeviceRiskAnalysis> queryDeviceRiskByType(String type,String year);

    public List<DeviceRiskAnalysis> getAirQuality();

    public DeviceRiskAnalysis getAirQualityOnline(String deviceId);

    public DeviceRiskAnalysis getAirQualityOnlineList(String deviceId);

    public List<DeviceRiskAnalysis> getDeviceTypeEnergy(String year,String month);

    public DeviceRiskAnalysis getYearRunTime(String year,String deviceId);
    public DeviceRiskAnalysis getMonthRunTime(String year,String month,String deviceId);
    public DeviceRiskAnalysis getDayRunTime(String year,String month,String day,String deviceId);
    public DeviceRiskAnalysis getYearRiskCount(String year,String deviceId);
    public DeviceRiskAnalysis getMonthRiskCount(String year,String month,String deviceId);
    public DeviceRiskAnalysis getDayRiskCount(String year,String month,String day,String deviceId);
}
