package com.yonge.cooleshow.portal.service.impl;

import com.yonge.cooleshow.mbg.mapper.UserOrderPaymentMapper;
import com.yonge.cooleshow.mbg.model.UserOrderPayment;
import com.yonge.cooleshow.portal.service.UserOrderPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Description
 *
 * @author liujunchi
 * @date 2022-04-24
 */
@Service
public class UserOrderPaymentServiceImpl implements UserOrderPaymentService {

    @Autowired
    private UserOrderPaymentMapper userOrderPaymentMapper;

    @Override
    public UserOrderPayment getByOrderNo(String orderNo) {
        return userOrderPaymentMapper.selectByOrderNo(orderNo);
    }

    @Override
    public void save(UserOrderPayment userOrderPayment) {
        userOrderPaymentMapper.insert(userOrderPayment);
    }

    @Override
    public void saveOrUpdate(UserOrderPayment userOrderPayment) {
        if (userOrderPayment.getId() == null) {
            userOrderPaymentMapper.insert(userOrderPayment);
        } else {
            userOrderPaymentMapper.updateByPrimaryKeySelective(userOrderPayment);
        }
    }
}
