package com.hzs.scm.purchase.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzs.common.domain.scm.purchase.IcPurchaseInH;
import com.hzs.common.domain.scm.purchase.ext.IcPurchaseInBExt;
import com.hzs.common.domain.scm.purchase.ext.IcPurchaseInHExt;
import com.hzs.scm.purchase.param.PurchaseInParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 采购订单表头 Mapper 接口
 * </p>
 *
 * @author hzs
 * @since 2023-11-17
 */
public interface IcPurchaseInHMapper extends BaseMapper<IcPurchaseInH> {

    /*
     * @description: 根据主键查询入库单
     * @author: sui q
     * @date: 2023/11/24 13:52
     * @param: null null
     **/
    IcPurchaseInHExt queryPurchaseInhExtById(@Param("pkId") Long pkId, @Param("orderStatus") Integer orderStatus, @Param("pkCountry") Integer pkCountry);

    /*
     * @description: 查询会员端显示的采购入库单
     * @author: sui q
     * @date: 2023/11/25 9:55
     * @param: null null
     **/
    List<IcPurchaseInHExt> queryDisPurchaseInhExtByCondition(PurchaseInParam purchaseInParam);

    /*
     * @description: 查询统计报表，采购入库单汇总
     * @author: sui q
     * @date: 2024/2/22 14:42
     * @param: null null
     **/
    List<IcPurchaseInHExt> queryTotalPurchaseInhExtByCondition(PurchaseInParam purchaseInParam);


    /*
     * @description: 退货更新采购入库单，更新为部分退货或退货
     * @author: sui q
     * @date: 2024/4/12 9:47
     * @param: null null
     **/
    void mergePurchaseInExt(@Param("icPurchaseInbList") List<IcPurchaseInBExt> icPurchaseInbList, @Param("userId") Long userId);
}
