package com.fzm.mall.server.admin.order.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fzm.mall.server.admin.order.mapper.OrderDetailMapper;
import com.fzm.mall.server.admin.order.model.OrderDetail;
import com.fzm.mall.server.admin.order.service.IOrderDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 用户购物订单详情表 服务实现类
 * </p>
 *
 * @author fzm
 * @since 2021-05-24
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements IOrderDetailService {

    @Override
    public OrderDetail queryByOidAndSkuId(String oid, String skuId) {
        QueryWrapper<OrderDetail> qw = new QueryWrapper<>();
        qw.lambda().eq(OrderDetail::getOid, oid)
                .eq(OrderDetail::getSkuId, skuId);
        return getOne(qw);
    }
}
