package com.aucma.dms.mapper;

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

import java.util.List;

/**
 * 维修工单Mapper接口
 *
 * @author Cascade AI
 * @date 2025-01-10
 */
public interface DmsRepairWorkOrderMapper {
    
    /**
     * 查询维修工单
     *
     * @param workOrderId 维修工单主键
     * @return 维修工单
     */
    DmsRepairWorkOrder selectDmsRepairWorkOrderByWorkOrderId(Long workOrderId);

    /**
     * 查询维修工单列表
     *
     * @param dmsRepairWorkOrder 维修工单
     * @return 维修工单集合
     */
    List<DmsRepairWorkOrder> selectDmsRepairWorkOrderList(DmsRepairWorkOrder dmsRepairWorkOrder);

    /**
     * 新增维修工单
     *
     * @param dmsRepairWorkOrder 维修工单
     * @return 结果
     */
    int insertDmsRepairWorkOrder(DmsRepairWorkOrder dmsRepairWorkOrder);

    /**
     * 修改维修工单
     *
     * @param dmsRepairWorkOrder 维修工单
     * @return 结果
     */
    int updateDmsRepairWorkOrder(DmsRepairWorkOrder dmsRepairWorkOrder);

    /**
     * 删除维修工单
     *
     * @param workOrderId 维修工单主键
     * @return 结果
     */
    int deleteDmsRepairWorkOrderByWorkOrderId(Long workOrderId);

    /**
     * 批量删除维修工单
     *
     * @param workOrderIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteDmsRepairWorkOrderByWorkOrderIds(Long[] workOrderIds);

    /**
     * 根据故障报修ID查询维修工单
     *
     * @param faultInstanceId 故障报修ID
     * @return 维修工单
     */
    DmsRepairWorkOrder selectByFaultInstanceId(@Param("faultInstanceId") Long faultInstanceId);

    /**
     * 查询工单统计信息
     *
     * @param dmsRepairWorkOrder 查询条件
     * @return 统计结果
     */
    List<DmsRepairWorkOrder> selectWorkOrderStatistics(DmsRepairWorkOrder dmsRepairWorkOrder);
}
