package com.sckw.order.serivce;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sckw.order.dao.KwoTradeOrderTransportMapper;
import com.sckw.order.model.KwoTradeOrderTransport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xucaiqin
 * @date 2025-11-16 14:28:07
 */
@Service
public class KwoTradeOrderTransportService {

    @Autowired
    private KwoTradeOrderTransportMapper kwoTradeOrderTransportMapper;

    public void insert(KwoTradeOrderTransport kwoTradeOrderTransport) {
        kwoTradeOrderTransport.setDelFlag(0);
        kwoTradeOrderTransportMapper.insert(kwoTradeOrderTransport);
    }

    /**
     * @param id 贸易订单id
     * @return
     */
    public List<KwoTradeOrderTransport> queryList(Long id) {
        return kwoTradeOrderTransportMapper.selectList(new LambdaQueryWrapper<KwoTradeOrderTransport>().eq(KwoTradeOrderTransport::getTOrderId, id).eq(KwoTradeOrderTransport::getDelFlag, 0));
    }
}
