package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.MonDevJhReal;
import cn.cecep.talroad.vo.MonDevJhRealVo;
import cn.cecep.talroad.vo.analysis.AvgValueVo;
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 MonDevJhRealMapper extends BaseMapper<MonDevJhReal>
{
    /**
     * 查询设备数据-焦化-实时 保存设备的实时数据列表
     *
     * @param monDevJhReal 设备数据-焦化-实时 保存设备的实时数据
     * @return 设备数据-焦化-实时 保存设备的实时数据集合
     */
    public List<MonDevJhReal> selectMonDevJhRealList(MonDevJhReal monDevJhReal);

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

    List<MonDevJhReal> selectLastHourData(MonDevJhReal real);

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

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

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

    List<MonDevJhReal> selectMonDevJhRealListByDataTime(@Param("queryBeginTime") DateTime queryBeginTime, @Param("queryEndTime") DateTime queryEndTime, @Param("deviceId") String deviceId);

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