package com.bonus.sgzb.material.mapper;

import com.bonus.sgzb.material.domain.PurchaseCheckDetails;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * 新购验收任务详细purchase_check_detailsMapper接口
 *
 * @author bonus
 * @date 2023-12-10
 */
@Mapper
public interface PurchaseCheckDetailsMapper {
    /**
     * 查询新购验收任务详细purchase_check_details
     *
     * @param taskId 新购验收任务详细purchase_check_details主键
     * @return 新购验收任务详细purchase_check_details
     */
    public List<PurchaseCheckDetails> selectPurchaseCheckDetailsByTaskId(Long taskId);

    /**
     * 查询新购验收任务详细purchase_check_details列表
     *
     * @param purchaseCheckDetails 新购验收任务详细purchase_check_details
     * @return 新购验收任务详细purchase_check_details集合
     */
    public List<PurchaseCheckDetails> selectPurchaseCheckDetailsList(PurchaseCheckDetails purchaseCheckDetails);

    /**
     * 新增新购验收任务详细purchase_check_details
     *
     * @param purchaseCheckDetails 新购验收任务详细purchase_check_details
     * @return 结果
     */
    public int insertPurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);

    /**
     * 修改新购验收任务详细purchase_check_details
     *
     * @param purchaseCheckDetails 新购验收任务详细purchase_check_details
     * @return 结果
     */
    public int updatePurchaseCheckDetails(PurchaseCheckDetails purchaseCheckDetails);

    /**
     * 删除新购验收任务详细purchase_check_details
     *
     * @param id 新购验收任务详细purchase_check_details主键
     * @return 结果
     */
    public int deletePurchaseCheckDetailsByTaskId(Long id);

    /**
     * 批量删除新购验收任务详细purchase_check_details
     *
     * @param taskIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deletePurchaseCheckDetailsByTaskIds(Long[] taskIds);

    /**
     * 插入
     * @param purchaseCheckDetailsList
     * @return
     */
    int insertPurchaseCheckDetailsList(@Param("purchaseCheckDetailsList") List<PurchaseCheckDetails> purchaseCheckDetailsList);

    /**
     * 修改
     * @param taskId
     * @return
     */
    int updateCheckDetailsByTaskId(Long taskId);

    /**
     * 是否为全部不通过
     * @param taskId
     * @return
     */
    int selectPurchaseCheckDetailsStatus(Long taskId);

    /**
     *删除全部的任务详情信息
     * @param taskId
     * @return
     */
    int deleteCheckDetailsByTaskId(Long taskId);

    /**
     * 修改
     * @param purchaseCheckDetails
     * @return
     */
    int updateByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails);

    /**
     * 修改
     * @param purchaseCheckDetails
     * @return
     */
    int updateBindByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails);

    /**
     * 查询
     * @param taskId
     * @param typeId
     * @return
     */
    int selectInputNumByTypeId(@Param("taskId") Long taskId, @Param("typeId") Long typeId);

    /**
     * 查询
     * @param typeId
     * @param taskId
     * @return int
     */
    Integer selectBindNumByTypeId(@Param("typeId") Long typeId, @Param("taskId") Long taskId);

    /**
     * 判断是否全部已操作（不通过或通过）
     * @param taskId
     * @return int
     */
    int isOperateAll(Long taskId);

    /**
     * 修改purchase_check_details表
     * @param typeId
     * @param taskId
     * @return int
     */
    int updatePurchaseCheckDetailsByTaskId(@Param("taskId") Long taskId,@Param("typeId") Long typeId);

    /**
    * 新购验收单
    * @param purchaseCheckDetails
    * @return List<PurchaseCheckDetails>
    */
    List<PurchaseCheckDetails> getAcceptanceForm(PurchaseCheckDetails purchaseCheckDetails);

    /**
     * 修改
     * @param purchaseCheckDetails
     * @return
     */
    int updateStatusByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails);

    int updateByTaskId(@Param("taskId") Long taskId,@Param("typeId") Long typeId);

    int uploadPic(PurchaseCheckDetails purchaseCheckDetails);
}
