package com.trade.service.trade.purchasecontract.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.trade.service.trade.filingdoc.vo.Contract4FilingDocSearch;
import com.trade.service.trade.filingdoc.vo.PurchaseContract4FilingDocVO;
import com.trade.service.trade.purchasecontract.dto.PurchaseContractDto;
import com.trade.service.trade.purchasecontract.dto.PurchaseContractSearchBaseDto;
import com.trade.service.trade.purchasecontract.domain.PurchaseContract;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 采购合同表基础表数据库访问
 *
 * @author hlb
 * @since 2024-09-07 16:23:15
 */
public interface PurchaseContractMapper extends BaseMapper<PurchaseContract> {

    /**
     * 根据查询条件获取采购合同列表
     * 
     * @param searchDto
     * @return
     */
    List<PurchaseContractDto> getPurchaseContractBySearch(PurchaseContractSearchBaseDto searchDto);

    /**
     * 根据id获取采购合同信息
     * 
     * @param id
     * @return
     */
    PurchaseContractDto getPurchaseContractById(Long id);

    /**
     * 根据销售合同编号获取采购合同详情
     * 
     * @param saleContractNo
     * @return
     */
    PurchaseContractDto findBySaleContractNo(@Param("customerUserId") Long customerUserId,
            @Param("saleContractNo") String saleContractNo, @Param("vendorEntityNo") String vendorEntityNo);

    PurchaseContractDto findByCustomerUserIdAndPurchaseContractNo(@Param("customerUserId") Long customerUserId,
            @Param("purchaseContractNo") String purchaseContractNo);

    List<PurchaseContract4FilingDocVO> queryList4FilingDocBySearch(Contract4FilingDocSearch search);
}
