package com.zcxk.dao;

import com.zcxk.dto.watePump.ReprotWaterPumpDto;
import com.zcxk.dto.watePump.ReprotWaterPumpQueryDto;
import com.zcxk.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 lihui
    * @Description 更新泵站运行状态的结束时间
    * @Date 18:05 2021/4/21
    * @Param [id, endTime, updateTime]
    * @return int
    **/
    int updateReportWaterPumpState(Long id, Date endTime, Date updateTime);

    /**
    * @Author lihui
    * @Description 批量插入
    * @Date 18:05 2021/4/21
    * @Param [reportWaterPumpStateEntity]
    * @return int
    **/
    int batchInsertReportWaterPumpState(@Param("waterPumpList") List<ReportWaterPumpStateEntity> reportWaterPumpStateEntity);

    /**
    * @Author lihui
    * @Description 单个插入
    * @Date 18:06 2021/4/21
    * @Param [reportWaterPumpStateEntity]
    * @return int
    **/
    int insertReportWaterPumpState(@Param("waterPump")ReportWaterPumpStateEntity reportWaterPumpStateEntity);

    /**
    * @Author lihui
    * @Description 查询泵站的ID和状态
    * @Date 18:06 2021/4/21
    * @Param [md5Query : md5签名的查询条件]
    * @return com.zcxk.entity.ReportWaterPumpStateEntity
    **/
    ReportWaterPumpStateEntity findReportWaterPumpState(String md5Query);

    /**
    * @Author lihui
    * @Description 查询场景下设备的泵站状态数据
    * @Date 18:08 2021/4/21
    * @Param [queryDto]
    * @return java.util.List<com.zcxk.dto.watepump.ReprotWaterPumpDto>
    **/
    List<ReprotWaterPumpDto> findReportWaterPumpStateList(@Param("waterPump")ReprotWaterPumpQueryDto queryDto);
}
