package com.bonus.material.lease.mapper;

import java.util.List;
import com.bonus.material.lease.domain.LeaseApplyDetails;
import com.bonus.material.lease.domain.LeaseOutDetails;
import org.apache.ibatis.annotations.Param;

/**
 * 领料任务详细Mapper接口
 * 
 * @author xsheng
 * @date 2024-10-16
 */
public interface LeaseApplyDetailsMapper {
    /**
     * 查询领料任务详细
     * 
     * @param id 领料任务详细主键
     * @return 领料任务详细
     */
    LeaseApplyDetails selectLeaseApplyDetailsById(Long id);

    /**
     * 查询领料任务详细列表
     * 
     * @param leaseApplyDetails 领料任务详细
     * @return 领料任务详细集合
     */
    List<LeaseApplyDetails> selectLeaseApplyDetailsList(LeaseApplyDetails leaseApplyDetails);

    /**
     * 新增领料任务详细
     * 
     * @param leaseApplyDetails 领料任务详细
     * @return 结果
     */
    int insertLeaseApplyDetails(LeaseApplyDetails leaseApplyDetails);

    int insertLeaseApplyDetailsList(List<LeaseApplyDetails> leaseApplyDetails);

    /**
     * 修改领料任务详细
     * 
     * @param leaseApplyDetails 领料任务详细
     * @return 结果
     */
    int updateLeaseApplyDetails(LeaseApplyDetails leaseApplyDetails);

    /**
     * 删除领料任务详细
     * 
     * @param id 领料任务详细主键
     * @return 结果
     */
    int deleteLeaseApplyDetailsById(Long id);

    /**
     * 批量删除领料任务详细
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteLeaseApplyDetailsByIds(Long[] ids);

    int deleteLeaseApplyDetailsByParentIds(Long[] ids);

    List<LeaseApplyDetails> getByParentId(Long parentId);

    /**
     * 修改 （lease_apply_details 领料任务详细表）的已领数量
     */
    int updateLeaseApplyDetailsOutNum(@Param("record") LeaseOutDetails leaseOutDetails);

    LeaseApplyDetails getLeaseApplyDetails(@Param("record") LeaseOutDetails record);

    int updateLeaseApplyDetailsByLeaseOutRecord(@Param("record") LeaseOutDetails record);

    LeaseApplyDetails getOutboundNum(LeaseOutDetails record);

    String selectMaTypeNameByParentId(Long parentId);
}
