package com.elephant.framework.galaxy.aroad.module.emergencyevent.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.emergencyevent.entity.EmergencyEvent;
import org.apache.ibatis.annotations.Param;

/**
 * 应急事件表
 *
 * @author songwenjie
 * @date 2019-05-08 14:43:42
 */
public interface EmergencyEventMapper extends BaseMapper<EmergencyEvent> {

    /** 
    * @Description: 新增应急事件 
    * @param: [event]
    * @return: boolean 
    * @Author: songwenjie
    * @Date: 2019/5/15 
    */ 
    boolean saveEvent(EmergencyEvent event);


    /** 
    * @Description: 更新应急事件状态
    * @param: [enevtId, status]
    * @return: boolean 
    * @Author: songwenjie
    * @Date: 2019/5/15 
    */ 
    boolean updateStatus(@Param("eventId")Integer enevtId, @Param("newStatus")String newStatus,
                         @Param("oldStatus") String oldStatus);

    /**
     * @Description: 更新应急事件状态
     * @param: [enevtId, status]
     * @return: boolean
     * @Author: songwenjie
     * @Date: 2019/5/15
     */
    boolean updateStatusById(@Param("eventId")Integer enevtId, @Param("newStatus")String newStatus);


    /** 
    * @Description: 分页获取应急事件
    * @param: [page, repotingDept]
    * @return: com.baomidou.mybatisplus.extension.plugins.pagination.Page<com.elephant.framework.galaxy.aroad.module.emergencyevent.entity.EmergencyEvent> 
    * @Author: songwenjie
    * @Date: 2019/5/15 
    */ 
    Page<EmergencyEvent> getEventPage (Page page,@Param("reportingDept") String reportingDept,
                                       @Param("status") String status);
    
    /** 
    * @Description: 更新评估总结文档信息
    * @param: [event]
    * @return: boolean 
    * @Author: songwenjie
    * @Date: 2019/5/16 
    */ 
    boolean updateFile(EmergencyEvent event);

    /** 
    * @Description: 归档评估总结文档
    * @param: [enevtId]
    * @return: boolean 
    * @Author: songwenjie
    * @Date: 2019/5/16 
    */ 
    boolean updateIsFile(@Param("eventId")Integer enevtId);
}
