package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.MonDevBlReal;
import cn.cecep.talroad.vo.MonDevBlRealVo;
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 org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Date;

/**
 * 设备数据-玻璃-实时 保存设备的实时数据Mapper接口
 *
 * @author szhpt
 * @date 2023-01-10*/
@Mapper
public interface MonDevBlRealMapper extends BaseMapper<MonDevBlReal>
{
    /**
     * 查询设备数据-玻璃-实时 保存设备的实时数据列表
     *
     * @param monDevBlReal 设备数据-玻璃-实时 保存设备的实时数据
     * @return 设备数据-玻璃-实时 保存设备的实时数据集合
     */
    public List<MonDevBlReal> selectMonDevBlRealList(MonDevBlReal monDevBlReal);

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

    List<MonDevBlReal> 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<AvgValueVo> selectAvgTempByParams(@Param("lastHourBegin") Date lastHourBegin, @Param("lastHourEnd") Date lastHourEnd);

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