package com.lightinit.hsdataportal.impl;

import com.lightinit.hsdataportal.entity.Order;
import com.lightinit.hsdataportal.entity.OrderExample;
import com.lightinit.hsdataportal.mapper.OrderMapper;
import com.lightinit.hsdataportal.service.IWXPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WXPayServiceImpl implements IWXPayService {

    @Autowired
    private OrderMapper bizOrderMapper;

    /*
     *@Description 查询订单
     **/
    @Override
    public Order queryUserOrderByOrderNumber(String orderNumber) {
        OrderExample bizOrderExample = new OrderExample();
        bizOrderExample.createCriteria().andOrderNumberEqualTo(orderNumber);
        List<Order> list = bizOrderMapper.selectByExample(bizOrderExample);
        if(list==null||list.size()!=1){
            return null;
        }
        return list.get(0);
    }
}
