package com.zcxk.dao;

import com.zcxk.dto.MonitorDataChartReportDeviceDto;
import com.zcxk.dto.generalView.*;
import com.zcxk.entity.DeviceEntity;
import com.zcxk.model.ProgramItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * @description
 * @auto wangli
 * @data 2020/12/7 14:51
 */
@Mapper
public interface MonitorDataReportMapper {


    List<MonitorDataChartReportDeviceDto> MonitorDataChartReportByDay( @Param("year")Integer year, @Param("month")Integer month, @Param("day")Integer day,
                                                                       @Param("sceneId")Long sceneId ,@Param("tenantId")String tenantId,
                                                                       @Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                       @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataChartReportByMonth( @Param("year")Integer year, @Param("month")Integer month,
                                                                         @Param("sceneId")Long sceneId ,@Param("tenantId")String tenantId,
                                                                         @Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                         @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataChartReportByYear( @Param("year")Integer year,
                                                                        @Param("sceneId")Long sceneId ,@Param("tenantId")String tenantId,
                                                                        @Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                        @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> monthMonitorData(@Param("startTime")String startTime, @Param("endTime")String endTime,
                                                            @Param("sceneId")Long sceneId ,@Param("tenantId")String tenantId,
                                                                         @Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                         @Param("programItems")List<ProgramItem> programItems);


    List<MonitorDataChartReportDeviceDto> MonitorDataEnergyReportByDay(@Param("sceneType")Integer sceneType,@Param("sceneIds")List<Long> sceneIds,
                                                                  @Param("year")Integer year, @Param("month")Integer month, @Param("day")Integer day,
                                                                  @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                  @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataEnergyReportByMonth(@Param("sceneType")Integer sceneType, @Param("sceneIds")List<Long> sceneIds,
                                                                  @Param("year")Integer year, @Param("month")Integer month,
                                                                  @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                  @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataEnergyReport(@Param("sceneType")Integer sceneType, @Param("sceneIds")List<Long> sceneIds,
                                                                         @Param("startTime")String startTime, @Param("endTime")String endTime,
                                                                         @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                         @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataEnergyReportByYear(@Param("sceneType")Integer sceneType, @Param("sceneIds")List<Long> sceneIds,
                                                                  @Param("year")Integer year,
                                                                  @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                  @Param("programItems")List<ProgramItem> programItems);



    List<MonitorDataChartReportDeviceDto> MonitorDataQualityReportByDay(@Param("sceneIds")List<Long> sceneIds,
                                                                   @Param("year")Integer year, @Param("month")Integer month, @Param("day")Integer day,
                                                                   @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                   @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataQualityReportByMonth( @Param("sceneIds")List<Long> sceneIds,
                                                                   @Param("year")Integer year, @Param("month")Integer month,
                                                                   @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                   @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataQualityReport( @Param("sceneIds")List<Long> sceneIds,
                                                                           @Param("startTime")String startTime, @Param("endTime")String endTime,
                                                                           @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                           @Param("programItems")List<ProgramItem> programItems);
    List<MonitorDataChartReportDeviceDto> MonitorDataQualityReportByYear( @Param("sceneIds")List<Long> sceneIds,
                                                                   @Param("year")Integer year,
                                                                   @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                   @Param("programItems")List<ProgramItem> programItems);



    List<MonitorDataChartReportDeviceDto> DeviceAlarmReport(@Param("dateType") String dateType, @Param("sceneIds")List<Long> sceneIds,
                                                            @Param("beginDate") LocalDate beginDate, @Param("endDate")LocalDate endDate,
                                                            @Param("tenantId")String tenantId, @Param("userType")String userType, @Param("permissonType")Integer permissonType,
                                                            @Param("programItems")List<ProgramItem> programItems);

    List<DeviceEntity> getDeviceBySceneTypeName(@Param("sceneTypeName") String sceneTypeName,@Param("tenantId")String tenantId, @Param("userType")String userType, @Param("permissonType")Integer permissonType,
                                                @Param("programItems")List<ProgramItem> programItems);


    List<MonitorDataChartReportDeviceDto> MonitorDataDeviceReportByDay(@Param("deviceIds")List<Long> deviceIds, @Param("searchType")Integer searchType,
                                                                              @Param("year")Integer year, @Param("month")Integer month, @Param("day")Integer day,
                                                                              @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                              @Param("programItems")List<ProgramItem> programItems,
                                                                                @Param("sceneId")Long sceneId);
    List<MonitorDataChartReportDeviceDto> MonitorDataDeviceReportByMonth(@Param("deviceIds")List<Long> deviceIds, @Param("searchType")Integer searchType,
                                                                               @Param("year")Integer year, @Param("month")Integer month,
                                                                               @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                               @Param("programItems")List<ProgramItem> programItems,
                                                                         @Param("sceneId")Long sceneId);
    List<MonitorDataChartReportDeviceDto> MonitorDataDeviceReport(@Param("deviceIds")List<Long> deviceIds, @Param("searchType")Integer searchType,
                                                                         @Param("startTime")String startTime, @Param("endTime")String endTime,
                                                                         @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                         @Param("programItems")List<ProgramItem> programItems,
                                                                  @Param("sceneId")Long sceneId);
    List<MonitorDataChartReportDeviceDto> MonitorDataDeviceReportByYear(@Param("deviceIds")List<Long> deviceIds, @Param("searchType")Integer searchType,
                                                                               @Param("year")Integer year,
                                                                               @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                               @Param("programItems")List<ProgramItem> programItems,
                                                                        @Param("sceneId")Long sceneId);


    List<String> selectDeviceCode(@Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                  @Param("programItems")List<ProgramItem> programItems);

    List<String> selectDeviceCodeByConditions(@Param("companyOrgId")Integer companyOrgId, @Param("sceneId")Integer sceneId, @Param("sceneTypeName")String sceneTypeName,
                                              @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                              @Param("programItems")List<ProgramItem> programItems);

    List<DeviceWaterSupply> getDeviceWaterFor30Day(@Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                   @Param("programItems")List<ProgramItem> programItems);

    List<DeviceWaterDetail> getDeviceWaterDetailForNow(@Param("sceneTypeName")String sceneTypeName,@Param("parmType")Integer parmType,@Param("tenantId")String tenantId,
                                                       @Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                       @Param("programItems")List<ProgramItem> programItems);

    List<DeviceWaterDetail> getDeviceWaterDetailForDay(@Param("companyOrgId")Integer companyOrgId, @Param("sceneId")Integer sceneId,
                                                        @Param("sceneTypeName")String sceneTypeName,@Param("parmType")Integer parmType,@Param("tenantId")String tenantId,
                                                       @Param("year")Integer year, @Param("month")Integer month, @Param("day")Integer day,
                                                       @Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                       @Param("programItems")List<ProgramItem> programItems);

    BigDecimal getDeviceWaterDetailForMonth(@Param("companyOrgId")Integer companyOrgId, @Param("sceneId")Integer sceneId,
                                            @Param("sceneTypeName")String sceneTypeName,@Param("parmType")Integer parmType,@Param("tenantId")String tenantId,
                                            @Param("year")Integer year, @Param("month")Integer month,
                                            @Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                            @Param("programItems")List<ProgramItem> programItems);
    BigDecimal getDeviceWaterDetailForYear( @Param("companyOrgId")Integer companyOrgId, @Param("sceneId")Integer sceneId,
                                            @Param("sceneTypeName")String sceneTypeName,@Param("parmType")Integer parmType,@Param("tenantId")String tenantId,
                                            @Param("year")Integer year,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                            @Param("programItems")List<ProgramItem> programItems);


    List<SceneAlarm> getAlarmInfoForScene( @Param("tenantId")String tenantId,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                           @Param("programItems")List<ProgramItem> programItems);

    SceneNormalRate getQualificationForScene(@Param("tenantId")String tenantId, @Param("parmType")Integer parmType ,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                             @Param("programItems")List<ProgramItem> programItems);

    List<WaterSupplyData> getWaterSupplyData(@Param("tenantId")String tenantId,@Param("sceneTypeName")String sceneTypeName,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                             @Param("programItems")List<ProgramItem> programItems);

    List<WaterSupplyData> getWaterSupplyDataForCurrentMonth(@Param("tenantId")String tenantId,@Param("sceneTypeName")String sceneTypeName,@Param("sceneIds")List<Long> sceneIds,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                            @Param("programItems")List<ProgramItem> programItems);

    List<WaterSupplyData> getWaterSupplyDataByMonth(@Param("tenantId")String tenantId,@Param("companyOrgId")Integer companyOrgId,@Param("sceneTypeName")String sceneTypeName,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                    @Param("programItems")List<ProgramItem> programItems);
    List<WaterSupplyData> getWaterSupplyDataByMonthForCurrentMonth(@Param("tenantId")String tenantId,@Param("companyOrgId")Integer companyOrgId,@Param("sceneTypeName")String sceneTypeName,@Param("userType")String userType,@Param("permissonType")Integer permissonType,
                                                                   @Param("programItems")List<ProgramItem> programItems);

    BigDecimal getUseAmount(@Param("companyOrgId")Integer companyOrgId, @Param("tenantId")String tenantId, @Param("searchType")Integer searchType, @Param("userType")String userType, @Param("permissonType")Integer permissonType, @Param("programItems")List<ProgramItem> programItems);
}
