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

import org.jeecg.modules.device.entity.BuDeviceRunTime;
import org.jeecg.modules.device.mapper.BuDeviceRunTimeMapper;
import org.jeecg.modules.device.service.IBuDeviceRunTimeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

/**
 * @Description: 设备实际运行时间表
 * @Author: jeecg-boot
 * @Date:   2024-06-01
 * @Version: V1.0
 */
@Service
public class BuDeviceRunTimeServiceImpl extends ServiceImpl<BuDeviceRunTimeMapper, BuDeviceRunTime> implements IBuDeviceRunTimeService {

    @Autowired
    private BuDeviceRunTimeMapper buDeviceRunTimeMapper;

    @Override
    public BuDeviceRunTime getByIdLimit(String deviceId){
        return buDeviceRunTimeMapper.getByIdLimit(deviceId);
    }

    @Override
    public String getSumPower(int year,int month){
        return buDeviceRunTimeMapper.getSumPower(year,month);
    }
    @Override
    public String getSumPowerByType(int year,int month,String deviceType){
        return buDeviceRunTimeMapper.getSumPowerByType(year,month,deviceType);
    }
    @Override
    public String getSumPowerByDevice(int year,int month,String deviceId){
        return buDeviceRunTimeMapper.getSumPowerByDevice(year,month,deviceId);
    }


    @Override
    public String getSumTime(int year,int month,int day){
        return buDeviceRunTimeMapper.getSumTime(year,month,day);
    }
    @Override
    public String getSumTimeByType(int year,int month,int day,String deviceType){
        return buDeviceRunTimeMapper.getSumTimeByType(year,month,day,deviceType);
    }
    @Override
    public String getSumTimeByDevice(int year,int month,int day,String deviceId){
        return buDeviceRunTimeMapper.getSumTimeByDevice(year,month,day,deviceId);
    }
    @Override
    public String getPowerByTypeAndId(String date, String deviceType, String deviceId) {
        return String.valueOf(buDeviceRunTimeMapper.getPowerByTypeAndId(date,deviceType,deviceId));
    }
    public String getSumTimeByTypeAndId(String date, String deviceType,String deviceId) {
        return String.valueOf(buDeviceRunTimeMapper.getSumTimeByTypeAndId(date, deviceType, deviceId));
    }
}
