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

import org.jeecg.modules.statistics.entity.BuDeviceStatistics;
import org.jeecg.modules.statistics.mapper.BuDeviceStatisticsMapper;
import org.jeecg.modules.statistics.model.OpenStatistics;
import org.jeecg.modules.statistics.service.IBuDeviceStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

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

import java.util.List;

/**
 * @Description: 设备信息统计表
 * @Author: jeecg-boot
 * @Date:   2021-01-18
 * @Version: V1.0
 */
@Service
public class BuDeviceStatisticsServiceImpl extends ServiceImpl<BuDeviceStatisticsMapper, BuDeviceStatistics> implements IBuDeviceStatisticsService {

    @Autowired
    private BuDeviceStatisticsMapper buDeviceStatisticsMapper;

    @Override
    public List<OpenStatistics> monthStatistics(String year, String month, String deviceId) {
        return buDeviceStatisticsMapper.monthStatistics(year,month,deviceId);
    }
    @Override
    public List<OpenStatistics> noMonthStatistics(String year, String deviceId) {
        return buDeviceStatisticsMapper.noMonthStatistics(year,deviceId);
    }
    @Override
    public List<OpenStatistics> useTimeStatistics(String year, String month, String day, String deviceId) {
        return buDeviceStatisticsMapper.useTimeStatistics(year,month,day,deviceId);
    }

    @Override
    public BuDeviceStatistics getSelectTime(String year, String month, String day, String deviceId) {
        return buDeviceStatisticsMapper.getSelectTime(year,month,day,deviceId);
    }

    @Override
    public List<BuDeviceStatistics> getDataById(String id) {
        return buDeviceStatisticsMapper.getDataById(id);
    }
    @Override
    public List<BuDeviceStatistics> getLastTime(String id) {
        return buDeviceStatisticsMapper.getLastTime(id);
    }

    @Override
    public String getDeviceUseTime(String deviceName,String beginTime,String endTime) {
        return buDeviceStatisticsMapper.getDeviceUseTime(deviceName,beginTime,endTime);
    }

    @Override
    public String getDeviceUseTimes(String deviceName,String beginTime,String endTime) {
        return buDeviceStatisticsMapper.getDeviceUseTimes(deviceName,beginTime,endTime);
    }

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

    @Override
    public String getSumTime(int year,int month,int day){
        return buDeviceStatisticsMapper.getSumTime(year,month,day);
    }
    @Override
    public String getSumTimeByType(int year,int month,int day,String deviceType){
        return buDeviceStatisticsMapper.getSumTimeByType(year,month,day,deviceType);
    }
    @Override
    public String getSumTimeByDevice(int year,int month,int day,String deviceId){
        return buDeviceStatisticsMapper.getSumTimeByDevice(year,month,day,deviceId);
    }

}
