package com.zcxk.charge.core.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zcxk.charge.api.dto.*;
import com.zcxk.charge.api.vo.DevicePressReportAttributeVo;
import com.zcxk.charge.api.vo.DeviceWaterReportAttributeVo;
import com.zcxk.charge.api.vo.ReportAttributeVo;
import com.zcxk.charge.api.vo.ReportVo;
import com.zcxk.charge.core.entity.DayReportEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * sms_day_reportDAO接口
 *
 * @author: WYY
 * @date 2020-12-03 16:20
 */
@Mapper
public interface DayReportMapper extends BaseMapper<DayReportEntity> {

    /**
    * 自定义分页查询
    * @author Andy
    * @date 18:47 2021/8/17
    * @param page:
    * @param dayReportEntity:
    * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.zcxk.charge.api.vo.ReportVo>
    **/
    Page<ReportVo> findPage(IPage<ReportDto> page, @Param("dayReport") DayReportEntity dayReportEntity);

    /**
    * 自定义分页查询
    * @author Andy
    * @date 18:47 2021/8/17
    * @param page:
    * @param reportPageQueryDto:
    * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.zcxk.charge.api.vo.ReportVo>
    **/
    Page<ReportVo> findPageReprot(IPage<ReportDto> page,
                                   @Param("dayReport") ReportPageQueryDto reportPageQueryDto);

    /**
    * 查询单个
    * @author Andy
    * @date 18:47 2021/8/17
    * @param id:
    * @return com.zcxk.charge.core.entity.DayReportEntity
    **/
    DayReportEntity findDayReportById(Serializable id);

    /**
    * 查询集合
    * @author Andy
    * @date 18:47 2021/8/17
    * @param dayReportEntity:
    * @return java.util.List<com.zcxk.charge.core.entity.DayReportEntity>
    **/
    List<DayReportEntity> findList(DayReportEntity dayReportEntity);

    /**
    * 查询属性集合
    * @author Andy
    * @date 18:48 2021/8/17
    * @param reportDto:
    * @return java.util.List<com.zcxk.charge.api.vo.ReportAttributeVo>
    **/
    List<ReportAttributeVo> findAttributeList(@Param("report") ReportDto reportDto);

    /**
    * 查询集合
    * @author Andy
    * @date 18:48 2021/8/17
    * @param item:
    * @return java.util.List<com.zcxk.charge.api.vo.ReportVo>
    **/
    List<ReportVo> findReport(@Param("report") ReportDto item);

    /**
    * 分页查询
    * @author Andy
    * @date 18:48 2021/8/17
    * @param page:
    * @param dayReportEntity:
    * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.zcxk.charge.api.vo.DevicePressReportAttributeVo>
    **/
    Page<DevicePressReportAttributeVo> findDevicePressPage(IPage<DevicePressReportAttributeDto> page, @Param("dayReport") DayReportEntity dayReportEntity);

    /**
    * 分页查询
    * @author Andy
    * @date 18:48 2021/8/17
    * @param page:
    * @param dayReportEntity:
    * @param userId:
    * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.zcxk.charge.api.vo.DeviceWaterReportAttributeVo>
    **/
    Page<DeviceWaterReportAttributeVo> findDeviceWaterPage(IPage<DeviceWaterReportAttributeDto> page, @Param("dayReport") DayReportEntity dayReportEntity, @Param("userId") Integer userId);

    /**
    * 查询最后的值
    * @author Andy
    * @date 18:48 2021/8/17
    * @param dayReportEntity:
    * @return java.util.List<com.zcxk.charge.core.entity.DayReportEntity>
    **/
    List<DayReportEntity> findDeviceLastDayValue(@Param("dayReport") DayReportEntity dayReportEntity);

    /**
    * 查询最新的值
    * @author Andy
    * @date 18:48 2021/8/17
    * @param dayReportEntity:
    * @return com.zcxk.charge.core.entity.DayReportEntity
    **/
    DayReportEntity findLastDayValue(@Param("dayReport") DayReportEntity dayReportEntity);
}
