/**
 * Copyright 2019 DH
 * All right reserved.
 * 项目名称: 大恒泰山系统
 * 创建日期:2022/8/24
 */
package org.springblade.modules.business.warning.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.base.BaseService;
import org.springblade.etl.entity.EtlRainDataEntity;
import org.springblade.etl.entity.EtlRiverDataEntity;
import org.springblade.etl.entity.EtlRsvrDataEntity;
import org.springblade.modules.baseinfo.rtu.entity.RtuInfoEntity;
import org.springblade.modules.business.rtumanage.dto.RtuStatusDTO;
import org.springblade.modules.business.warning.dto.RtuWarningInfoDTO;
import org.springblade.modules.business.warning.entity.RtuWarningInfoEntity;
import org.springblade.modules.business.warning.vo.RtuWarningInfoVO;

import java.util.List;

/***
 * Date:2022/8/24
 * Title:预警服务接口模块
 * Description：对本文件的详细描述，原则上不能少于30字
 * @author dylan
 * @version 1.0
 * Remark：认为有必要的其他信息
 */
public interface IRtuWarningService extends BaseService<RtuWarningInfoEntity> {

	/**
	 * 查询分页
	 * @param page
	 * @param rtuWarningInfoDTO
	 * @return
	 */
	IPage<RtuWarningInfoVO> selectPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);

	IPage<RtuWarningInfoVO> selectClockPage(IPage<RtuWarningInfoVO> page,RtuWarningInfoDTO rtuWarningInfoDTO);

	IPage<RtuWarningInfoVO> selectOfflinePage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);

	IPage<RtuWarningInfoVO> selectHourMissOutPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);

	IPage<RtuWarningInfoVO> selectRainHourMissOutPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);
	IPage<RtuWarningInfoVO> selectRiverHourMissOutPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);


	IPage<RtuWarningInfoVO> selectMinUpDelayPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);

	IPage<RtuWarningInfoVO> selectHourUpDelayPage(IPage<RtuWarningInfoVO> page, RtuWarningInfoDTO rtuWarningInfoDTO);

	IPage<RtuWarningInfoVO> selectRainHourUpDelayPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);
	IPage<RtuWarningInfoVO> selectRiverHourUpDelayPage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);

	IPage<RtuWarningInfoVO> selectOutlierValuePage(IPage<RtuWarningInfoVO> page,  RtuWarningInfoDTO rtuWarningInfoDTO);


	/**
	 * 设备异常测站数量
	 * @param rtuWarningInfoDTO
	 * @return
	 */
	Long warningRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	/**
	 * 离线测站数量
	 * @param rtuWarningInfoDTO
	 * @return
	 */
	Long warningOfflineRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	/**
	 * 时钟异常
	 * @param rtuWarningInfoDTO
	 * @return
	 */
	Long warningClockRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	/**
	 * 小时报漏报测站数量
	 * @param rtuWarningInfoDTO
	 * @return
	 */
	Long warningHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	Long warningRainHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	Long warningRiverHourMissOutRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	/**
	 * 分钟报延时测站数量
	 * @param rtuWarningInfoDTO
	 * @return
	 */
	Long warningMinUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	/**
	 * 小时报延时测站数量
	 * @param rtuWarningInfoDTO
	 * @return
	 */
	Long warningHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	Long warningRainHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	Long warningRiverHourUpDelayRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);

	Long warningOutlierValueRtuCount(RtuWarningInfoDTO rtuWarningInfoDTO);




	/**
	 * 测站时钟检测
	 * @param rtuInfoEntity
	 * @return
	 */
	boolean checkRtuClockStatus(RtuInfoEntity rtuInfoEntity);

	/**
	 * 测站雨量小时报延时检测
	 * @param etlRainDataEntity
	 * @return
	 */
	boolean checkRtuRainUpHourDelayStatus(EtlRainDataEntity etlRainDataEntity);

	/**
	 * 测站河道小时报延时检测
	 * @param etlRiverDataEntity
	 * @return
	 */
	boolean checkRtuRiverUpHourDelayStatus(EtlRiverDataEntity etlRiverDataEntity);


	/**
	 * 测站水库小时报延时检测
	 * @param etlRsvrDataEntity
	 * @return
	 */
	boolean checkRtuRsvrUpHourDelayStatus(EtlRsvrDataEntity etlRsvrDataEntity);

	/**
	 * 测站雨量5分钟上报延时检测
	 * @param rtuCode
	 * @param beforeUpInfo
	 * @param nowUpInfo
	 * @return
	 */
	boolean checkRtuRainUpDelayStatus(String rtuCode, JSONObject beforeUpInfo,JSONObject nowUpInfo);


	/**
	 * 测站离线检测
	 * @param rtuInfoEntity
	 * @return
	 */
	boolean checkRtuOfflineStatus(RtuInfoEntity rtuInfoEntity);

	/**
	 * 测站雨量小时报漏报
	 * @param rtuInfoEntity
	 * @return
	 */
	boolean checkRtuRainMissOutStatus(RtuInfoEntity rtuInfoEntity);

	/**
	 * 测站河道小时报漏报
	 * @param rtuInfoEntity
	 * @return
	 */
	boolean checkRtuRiverMissOutStatus(RtuInfoEntity rtuInfoEntity);

	/**
	 * 测站水库小时报漏报
	 * @param rtuInfoEntity
	 * @return
	 */
	boolean checkRtuRsvrMissOutStatus(RtuInfoEntity rtuInfoEntity);

	/**
	 * 疑似异常值
	 * @param rtuInfoEntity
	 * @return
	 */
	boolean checkRtuOutlierValueStatus(RtuInfoEntity rtuInfoEntity);

}
