/**
 * @filename:PurchaseOrderMapper 2024-09-10
 * @project KJT v1.0.0 Copyright(c) 2024 wanglang Co. Ltd. All right reserved.
 */
package com.trade.service.trade.purchaseorder.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.trade.service.trade.purchaseorder.domain.PurchaseOrder;
import com.trade.service.trade.purchaseorder.dto.PurchaseSearchDto;
import com.trade.service.trade.purchaseorder.vo.PurchaseOrderDetailsVo;
import com.trade.service.trade.purchaseorder.vo.PurchaseOrderVo;
import com.trade.service.trade.purchaseorder.vo.TradingPlatformInvoiceVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description:采购订单信息数据访问层
 * @version: v1.0.0
 * @author: wanglang
 */
@Mapper
public interface PurchaseOrderMapper extends BaseMapper<PurchaseOrder> {

    /**
     * 根据条件查询采购订单信息
     * 
     * @param purchaseSearch
     * @return 采购订单信息
     */
    List<PurchaseOrderVo> selectByCondition(PurchaseSearchDto purchaseSearch);

    /**
     * 根据id查询采购订单详情
     * 
     * @param id 采购订单id
     * @return 采购订单详情
     */
    PurchaseOrderDetailsVo selectDetailsById(@Param("id") Long id);

    /**
     * 查询所有采购订单的代理公司税号
     * 
     * @param ids
     * @param invoicePullStatus
     * @return
     */
    List<TradingPlatformInvoiceVo> selectAgencyTaxNum(@Param("ids") List<Long> ids,
            @Param("invoicePullStatus") String invoicePullStatus);

    /**
     * 查询所有采购订单的代理公司税号
     *
     * @param ids
     * @param invoicePullStatus
     * @return
     */
    List<TradingPlatformInvoiceVo> selectCustTaxNum(@Param("ids") List<Long> ids,
            @Param("invoicePullStatus") String invoicePullStatus);

    /**
     * 查询所有采购订单的非代理公司税号
     *
     * @param ids
     * @param invoicePullStatus
     * @return
     */
    List<TradingPlatformInvoiceVo> selectClientTaxNum(@Param("ids") List<Long> ids,
            @Param("invoicePullStatus") String invoicePullStatus);

    /**
     * 更新采购订单的发票拉取状态
     * 
     * @param id
     * @param status
     * @return
     */
    int updateInvoicePullStatus(@Param("id") Long id, @Param("status") String status);
}
