package com.aucma.dms.mapper;

import com.aucma.dms.domain.DmsRecordShutDown;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 停机记录Mapper接口
 * 
 * @author Open Platform
 * @date 2024-01-15
 */
public interface DmsRecordShutDownMapper 
{
    /**
     * 查询停机记录
     * 
     * @param recordShutDownId 停机记录主键
     * @return 停机记录
     */
    public DmsRecordShutDown selectDmsRecordShutDownByRecordShutDownId(@Param("recordShutDownId") Long recordShutDownId);

    /**
     * 查询停机记录列表
     * 
     * @param dmsRecordShutDown 停机记录
     * @return 停机记录集合
     */
    public List<DmsRecordShutDown> selectDmsRecordShutDownList(DmsRecordShutDown dmsRecordShutDown);

    /**
     * 新增停机记录
     * 
     * @param dmsRecordShutDown 停机记录
     * @return 结果
     */
    public int insertDmsRecordShutDown(DmsRecordShutDown dmsRecordShutDown);

    /**
     * 修改停机记录
     * 
     * @param dmsRecordShutDown 停机记录
     * @return 结果
     */
    public int updateDmsRecordShutDown(DmsRecordShutDown dmsRecordShutDown);

    /**
     * 删除停机记录
     * 
     * @param recordShutDownId 停机记录主键
     * @return 结果
     */
    public int deleteDmsRecordShutDownByRecordShutDownId(@Param("recordShutDownId") Long recordShutDownId);

    /**
     * 批量删除停机记录
     * 
     * @param recordShutDownIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDmsRecordShutDownByRecordShutDownIds(@Param("recordShutDownIds") Long[] recordShutDownIds);

    /**
     * 查询PDA待处理停机记录（结束时间为空 或 停机原因ID=1）
     *
     * @return 停机记录集合
     */
    public List<DmsRecordShutDown> selectPdaShutDownList();

    /**
     * 批量更新停机原因
     *
     * @param recordShutDownIds 停机记录ID集合
     * @param shutReasonId 停机原因ID
     * @param updateBy 更新人
     * @param updateTime 更新时间
     * @return 结果
     */
    public int batchUpdateShutReason(@Param("recordShutDownIds") Long[] recordShutDownIds, 
                                      @Param("shutReasonId") Long shutReasonId,
                                      @Param("shutTypeId") Long shutTypeId,
                                      @Param("shutReason") String shutReason,
                                      @Param("updateBy") Long updateBy,
                                      @Param("updateTime") java.util.Date updateTime);
}
