package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.OrderRefundMapper;
import com.ruoyi.system.domain.OrderRefund;
import com.ruoyi.system.service.IOrderRefundService;

/**
 * 订单退款Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-28
 */
@Service
public class OrderRefundServiceImpl implements IOrderRefundService 
{
    @Autowired
    private OrderRefundMapper orderRefundMapper;

    /**
     * 查询订单退款
     * 
     * @param id 订单退款主键
     * @return 订单退款
     */
    @Override
    public OrderRefund selectOrderRefundById(String id)
    {
        return orderRefundMapper.selectOrderRefundById(id);
    }

    /**
     * 查询订单退款列表
     * 
     * @param orderRefund 订单退款
     * @return 订单退款
     */
    @Override
    public List<OrderRefund> selectOrderRefundList(OrderRefund orderRefund)
    {
        return orderRefundMapper.selectOrderRefundList(orderRefund);
    }

    /**
     * 新增订单退款
     * 
     * @param orderRefund 订单退款
     * @return 结果
     */
    @Override
    public int insertOrderRefund(OrderRefund orderRefund)
    {
        orderRefund.setCreatedAt(new Date());
        orderRefund.setUpdatedAt(new Date());
        orderRefund.setState("0");
        return orderRefundMapper.insertOrderRefund(orderRefund);
    }

    /**
     * 修改订单退款
     * 
     * @param orderRefund 订单退款
     * @return 结果
     */
    @Override
    public int updateOrderRefund(OrderRefund orderRefund)
    {
        return orderRefundMapper.updateOrderRefund(orderRefund);
    }

    /**
     * 批量删除订单退款
     * 
     * @param ids 需要删除的订单退款主键
     * @return 结果
     */
    @Override
    public int deleteOrderRefundByIds(String[] ids)
    {
        return orderRefundMapper.deleteOrderRefundByIds(ids);
    }

    /**
     * 删除订单退款信息
     * 
     * @param id 订单退款主键
     * @return 结果
     */
    @Override
    public int deleteOrderRefundById(String id)
    {
        return orderRefundMapper.deleteOrderRefundById(id);
    }
}
