package com.trade.service.order.service.impl;

import java.util.List;

import javax.annotation.Resource;

import com.trade.service.order.domain.PurchaseOrderInvoice;
import com.trade.service.order.mapper.PurchaseOrderInvoiceMapper;
import com.trade.service.order.service.PurchaseOrderInvoiceService;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * <p>
 * 销售订单-发票信息 服务实现类
 * </p>
 *
 * @author wl
 * @since 2024-09-14
 */
@Service
public class PurchaseOrderInvoiceServiceImpl extends ServiceImpl<PurchaseOrderInvoiceMapper, PurchaseOrderInvoice> implements PurchaseOrderInvoiceService {

    /**
     * 根据订单id获取发票信息
     *
     * @param orderId 订单id
     * @return 发票信息
     */
    @Override
    public PurchaseOrderInvoice getByOrderId(Long orderId) {
        return this.baseMapper.selectOne(new QueryWrapper<PurchaseOrderInvoice>().eq("order_id", orderId));
    }
}
