package cn.pluss.platform.merchantOrderSplit.impl;

import cn.pluss.platform.entity.MerchantOrderSplitDetail;
import cn.pluss.platform.mapper.MerchantOrderSplitDetailMapper;
import cn.pluss.platform.merchantOrderSplit.MerchantOrderSplitDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 分账明细详情表 服务实现类
 * </p>
 *
 * @author bzg
 * @since 2022-07-01
 */
@Service
public class MerchantOrderSplitDetailServiceImpl extends ServiceImpl<MerchantOrderSplitDetailMapper, MerchantOrderSplitDetail> implements MerchantOrderSplitDetailService {

    @Override
    public List<MerchantOrderSplitDetail> listByOrderNumber(String orderNumber) {
        QueryWrapper<MerchantOrderSplitDetail> queryWrapper = new QueryWrapper<MerchantOrderSplitDetail>()
                .eq("orderNumber",orderNumber);
        return baseMapper.selectList(queryWrapper);
    }

    /**
     * 根据订单号和商户编号code查询分账详情订单信息
     * @param orderNumber
     * @param merchantCode
     * @return
     */
    @Override
    public MerchantOrderSplitDetail getByOrderNumberAndMerchantCode(String orderNumber, String merchantCode) {
        return baseMapper.getByOrderNumberAndMerchantCode(orderNumber,merchantCode);
    }
}
