package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.MonDevFsReal;
import cn.cecep.talroad.vo.MonDevFsRealVo;
import cn.cecep.talroad.vo.analysis.AvgValueVo;
import cn.cecep.talroad.vo.analysis.PumpStateVo;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.Date;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 设备数据-垃圾焚烧-实时 保存设备的实时数据Mapper接口
 *
 * @author szhpt
 * @date 2023-01-10*/
@Mapper
public interface MonDevFsRealMapper extends BaseMapper<MonDevFsReal>
{
    /**
     * 查询设备数据-垃圾焚烧-实时 保存设备的实时数据列表
     *
     * @param monDevFsReal 设备数据-垃圾焚烧-实时 保存设备的实时数据
     * @return 设备数据-垃圾焚烧-实时 保存设备的实时数据集合
     */
    public List<MonDevFsReal> selectMonDevFsRealList(MonDevFsReal monDevFsReal);

    List<MonDevFsRealVo> getDataPage(Page page, @Param(Constants.WRAPPER) QueryWrapper<MonDevFsRealVo> queryWrapper);

    List<MonDevFsReal> selectLatestByParams(@Param("industry") String industry, @Param("deviceType") String deviceType, @Param("lastDate") Date lastDate,@Param("currDate") Date currDate);

    List<AvgValueVo> selectAvgPhByParams(@Param("lastDayBegin") Date lastDayBegin, @Param("lastDayEnd") Date lastDayEnd);

    List<PumpStateVo> selectPumpStateByParams(@Param("lastHourBegin") Date lastHourBegin, @Param("lastHourEnd") Date lastHourEnd);

    List<PumpStateVo> selectOxFanStateByParams(@Param("lastHourBegin") Date lastHourBegin, @Param("lastHourEnd") Date lastHourEnd);

    List<AvgValueVo> selectAvgTempByParams(@Param("lastHourBegin") Date lastHourBegin, @Param("lastHourEnd") Date lastHourEnd);

    List<MonDevFsReal> selectLatestHourDataByParams(@Param("factoryId") String factoryId, @Param("deviceId") String deviceId, @Param("lastDate") Date lastDate);

    List<AvgValueVo> selectLastDayData(@Param("lastDayBegin") DateTime lastDayBegin, @Param("lastDayEnd")DateTime lastDayEnd);
}
