package com.fs.live.service.impl;


import com.fs.common.utils.DateUtils;
import com.fs.live.domain.LiveOrderPayment;
import com.fs.live.mapper.LiveOrderPaymentMapper;
import com.fs.live.service.ILiveOrderPaymentService;
import com.fs.live.vo.LiveOrderPaymentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 支付明细Service业务层处理
 *
 * @author fs
 * @date 2025-08-07
 */
@Service
public class LiveOrderPaymentServiceImpl implements ILiveOrderPaymentService {
    @Autowired
    private LiveOrderPaymentMapper baseMapper;

    /**
     * 查询支付明细
     *
     * @param paymentId 支付明细主键
     * @return 支付明细
     */
    @Override
    public LiveOrderPayment selectLiveOrderPaymentByPaymentId(Long paymentId)
    {
        return baseMapper.selectLiveOrderPaymentByPaymentId(paymentId);
    }

    /**
     * 查询支付明细列表
     *
     * @param liveOrderPayment 支付明细
     * @return 支付明细
     */
    @Override
    public List<LiveOrderPayment> selectLiveOrderPaymentList(LiveOrderPayment liveOrderPayment)
    {
        return baseMapper.selectLiveOrderPaymentList(liveOrderPayment);
    }

    @Override
    public List<LiveOrderPaymentVo> selectLiveOrderPaymentVoList(LiveOrderPaymentVo liveOrderPayment) {
        return baseMapper.selectLiveOrderPaymentVoList(liveOrderPayment);
    }

    @Override
    public LiveOrderPaymentVo selectLiveOrderPaymentByPaymentIdNew(Long paymentId) {
        return baseMapper.selectLiveOrderPaymentByPaymentIdNew(paymentId);
    }

    @Override
    public List<LiveOrderPayment> selectLiveOrderPaymentByOrderId(Long id) {
        return baseMapper.selectLiveOrderPaymentByOrderId(id);
    }

    @Override
    public LiveOrderPayment selectByBussinessId(Long orderId) {
        return baseMapper.selectByBuissnessId(orderId);
    }

    /**
     * 新增支付明细
     *
     * @param liveOrderPayment 支付明细
     * @return 结果
     */
    @Override
    public int insertLiveOrderPayment(LiveOrderPayment liveOrderPayment)
    {
        liveOrderPayment.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertLiveOrderPayment(liveOrderPayment);
    }

    /**
     * 修改支付明细
     *
     * @param liveOrderPayment 支付明细
     * @return 结果
     */
    @Override
    public int updateLiveOrderPayment(LiveOrderPayment liveOrderPayment)
    {
        return baseMapper.updateLiveOrderPayment(liveOrderPayment);
    }

    /**
     * 批量删除支付明细
     *
     * @param paymentIds 需要删除的支付明细主键
     * @return 结果
     */
    @Override
    public int deleteLiveOrderPaymentByPaymentIds(Long[] paymentIds)
    {
        return baseMapper.deleteLiveOrderPaymentByPaymentIds(paymentIds);
    }

    /**
     * 删除支付明细信息
     *
     * @param paymentId 支付明细主键
     * @return 结果
     */
    @Override
    public int deleteLiveOrderPaymentByPaymentId(Long paymentId)
    {
        return baseMapper.deleteLiveOrderPaymentByPaymentId(paymentId);
    }


}
