package org.jeecg.modules.statistics.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.statistics.entity.BuDeviceStatistics;
import org.jeecg.modules.statistics.model.OpenStatistics;

import java.util.List;

/**
 * @Description: 设备信息统计表
 * @Author: jeecg-boot
 * @Date:   2021-01-18
 * @Version: V1.0
 */
public interface BuDeviceStatisticsMapper extends BaseMapper<BuDeviceStatistics> {

    List<OpenStatistics> monthStatistics(@Param("year") String year,@Param("month") String month,@Param("deviceId") String deviceId);

    List<OpenStatistics> noMonthStatistics(@Param("year") String year,@Param("deviceId") String deviceId);

    List<OpenStatistics> useTimeStatistics(@Param("year") String year,@Param("month") String month,@Param("day") String day,@Param("deviceId") String deviceId);

    BuDeviceStatistics getSelectTime(@Param("year") String year,@Param("month") String month,@Param("day") String day,@Param("deviceId") String deviceId);

    List<BuDeviceStatistics> getDataById(@Param("id") String id);
    List<BuDeviceStatistics> getLastTime(@Param("id") String id);

    String getDeviceUseTime(@Param("deviceName") String deviceName,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

    String getDeviceUseTimes(@Param("deviceName") String deviceName,@Param("beginTime") String beginTime,@Param("endTime") String endTime);

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

    public String getSumTime(@Param("year") int year,@Param("month") int month,@Param("day") int day);
    public String getSumTimeByType(@Param("year") int year,@Param("month") int month,@Param("day") int day,@Param("deviceType") String deviceType);
    public String getSumTimeByDevice(@Param("year") int year,@Param("month") int month,@Param("day") int day,@Param("deviceId") String deviceId);

}
