package com.sckw.order.repository;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sckw.core.model.base.BaseModel;
import com.sckw.order.dao.KwoTradeOrderAddressMapper;
import com.sckw.order.model.KwoTradeOrderAddress;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * @author :chenXiaoFei
 * @version :1.0
 * @description : 贸易订单地址信息接口
 * @create :2025-11-07 11:00:00
 */
@Repository
public class KwoTradeOrderAddressRepository extends ServiceImpl<KwoTradeOrderAddressMapper, KwoTradeOrderAddress> {
    public List<KwoTradeOrderAddress> queryByOrderIds(Set<Long> tradeOrderIds) {
        return list(Wrappers.<KwoTradeOrderAddress>lambdaQuery()
                .eq(BaseModel::getDelFlag,0)
                .in(KwoTradeOrderAddress::getTOrderId,tradeOrderIds));
    }

    public List<KwoTradeOrderAddress> queryByOrderId(Long tradeOrderId) {
        return list(Wrappers.<KwoTradeOrderAddress>lambdaQuery()
                .eq(BaseModel::getDelFlag,0)
                .eq(KwoTradeOrderAddress::getTOrderId,tradeOrderId));
    }
}
