package com.bonus.material.repair.mapper;

import java.util.List;

import com.bonus.material.back.domain.vo.MaCodeVo;
import com.bonus.common.biz.domain.repair.RepairInputDetails;
import com.bonus.material.basic.domain.BmQrcodeInfo;
import com.bonus.material.input.domain.InputApplyDetails;
import com.bonus.material.repair.domain.RepairInputInfo;
import org.apache.ibatis.annotations.Param;

/**
 * 修试后入库Mapper接口
 *
 * @author xsheng
 * @date 2024-10-16
 */
public interface RepairInputDetailsMapper {
    /**
     * 查询修试后入库
     *
     * @param repairInputDetails 修试后入库主键
     * @return 修试后入库
     */
    public List<RepairInputInfo> selectRepairInputDetailsById(RepairInputDetails repairInputDetails);

    /**
     * 查询修试后入库列表
     *
     * @param repairInputDetails 修试后入库
     * @return 修试后入库集合
     */
    public List<RepairInputDetails> selectRepairInputDetailsList(RepairInputDetails repairInputDetails);


    public int batchInsertRepairInputDetails(@Param("list") List<RepairInputDetails> list);

    /**
     * 新增修试后入库
     *
     * @param repairInputDetails 修试后入库
     * @return 结果
     */
    public int insertRepairInputDetails(RepairInputDetails repairInputDetails);

    /**
     * 修改修试后入库
     *
     * @param repairInputDetails 修试后入库
     * @return 结果
     */
    public int updateRepairInputDetails(RepairInputDetails repairInputDetails);

    /**
     * 删除修试后入库
     *
     * @param id 修试后入库主键
     * @return 结果
     */
    public int deleteRepairInputDetailsById(Long id);

    public int deleteRepairInputDetailsByTaskId(Long taskId);

    /**
     * 批量删除修试后入库
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteRepairInputDetailsByIds(Long[] ids);

    /**
     * 根据任务id查询状态
     * @param repairInputDetails
     * @return
     */
    List<String> selectStatusByTaskId(RepairInputDetails repairInputDetails);

    /**
     * 修改库存数量
     * @param repairInputInfo
     * @return
     */
    int updateNum(RepairInputInfo repairInputInfo);

    /**
     * 修改物资状态
     * @param repairInputInfo
     * @return
     */
    int updateMaStatus(RepairInputInfo repairInputInfo);

    /**
     * 查询物资编码
     * @param mdCodeVo
     * @return
     */
    List<MaCodeVo> getCodeList(MaCodeVo mdCodeVo);

    /**
     * 查询入库详情信息
     * @param repairInputDetails1
     * @return
     */
    List<RepairInputInfo> selectRepairDetailsById(RepairInputDetails repairInputDetails1);

    /**
     * 维修记录单
     * @param repairInputDetails
     * @return
     */
    int insertRad(RepairInputDetails repairInputDetails);

    /**
     * 根据任务id查询退料id
     * @param taskId
     * @return
     */
    Long selectBackIdByTaskId(Long taskId);

    /**
     * 根据任务id集合查询维修详情
     * @param taskIdList
     * @return
     */
    List<RepairInputDetails> selectRepairDetails(@Param("list") List<Long> taskIdList);

    /**
     * 根据二维码查询详情
     * @param bmQrcodeInfo
     * @return
     */
    List<RepairInputDetails> getInfoByQrcode(BmQrcodeInfo bmQrcodeInfo);

    RepairInputDetails selectInputInfoByMaId(InputApplyDetails inputApplyDetails);

    int updateInputNum(RepairInputDetails inputApplyDetails);

    int updateStorageNum(RepairInputDetails inputApplyDetails);

    int updateTaskStatus(RepairInputDetails inputApplyDetails);

    List<RepairInputDetails> selectInputTaskStatus(RepairInputDetails inputApplyDetails);

    List<RepairInputDetails> selectRepairListByBoxId(RepairInputDetails input);

    int updateBoxStatus(RepairInputDetails input);

    /**
     * 查询auditId是否存在入库表中
     * @param input
     * @return
     */
    int selectRepairInputDetailsByAuditId(RepairInputDetails input);

    /**
     * 根据taskId以及typeId查询该设备是否已经入库
     * @param repairInputDetails
     * @return
     */
    RepairInputDetails selectInfoNum(RepairInputDetails repairInputDetails);
}
