package com.zcxk.charge.core.dao;

import com.zcxk.charge.api.dto.query.ChartReportDto;
import com.zcxk.charge.api.dto.query.DeviceWaterDto;
import com.zcxk.charge.api.dto.query.MonitorDataChartQueryDto;
import com.zcxk.charge.api.dto.query.MonitorDataCompareQueryDto;
import com.zcxk.charge.api.vo.*;
import com.zcxk.charge.core.entity.DeviceEntity;
import com.zcxk.core.common.pojo.ProgramItem;
import com.zcxk.core.common.pojo.UserCondition;
import com.zcxk.core.oauth2.util.UserUtil;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

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

    /**
    * monitorDataChartReportByDay
    * @author Andy
    * @date 18:06 2021/8/17
    * @param chartDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataChartReportByDay(@Param("dto") ChartReportDto chartDto, @Param("user")UserCondition getUserCondition);

    /**
    * monitorDataChartReportByMonth
    * @author Andy
    * @date 18:06 2021/8/17
    * @param chartDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataChartReportByMonth(@Param("dto") ChartReportDto chartDto, @Param("user")UserCondition getUserCondition);

    /**
    * monitorDataChartReportByYear
    * @author Andy
    * @date 18:07 2021/8/17
    * @param chartDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataChartReportByYear(@Param("dto") ChartReportDto chartDto, @Param("user")UserCondition getUserCondition);

    /**
    * monthMonitorData
    * @author Andy
    * @date 18:07 2021/8/17
    * @param chartDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monthMonitorData(@Param("dto") ChartReportDto chartDto, @Param("user")UserCondition getUserCondition);


    /**
    * 查询某一天的能耗（供水量3、耗电量5 ）（4取水量、5耗电量）
    * @author Andy
    * @date 18:26 2021/8/16
    * @param dto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataEnergyReportByDay(@Param("dto")MonitorDataCompareQueryDto dto, @Param("user")UserCondition getUserCondition);

    /**
    * 查询某一月的能耗（供水量3、耗电量5 ）（4取水量、5耗电量）
    * @author Andy
    * @date 18:26 2021/8/16
    * @param dto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataEnergyReportByMonth(@Param("dto")MonitorDataCompareQueryDto dto, @Param("user")UserCondition getUserCondition);

    /**
     * 查询某一年的能耗（供水量3、耗电量5 ）（4取水量、5耗电量）
     * @author Andy
     * @date 18:26 2021/8/16
     * @param dto:
     * @param getUserCondition:
     * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
     **/
    List<MonitorDataChartReportDeviceVo> monitorDataEnergyReportByYear(@Param("dto")MonitorDataCompareQueryDto dto, @Param("user")UserCondition getUserCondition);

    /**
     * 查询能耗（供水量3、耗电量5 ）（4取水量、5耗电量）
     * @author Andy
     * @date 18:26 2021/8/16
     * @param dto:
     * @param getUserCondition:
     * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
     **/
    List<MonitorDataChartReportDeviceVo> monitorDataEnergyReport(@Param("dto")MonitorDataCompareQueryDto dto, @Param("user")UserCondition getUserCondition);


    /**
    * 某天的水质对比（PH8、余氯11、浊度10）
    * @author Andy
    * @date 18:43 2021/8/16
    * @param queryDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataQualityReportByDay(@Param("dto") MonitorDataCompareQueryDto queryDto, @Param("user")UserCondition getUserCondition);

    /**
    * 某月的水质对比（PH8、余氯11、浊度10）
    * @author Andy
    * @date 18:45 2021/8/16
    * @param queryDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataQualityReportByMonth(@Param("dto") MonitorDataCompareQueryDto queryDto, @Param("user")UserCondition getUserCondition);

    /**
    * 某年的水质对比（PH8、余氯11、浊度10）
    * @author Andy
    * @date 18:46 2021/8/16
     * @param queryDto:
     * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataQualityReportByYear(@Param("dto") MonitorDataCompareQueryDto queryDto, @Param("user")UserCondition getUserCondition);

    /**
    * 水质对比（PH8、余氯11、浊度10）
    * @author Andy
    * @date 18:48 2021/8/16
    * @param queryDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataQualityReport(@Param("dto") MonitorDataCompareQueryDto queryDto, @Param("user")UserCondition getUserCondition);


    /**
    * 获取报警
    * @author Andy
    * @date 18:56 2021/8/16
    * @param dateType:
    * @param queryDto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> deviceAlarmReport(@Param("dateType") String dateType, @Param("dto") MonitorDataCompareQueryDto queryDto, @Param("user")UserCondition getUserCondition);

    /**
    * getDeviceBySceneTypeName
    * @author Andy
    * @date 9:16 2021/8/18
    * @param sceneTypeName:
    * @param tenantId:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<com.zcxk.charge.core.entity.DeviceEntity>
    **/
    List<DeviceEntity> getDeviceBySceneTypeName(@Param("sceneTypeName") String sceneTypeName, @Param("tenantId") String tenantId, @Param("userType") String userType, @Param("permissonType") Integer permissonType,
                                                @Param("programItems") List<ProgramItem> programItems);

    /**
    * 统计某日设备数据
    * @author Andy
    * @date 9:26 2021/8/17
    * @param dto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataDeviceReportByDay(@Param("dto") MonitorDataChartQueryDto dto, @Param("user")UserCondition getUserCondition);

    /**
    * 统计某月的设备数据
    * @author Andy
    * @date 9:30 2021/8/17
    * @param dto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataDeviceReportByMonth(@Param("dto") MonitorDataChartQueryDto dto, @Param("user")UserCondition getUserCondition);

    /**
    * 统计设备数据
    * @author Andy
    * @date 9:35 2021/8/17
    * @param dto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataDeviceReport(@Param("dto") MonitorDataChartQueryDto dto, @Param("user")UserCondition getUserCondition);

    /**
    * 统计某年的设备数据
    * @author Andy
    * @date 9:32 2021/8/17
    * @param dto:
    * @param getUserCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.MonitorDataChartReportDeviceVo>
    **/
    List<MonitorDataChartReportDeviceVo> monitorDataDeviceReportByYear(@Param("dto") MonitorDataChartQueryDto dto, @Param("user")UserCondition getUserCondition);


    /**
    * selectDeviceCode
    * @author Andy
    * @date 9:16 2021/8/18
    * @param tenantId:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<java.lang.String>
    **/
    List<String> selectDeviceCode(@Param("tenantId") String tenantId, @Param("userType") String userType, @Param("permissonType") Integer permissonType,
                                  @Param("programItems") List<ProgramItem> programItems);

    /**
    * 查询设备编码
    * @author Andy
    * @date 9:56 2021/8/17
    * @param companyOrgId:
    * @param sceneId:
    * @param sceneTypeName:
    * @param getUserCondition:
    * @return java.util.List<java.lang.String>
    **/
    List<String> selectDeviceCodeByConditions(@Param("companyOrgId") Integer companyOrgId, @Param("sceneId") Integer sceneId,
                                              @Param("sceneTypeName") String sceneTypeName,@Param("user")UserCondition getUserCondition);

    /**
    * 近30天水量
    * @author Andy
    * @date 18:07 2021/8/17
    * @param tenantId:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<com.zcxk.charge.api.vo.DeviceWaterSupplyVo>
    **/
    List<DeviceWaterSupplyVo> getDeviceWaterFor30Day(@Param("tenantId") String tenantId, @Param("userType") String userType, @Param("permissonType") Integer permissonType,
                                                     @Param("programItems") List<ProgramItem> programItems);

    /**
    * getDeviceWaterDetailForNow
    * @author Andy
    * @date 16:23 2021/8/18
    * @param sceneTypeName:
    * @param parmType:
    * @param condition:
    * @return java.util.List<com.zcxk.charge.api.vo.DeviceWaterDetailVo>
    **/
    List<DeviceWaterDetailVo> getDeviceWaterDetailForNow(@Param("sceneTypeName") String sceneTypeName, @Param("parmType") Integer parmType, @Param("user") UserCondition condition);

    /**
    * getDeviceWaterDetailForDay
    * @author Andy
    * @date 16:23 2021/8/18
    * @param dto:
    * @param userCondition:
    * @return java.util.List<com.zcxk.charge.api.vo.DeviceWaterDetailVo>
    **/
    List<DeviceWaterDetailVo> getDeviceWaterDetailForDay(@Param("dto") DeviceWaterDto dto, @Param("user")UserCondition userCondition);

    /**
    * getDeviceWaterDetailForMonth
    * @author Andy
    * @date 18:07 2021/8/17
    * @param dto:
    * @param userCondition:
    * @return java.math.BigDecimal
    **/
    BigDecimal getDeviceWaterDetailForMonth(@Param("dto") DeviceWaterDto dto, @Param("user")UserCondition userCondition);

    /**
    * getDeviceWaterDetailForYear
    * @author Andy
    * @date 18:08 2021/8/17
    * @param dto:
    * @param userCondition:
    * @return java.math.BigDecimal
    **/
    BigDecimal getDeviceWaterDetailForYear(@Param("dto") DeviceWaterDto dto, @Param("user")UserCondition userCondition);


    /**
    * 报警数据
    * @author Andy
    * @date 18:08 2021/8/17
    * @param tenantId:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<com.zcxk.charge.api.vo.SceneAlarmVo>
    **/
    List<SceneAlarmVo> getAlarmInfoForScene(@Param("tenantId") String tenantId, @Param("userType") String userType, @Param("permissonType") Integer permissonType,
                                            @Param("programItems") List<ProgramItem> programItems);

    /**
    * getQualificationForScene
    * @author Andy
    * @date 18:08 2021/8/17
    * @param parmType:
    * @param condition:
    * @return com.zcxk.charge.api.vo.SceneNormalRateVo
    **/
    SceneNormalRateVo getQualificationForScene(@Param("parmType") Integer parmType, @Param("user") UserCondition condition);

    /**
    * getWaterSupplyData
    * @author Andy
    * @date 18:08 2021/8/17
    * @param tenantId:
    * @param sceneTypeName:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<com.zcxk.charge.api.vo.WaterSupplyDataVo>
    **/
    List<WaterSupplyDataVo> getWaterSupplyData(@Param("tenantId") String tenantId, @Param("sceneTypeName") String sceneTypeName, @Param("userType") String userType, @Param("permissonType") Integer permissonType,
                                             @Param("programItems") List<ProgramItem> programItems);

    /**
    * getWaterSupplyDataForCurrentMonth
    * @author Andy
    * @date 18:08 2021/8/17
    * @param tenantId:
    * @param sceneTypeName:
    * @param sceneIds:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<com.zcxk.charge.api.vo.WaterSupplyDataVo>
    **/
    List<WaterSupplyDataVo> 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);

    /**
    * getWaterSupplyDataByMonth
    * @author Andy
    * @date 18:08 2021/8/17
    * @param tenantId:
    * @param companyOrgId:
    * @param sceneTypeName:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<com.zcxk.charge.api.vo.WaterSupplyDataVo>
    **/
    List<WaterSupplyDataVo> 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);

    /**
    * getWaterSupplyDataByMonthForCurrentMonth
    * @author Andy
    * @date 18:09 2021/8/17
    * @param tenantId:
    * @param companyOrgId:
    * @param sceneTypeName:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.util.List<com.zcxk.charge.api.vo.WaterSupplyDataVo>
    **/
    List<WaterSupplyDataVo> 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);

    /**
    * getUseAmount
    * @author Andy
    * @date 18:09 2021/8/17
    * @param companyOrgId:
    * @param tenantId:
    * @param searchType:
    * @param userType:
    * @param permissonType:
    * @param programItems:
    * @return java.math.BigDecimal
    **/
    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);
}
