package com.bonus.material.repair.mapper;

import java.util.List;

import com.bonus.material.repair.domain.RepairAuditDetails;
import com.bonus.material.repair.domain.RepairPart;
import com.bonus.material.repair.domain.RepairRecord;
import com.bonus.material.repair.domain.RepairTaskDetails;
import com.bonus.common.biz.domain.vo.KeyValueVO;
import com.bonus.material.repair.domain.vo.RepairAuditDetailsVO;
import com.bonus.material.repair.domain.vo.RepairHomeInfo;
import com.bonus.material.repair.domain.vo.ScrapApplyDetailsVO;
import org.apache.ibatis.annotations.Param;

/**
 * 修试审核详细Mapper接口
 * 
 * @author syruan
 */
public interface RepairAuditDetailsMapper {

    RepairAuditDetails getRepairId(RepairAuditDetails repairAuditDetails);

    List<RepairPart> getPartRecord(RepairAuditDetails bean);

    List<RepairPart> getPartDetailsByTaskId(RepairAuditDetails repairAuditDetails);

    List<RepairPart> getPartRecordNum(RepairAuditDetails repairAuditDetails);

    List<RepairRecord> getRepairRecord(RepairAuditDetails repairAuditDetails);

    /**
     * 导出
     */
    List<RepairAuditDetailsVO> exportRepairQuestList(RepairAuditDetails bean);

    /**
     * 查询修试审核详细
     * 
     * @param id 修试审核详细主键
     * @return 修试审核详细
     */
    RepairAuditDetails selectRepairAuditDetailsById(Long id);

    /**
     * 查询修试审核详细列表
     * 
     * @param repairAuditDetails 修试审核详细
     * @return 修试审核详细集合
     */
    List<RepairAuditDetails> selectRepairAuditDetailsList(RepairAuditDetails repairAuditDetails);

    List<RepairAuditDetails> selectRepairAuditDetailsByTaskIds(@Param("taskIds") List<Long> taskIds);

    /**
     * 新增修试审核详细
     * 
     * @param repairAuditDetails 修试审核详细
     * @return 结果
     */
    int insertRepairAuditDetails(RepairAuditDetails repairAuditDetails);

    /**
     * 修改修试审核详细
     * 
     * @param repairAuditDetails 修试审核详细
     * @return 结果
     */
    int updateRepairAuditDetails(RepairAuditDetails repairAuditDetails);

    /**
     * 批量修改修试审核详细--批量
     *
     * @param ids 批量修试审核详细
     * @return 结果
     */
    int updateRepairAuditDetailsBatch(@Param("ids") List<Long> ids, @Param("status") String status, @Param("auditBy") Long auditBy);

    /**
     * 删除修试审核详细
     * 
     * @param id 修试审核详细主键
     * @return 结果
     */
    int deleteRepairAuditDetailsById(Long id);

    int deleteRepairAuditDetailsByTaskId(Long taskId);

    int deleteRepairAuditDetailsByRepairId(@Param("repairId") Long repairId);

    /**
     * 批量删除修试审核详细
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteRepairAuditDetailsByIds(Long[] ids);

    List<ScrapApplyDetailsVO> selectRepairQuestList(RepairAuditDetails repairAuditDetails);

    /**
     * 根据taskId查询单个规格名称---单个
     * @param taskId 任务id
     */
    String selectTypeNameByTaskId(Long taskId);

    /**
     * 根据taskIds批量查询规格名称---批量
     * @param taskIds 任务id集合
     */
    List<KeyValueVO> selectTypeNamesByTaskIds(@Param("taskIds") List<Long> taskIds);

    List<RepairAuditDetails> selectRepairAuditDetailsByTaskId(Long taskId);

    /**
     * 根据taskId查询未审核的数据
     * @param taskId 任务id
     */
    List<RepairAuditDetails> selectNotAuditByTaskId(Long taskId);

    List<RepairAuditDetails> selectRepairInputByTaskId(Long taskId);

    List<RepairAuditDetails> selectScrapNumByTaskId(Long taskId);

    void updateStatus(RepairAuditDetails bean);

    void updateRepairCost(RepairAuditDetails inputDetails, char status);

    void insertRepairDetails(RepairTaskDetails repairTaskDetails);

    Long getBackId(Long repairId);

    List<String> getRepairApplyRecordId(Long repairId);

    void updateRecodeStatus(String id);

    /**
     * 修改机具状态
     * @param details
     */
    void updateMachine(RepairAuditDetails details);

    /**
     * 查询修试审核任务详情
     * @param repairAuditDetails
     * @return
     */
    List<RepairAuditDetails> getDetailsList(RepairAuditDetails repairAuditDetails);

    /**
     * 查询总接收数量
     * @param dto
     * @return
     */
    List<RepairHomeInfo> getRepairHomeList(RepairHomeInfo dto);

    /**
     * 查询修饰一览详情数据
     * @param repairHomeInfo
     * @return
     */
    List<RepairHomeInfo> selectDetails(RepairHomeInfo repairHomeInfo);

    /**
     * 删除repair_apply_record
     * @param repairAuditDetails
     * @return
     */
    int deleteRepairRecordByTaskId(RepairAuditDetails repairAuditDetails);

    /**
     * 查询审核状态
     * @param taskId
     * @return
     */
    List<RepairAuditDetails> getAuditStatus(Long taskId);
}
