package com.xingxi.business.RefundInfo.service.impl;

import java.util.List;

import com.xingxi.common.core.text.Convert;
import com.xingxi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xingxi.business.RefundInfo.mapper.RefundInfoMapper;
import com.xingxi.business.RefundInfo.domain.RefundInfo;
import com.xingxi.business.RefundInfo.service.IRefundInfoService;

/**
 * 退款信息Service业务层处理
 * 
 * @author Xingxi
 * @date 2025-05-12
 */
@Service
public class RefundInfoServiceImpl implements IRefundInfoService 
{
    @Autowired
    private RefundInfoMapper refundInfoMapper;

    /**
     * 查询退款信息
     * 
     * @param id 退款信息主键
     * @return 退款信息
     */
    @Override
    public RefundInfo selectRefundInfoById(Long id)
    {
        return refundInfoMapper.selectRefundInfoById(id);
    }

    /**
     * 查询退款信息列表
     * 
     * @param refundInfo 退款信息
     * @return 退款信息
     */
    @Override
    public List<RefundInfo> selectRefundInfoList(RefundInfo refundInfo)
    {
        return refundInfoMapper.selectRefundInfoList(refundInfo);
    }

    /**
     * 新增退款信息
     * 
     * @param refundInfo 退款信息
     * @return 结果
     */
    @Override
    public int insertRefundInfo(RefundInfo refundInfo)
    {
        refundInfo.setCreateTime(DateUtils.getNowDate());
        return refundInfoMapper.insertRefundInfo(refundInfo);
    }

    /**
     * 新增退款信息
     *
     * @param refundInfoList 退款信息
     * @return 结果
     */
    @Override
    public int batchInsertRefundInfo(List<RefundInfo> refundInfoList)
    {
        return refundInfoMapper.batchInsertRefundInfo(refundInfoList);
    }

    /**
     * 修改退款信息
     * 
     * @param refundInfo 退款信息
     * @return 结果
     */
    @Override
    public int updateRefundInfo(RefundInfo refundInfo)
    {
        refundInfo.setUpdateTime(DateUtils.getNowDate());
        return refundInfoMapper.updateRefundInfo(refundInfo);
    }

    /**
     * 批量删除退款信息
     * 
     * @param ids 需要删除的退款信息主键
     * @return 结果
     */
    @Override
    public int deleteRefundInfoByIds(String ids)
    {
        return refundInfoMapper.deleteRefundInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除退款信息信息
     * 
     * @param id 退款信息主键
     * @return 结果
     */
    @Override
    public int deleteRefundInfoById(Long id)
    {
        return refundInfoMapper.deleteRefundInfoById(id);
    }

    /**
     * 逻辑删除退款信息
     *
     * @param id 退款信息主键
     * @return 结果
     */
    @Override
    public int logicDeleteRefundInfoById(Long id)
    {
        return refundInfoMapper.logicDeleteRefundInfoById(id);
    }

    /**
     * 逻辑批量删除退款信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    @Override
    public int logicDeleteRefundInfoByIds(String[] ids)
    {
        return refundInfoMapper.logicDeleteRefundInfoByIds(ids);
    }

    /**
     * 逻辑批量删除退款信息
     *
     * @param refundInfo 退款信息
     * @return 结果
     */
    @Override
    public int logicDeleteRefundInfoByCondition(RefundInfo refundInfo)
    {
        return refundInfoMapper.logicDeleteRefundInfoByCondition(refundInfo);
    }

}
