package com.younike.system.service.impl;

import java.util.List;
import java.time.LocalDateTime;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.younike.system.mapper.OrderPaymentMapper;
import com.younike.system.domain.OrderPayment;
import com.younike.system.service.IOrderPaymentService;

/**
 * 订单支付支付串Service业务层处理
 * 
 * @author elev
 * @date 2022-01-20
 */
@Service
public class OrderPaymentServiceImpl implements IOrderPaymentService {
    @Autowired
    private OrderPaymentMapper orderPaymentMapper;

    /**
     * 查询订单支付支付串
     * 
     * @param orderId 订单支付支付串主键
     * @return 订单支付支付串
     */
    @Override
    public OrderPayment selectOrderPaymentByOrderId(Long orderId) {
        return orderPaymentMapper.selectOrderPaymentByOrderId(orderId);
    }

    /**
     * 查询订单支付支付串列表
     * 
     * @param orderPayment 订单支付支付串
     * @return 订单支付支付串
     */
    @Override
    public List<OrderPayment> selectOrderPaymentList(OrderPayment orderPayment) {
        return orderPaymentMapper.selectOrderPaymentList(orderPayment);
    }

    /**
     * 新增订单支付支付串
     * 
     * @param orderPayment 订单支付支付串
     * @return 结果
     */
    @Override
    public int insertOrderPayment(OrderPayment orderPayment) {
        orderPayment.setCreateTime(LocalDateTime.now());
        return orderPaymentMapper.insertOrderPayment(orderPayment);
    }

    /**
     * 修改订单支付支付串
     * 
     * @param orderPayment 订单支付支付串
     * @return 结果
     */
    @Override
    public int updateOrderPayment(OrderPayment orderPayment) {
        orderPayment.setUpdateTime(LocalDateTime.now());
        return orderPaymentMapper.updateOrderPayment(orderPayment);
    }

    /**
     * 批量删除订单支付支付串
     * 
     * @param orderIds 需要删除的订单支付支付串主键
     * @return 结果
     */
    @Override
    public int deleteOrderPaymentByOrderIds(Long[] orderIds) {
        return orderPaymentMapper.deleteOrderPaymentByOrderIds(orderIds);
    }

    /**
     * 删除订单支付支付串信息
     * 
     * @param orderId 订单支付支付串主键
     * @return 结果
     */
    @Override
    public int deleteOrderPaymentByOrderId(Long orderId)
    {
        return orderPaymentMapper.deleteOrderPaymentByOrderId(orderId);
    }

    @Override
    public void clearPaymentStr(Long orderId) {
        orderPaymentMapper.clearPaymentStr(orderId);
    }
}
