package com.zcxk.charge.core.dao;

import com.zcxk.charge.api.dto.watepump.ReprotWaterPumpQueryDto;
import com.zcxk.charge.api.vo.ReprotWaterPumpVo;
import com.zcxk.charge.core.entity.ReportWaterPumpStateEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * @ClassName ReportWaterPumpStateMapper
 * @Description: 水泵运行状态报表Mapper
 * @Author lihui
 * @Date 2021/4/20
 * @Version V1.0
 **/
@Mapper
public interface ReportWaterPumpStateMapper {

    /**
    * 更新泵站运行状态的结束时间
    * @author Andy
    * @date 18:13 2021/8/17
    * @param id:
    * @param endTime:
    * @param updateTime:
    * @return int
    **/
    int updateReportWaterPumpState(Long id, Date endTime, Date updateTime);

    /**
    * 批量插入
    * @author Andy
    * @date 18:13 2021/8/17
    * @param reportWaterPumpStateEntity:
    * @return int
    **/
    int batchInsertReportWaterPumpState(@Param("waterPumpList") List<ReportWaterPumpStateEntity> reportWaterPumpStateEntity);

    /**
    * 单个插入
    * @author Andy
    * @date 18:13 2021/8/17
    * @param reportWaterPumpStateEntity:
    * @return int
    **/
    int insertReportWaterPumpState(@Param("waterPump") ReportWaterPumpStateEntity reportWaterPumpStateEntity);

    /**
    * 查询泵站的ID和状态
    * @author Andy
    * @date 18:14 2021/8/17
    * @param md5Query:
    * @return com.zcxk.charge.core.entity.ReportWaterPumpStateEntity
    **/
    ReportWaterPumpStateEntity findReportWaterPumpState(String md5Query);

    /**
    * 查询场景下设备的泵站状态数据
    * @author Andy
    * @date 18:14 2021/8/17
    * @param queryDto:
    * @return java.util.List<com.zcxk.charge.api.vo.ReprotWaterPumpVo>
    **/
    List<ReprotWaterPumpVo> findReportWaterPumpStateList(@Param("waterPump") ReprotWaterPumpQueryDto queryDto);
}
