package com.pqs9300.mapper.strategy;

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

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

public interface AlarmStrategyMapper {

    /*------------------操作ths_warnform表--------------------------*/
    /**
    * @Author chendaofei
    * @Description 新增告警策略
    * @Date 15:27 2020/6/17
    **/
    Integer addAlarm(ThsAlarmDTO thsAlarmDTO);

    /**
     * @Author chendaofei
     * @Description 修改告警策略
     * @Date 15:27 2020/6/17
     **/
    Integer updateAlarm(ThsAlarmDTO thsAlarmDTO);

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


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

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

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

    /**
     * @Author chendaofei
     * @Description 通过id获取告警策略
     * @Date 15:27 2020/6/17
     **/
    ThsAlarmDTO getAlarmById(@Param("alarmIndex") String alarmIndex);

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

    /**
     * @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 addAlarmAss(@Param("list")List<ThsAlarmFormAss>list);


    /**
     * @Author chendaofei
     * @Description 删除告警策略
     * @Date 15:27 2020/6/17
     **/
    Integer delAlarmAss(String alarmIndex);



    /**
     * @Author chendaofei
     * @Description 获取告警策略列表
     * @Date 15:27 2020/6/17
     **/
    List<ThsAlarmAss> getAlarmAss(@Param("alarmIndex") String alarmIndex, @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("alarmIndex")String alarmIndex,@Param("type") int... type);

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

}
