package cn.cecep.talroad.mapper;

import cn.cecep.talroad.domain.MonElecReal;
import cn.cecep.talroad.vo.MonElecRealSiteVo;
import cn.cecep.talroad.vo.MonElecRealVo;
import cn.cecep.talroad.vo.analysis.AvgValueVo;
import cn.cecep.talroad.vo.query.MonElecRealQuery;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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;
import java.util.Map;

/**
 * 分表计电设备-点位对应 设备与点位为多对多的关系Mapper接口
 *
 * @author szhpt
 * @date 2023-01-10*/
@Mapper
public interface MonElecRealMapper extends BaseMapper<MonElecReal>
{

    List<MonElecRealVo> selectElecRealPage(@Param("page") Page<MonElecRealVo> page, @Param("query") MonElecRealQuery query);

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

    List<Map<String, Object>> selectKwhChartData(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("regionCodeList") List<String> regionCodeList);

    List<MonElecRealVo.KwhMonitorVo> selectKwhMonitor(@Param("type") String type, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("regionCodeList") List<String> regionCodeList);

    List<AvgValueVo> selectLastDayData(@Param("lastDayBegin") DateTime queryBeginTime,@Param("lastDayEnd") DateTime queryEndTime,@Param("pageSize")Integer pageSize,@Param("startCount")Integer startCount);
}
