package org.jeecg.modules.device.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.device.entity.BuDeviceOnline;
import org.jeecg.modules.device.mapper.BuDeviceOnlineMapper;
import org.jeecg.modules.device.model.DeviceRiskAnalysis;
import org.jeecg.modules.device.model.StatusData;
import org.jeecg.modules.device.service.IBuDeviceOnlineService;
import org.jeecg.modules.statistics.model.LineStatistics;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Description: bu_device_online
 * @Author: jeecg-boot
 * @Date:   2024-05-09
 * @Version: V1.0
 */
@Service
public class BuDeviceOnlineServiceImpl extends ServiceImpl<BuDeviceOnlineMapper, BuDeviceOnline> implements IBuDeviceOnlineService {
    @Autowired
    private BuDeviceOnlineMapper deviceOnlineMapper;
    @Override
    public List<BuDeviceOnline> getAllData() {
        return deviceOnlineMapper.getAllData();
    }
    @Override
    public List<BuDeviceOnline> getAllDataById(String deviceId) {
        return deviceOnlineMapper.getAllDataById(deviceId);
    }

    // 根据角色Id查询
    @Override
    public IPage<BuDeviceOnline> getOnlineByDeviceId(Page<BuDeviceOnline> page, String deviceId) {
        return deviceOnlineMapper.getOnlineByDeviceId(page,deviceId);
    }

    @Override
    public BuDeviceOnline getDataByDeviceId(String deviceId){
        return deviceOnlineMapper.getDataByDeviceId(deviceId);
    }

    @Override
    public List<BuDeviceOnline> getLastTimeData(String deviceId,String item){
        return deviceOnlineMapper.getLastTimeData(deviceId,item);
    }

    @Override
    public List<StatusData> getDataByStatus(List<String> result){
        return deviceOnlineMapper.getDataByStatus(result);
    }


    @Override
    public int getRepairTotal(String year){
        return deviceOnlineMapper.getRepairTotal(year);
    }
    @Override
    public int getMaintainTotal(String year){
        return deviceOnlineMapper.getMaintainTotal(year);
    }
    @Override
    public int getRepairComplete(String year){
        return deviceOnlineMapper.getRepairComplete(year);
    }
    @Override
    public int getMaintainComplete(String year) { return deviceOnlineMapper.getMaintainComplete(year); }

    @Override
    public int getAlarmStatus(String deviceName) { return deviceOnlineMapper.getAlarmStatus(deviceName); }
    @Override
    public int getWarningStatus(String deviceName) { return deviceOnlineMapper.getWarningStatus(deviceName); }
    @Override
    public int getFaultStatus(String deviceName) { return deviceOnlineMapper.getFaultStatus(deviceName); }
    @Override
    public int getBearingStatus(String deviceName) { return deviceOnlineMapper.getBearingStatus(deviceName); }
    @Override
    public int getFaultDataNumber(String deviceId) { return deviceOnlineMapper.getFaultDataNumber(deviceId); }

    @Override
    public List<BuDeviceOnline> getAlarmStatusUnusual(String deviceName) { return deviceOnlineMapper.getAlarmStatusUnusual(deviceName); }
    @Override
    public List<BuDeviceOnline> getWarningStatusUnusual(String deviceName) { return deviceOnlineMapper.getWarningStatusUnusual(deviceName); }
    @Override
    public List<BuDeviceOnline> getFaultStatusUnusual(String deviceName) { return deviceOnlineMapper.getFaultStatusUnusual(deviceName); }
    @Override
    public List<BuDeviceOnline> getBearingStatusUnusual(String deviceName) { return deviceOnlineMapper.getBearingStatusUnusual(deviceName); }

    @Override
    public List<LineStatistics> getTypeUnusual(){
        return deviceOnlineMapper.getTypeUnusual();
    }
    @Override
    public List<LineStatistics> getTypeUnusualByType(String typeId){
        return deviceOnlineMapper.getTypeUnusualByType(typeId);
    }
    @Override
    public List<LineStatistics> getUnusual(){
        return deviceOnlineMapper.getUnusual();
    }
    @Override
    public int getOneUnusual(String name,int month){
        return deviceOnlineMapper.getOneUnusual(name,month);
    }

    @Override
    public BuDeviceOnline getTimeData(String deviceName, String year, String month, int day) {
        return deviceOnlineMapper.getTimeData(deviceName,year,month,day);
    }

    @Override
    public List<BuDeviceOnline> getCalendarRemind(String deviceName, String year, String month, String day) {
        return deviceOnlineMapper.getCalendarRemind(deviceName,year,month,day);
    }

    @Override
    public int queryDeviceRiskByTypeAndId(String date,String deviceType,String deviceId) {
        return deviceOnlineMapper.queryDeviceRiskByTypeAndId(date,deviceType,deviceId);
    }

    @Override
    public List<DeviceRiskAnalysis> queryDeviceRisk(String year) {
        return List.of();
    }

    @Override
    public List<DeviceRiskAnalysis> getDeviceByType(String typeId) {
        return deviceOnlineMapper.getDeviceByType(typeId);
    }
    @Override
    public List<DeviceRiskAnalysis> getDevice() {
        return deviceOnlineMapper.getDevice();
    }
    @Override
    public List<DeviceRiskAnalysis> queryDeviceRiskByDeviceIds(String[] deviceIds,String year) {
        return deviceOnlineMapper.queryDeviceRiskByDeviceIds(deviceIds,year);
    }
    @Override
    public List<DeviceRiskAnalysis> queryDeviceRiskByType(String type,String year) {
        return deviceOnlineMapper.queryDeviceRiskByType(type,year);
    }
    @Override
    public List<DeviceRiskAnalysis> getAirQuality() {
        return deviceOnlineMapper.getAirQuality();
    }

    @Override
    public DeviceRiskAnalysis getAirQualityOnline(String deviceId) {
        return deviceOnlineMapper.getAirQualityOnline(deviceId);
    }

    @Override
    public DeviceRiskAnalysis getAirQualityOnlineList(String deviceId) {
        return deviceOnlineMapper.getAirQualityOnlineList(deviceId);
    }

    @Override
    public List<DeviceRiskAnalysis> getDeviceTypeEnergy(String year,String month) {
        return deviceOnlineMapper.getDeviceTypeEnergy(year,month);
    }
    @Override
    public DeviceRiskAnalysis getYearRunTime(String year,String deviceId) {
        return deviceOnlineMapper.getYearRunTime(year,deviceId);
    }

    @Override
    public DeviceRiskAnalysis getMonthRunTime(String year,String month,String deviceId) {
        return deviceOnlineMapper.getMonthRunTime(year,month,deviceId);
    }

    @Override
    public DeviceRiskAnalysis getDayRunTime(String year,String month,String day,String deviceId) {
        return deviceOnlineMapper.getDayRunTime(year,month,day,deviceId);
    }

    @Override
    public DeviceRiskAnalysis getYearRiskCount(String year,String deviceId) {
        return deviceOnlineMapper.getYearRiskCount(year,deviceId);
    }

    @Override
    public DeviceRiskAnalysis getMonthRiskCount(String year,String month,String deviceId) {
        return deviceOnlineMapper.getMonthRiskCount(year,month,deviceId);
    }

    @Override
    public DeviceRiskAnalysis getDayRiskCount(String year,String month,String day,String deviceId) {
        return deviceOnlineMapper.getDayRiskCount(year,month,day,deviceId);
    }
}
