package org.jeecg.modules.device.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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 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 BuDeviceOnlineMapper extends BaseMapper<BuDeviceOnline> {
    public List<BuDeviceOnline> getAllData();
    public List<BuDeviceOnline> getAllDataById(@Param("deviceId") String deviceId);

    IPage<BuDeviceOnline> getOnlineByDeviceId(Page page, @Param("deviceId") String deviceId);

    public BuDeviceOnline getDataByDeviceId(@Param("deviceId") String deviceId);

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

    public List<StatusData> getDataByStatus(@Param("result") List<String> result);



    public int getRepairTotal(@Param("year") String year);
    public int getMaintainTotal(@Param("year") String year);
    public int getRepairComplete(@Param("year") String year);
    public int getMaintainComplete(@Param("year") String year);

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

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

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

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

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

    public List<DeviceRiskAnalysis> queryDeviceRisk(@Param("year") String year);

    public List<DeviceRiskAnalysis> getDeviceByType(@Param("typeId") String typeId);

    public List<DeviceRiskAnalysis> getDevice();
    public List<DeviceRiskAnalysis> queryDeviceRiskByDeviceIds(@Param("deviceIds") String[] deviceIds,@Param("year") String year);
    public List<DeviceRiskAnalysis> queryDeviceRiskByType(@Param("type") String type,@Param("year") String year);
    public int queryDeviceRiskByTypeAndId(@Param("date") String date,@Param("deviceType") String deviceType,@Param("deviceId") String deviceId);
    public List<DeviceRiskAnalysis> getAirQuality();
    public DeviceRiskAnalysis getAirQualityOnline(@Param("deviceId") String deviceId);
    public DeviceRiskAnalysis getAirQualityOnlineList(@Param("deviceId") String deviceId);
    public List<DeviceRiskAnalysis> getDeviceTypeEnergy(@Param("year")String year,@Param("month")String month);

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


}
