package com.pqs9300.mapper.strategy;

import com.pqs9300.pojo.strategy.ThsAlarmFormDTO;
import com.pqs9300.pojo.strategy.DicStrategyRVO;
import com.pqs9300.pojo.strategy.ThsAlarmFormAss;
import org.apache.ibatis.annotations.Param;

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

public interface WarningStrategyMapper {

    /*------------------操作ths_warnform表--------------------------*/

    /**
     * @Author chendaofei
     * @Description 新增预警策略
     * @Date 15:27 2020/6/17
     **/
    Integer addEarlyWarn(ThsAlarmFormDTO thsAlarmFormDTO);

    /**
     * @Author chendaofei
     * @Description 修改预警策略
     * @Date 15:27 2020/6/17
     **/
    Integer updateEarlyWarn(ThsAlarmFormDTO thsAlarmFormDTO);

    /**
     * @Author chendaofei
     * @Description 修改预警策略指标类型与或
     * @Date 15:27 2020/6/17
     **/
    Integer updateEarlyWarnAndOr(@Param("wfIndex") String wfIndex, @Param("operation") Integer operation);

    /**
     * @Author chendaofei
     * @Description 控制是否启用策略
     * @Date 15:27 2020/6/17
     **/
    Integer statusController(@Param("wfIndex") String wfIndex, @Param("state") Integer state);

    /**
     * @Author chendaofei
     * @Description 删除预警策略
     * @Date 15:27 2020/6/17
     **/
    Integer delEarlyWarn(@Param("wfIndex") String wfIndex);

    /**
     * @Author chendaofei
     * @Description 获取预警策略列表
     * @Date 15:27 2020/6/17
     **/
    List<ThsAlarmFormDTO> getEarlyWarnList(@Param("grade")Integer grade,@Param("wfIndex")String wfIndex,@Param("list")List<String>list);

    List<ThsAlarmFormDTO> getEarlyWarnListbyGrade(@Param("grade") Integer grade);

    /**
     * @Author chendaofei
     * @Description 通过id获取预警策略
     * @Date 15:27 2020/6/17
     **/
    ThsAlarmFormDTO getEarlyWarnById(@Param("wfIndex") String wfIndex);

    /**
     * @Author chendaofei
     * @Description 判断策略名是否存在
     * @Date 15:27 2020/6/17
     **/
    int isSameName(ThsAlarmFormDTO thsAlarmFormDTO);

    /**
     * @Author chendaofei
     * @Description 获取数据字典里的指标类型数据
     * @Date 15:27 2020/6/17
     **/
    List<DicStrategyRVO> getTartgetTypeForDic(@Param("type") String type);








    /*------------------操作THS_WarnFormAss表--------------------------*/

    /**
     * @Author chendaofei
     * @Description 新增预警策略关系表
     * @Date 15:27 2020/6/17
     **/
    Integer addEarlyWarnAss(@Param("list") List<ThsAlarmFormAss> list);


    /**
     * @Author chendaofei
     * @Description 删除预警策略
     * @Date 15:27 2020/6/17
     **/
    Integer delEarlyWarnAss(@Param("wfIndex") String wfIndex);



    /**
     * @Author chendaofei
     * @Description 获取预警策略列表
     * @Date 15:27 2020/6/17
     **/
    List<ThsAlarmFormAss> getEarlyWarnAss(@Param("wfIndex") String wfIndex, @Param("type") Integer type);

    /**
     * @Author chendaofei
     * @Description 监测是否存在该监测点
     * @Date 10:59 2020/6/23
     **/
    int isExitLine(@Param("list") List<ThsAlarmFormAss> list, @Param("grade") Integer grade, @Param("wfIndex") String wfIndex, @Param("type") int... type);

    /**
     * @Author chendaofei
     * @Description 是否存在绑定事件
     * @Date 10:59 2020/6/23
     **/
    int isExitBindEvent(@Param("wfIndex") String wfIndex);

    List<ThsAlarmFormAss> getEarlyWarnAssBywfIndex(@Param("wfIndex") String wfIndex);

    List<ThsAlarmFormAss> getEarlyWarnAssByGrade(@Param("grade") Integer grade);

}
