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

import com.xingxi.common.core.text.Convert;
import com.xingxi.common.utils.DateUtils;
import com.xingxi.business.PaymentInfo.domain.PaymentInfo;
import com.xingxi.business.PaymentInfo.mapper.PaymentInfoMapper;
import com.xingxi.business.PaymentInfo.service.IPaymentInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 支付信息Service业务层处理
 *
 * @author xingxi
 * @date 2025-03-06
 */
@Service
public class PaymentInfoServiceImpl implements IPaymentInfoService {
    @Resource
    private PaymentInfoMapper paymentInfoMapper;

    /**
     * 查询支付信息
     *
     * @param payId 支付信息主键
     * @return 支付信息
     */
    @Override
    public PaymentInfo selectPaymentInfoByPayId(Long payId) {
        return paymentInfoMapper.selectPaymentInfoByPayId(payId);
    }

    /**
     * 查询支付信息列表
     *
     * @param paymentInfo 支付信息
     * @return 支付信息
     */
    @Override
    public List<PaymentInfo> selectPaymentInfoList(PaymentInfo paymentInfo) {
        return paymentInfoMapper.selectPaymentInfoList(paymentInfo);
    }

    /**
     * 新增支付信息
     *
     * @param paymentInfo 支付信息
     * @return 结果
     */
    @Override
    public int insertPaymentInfo(PaymentInfo paymentInfo) {
        paymentInfo.setCreateTime(DateUtils.getNowDate());
        return paymentInfoMapper.insertPaymentInfo(paymentInfo);
    }

    /**
     * 新增支付信息
     *
     * @param paymentInfoList 支付信息
     * @return 结果
     */
    @Override
    public int batchInsertPaymentInfo(List<PaymentInfo> paymentInfoList) {
        return paymentInfoMapper.batchInsertPaymentInfo(paymentInfoList);
    }

    /**
     * 修改支付信息
     *
     * @param paymentInfo 支付信息
     * @return 结果
     */
    @Override
    public int updatePaymentInfo(PaymentInfo paymentInfo) {
        paymentInfo.setUpdateTime(DateUtils.getNowDate());
        return paymentInfoMapper.updatePaymentInfo(paymentInfo);
    }

    /**
     * 批量删除支付信息
     *
     * @param payIds 需要删除的支付信息主键
     * @return 结果
     */
    @Override
    public int deletePaymentInfoByPayIds(String payIds) {
        return paymentInfoMapper.deletePaymentInfoByPayIds(Convert.toStrArray(payIds));
    }

    /**
     * 删除支付信息信息
     *
     * @param payId 支付信息主键
     * @return 结果
     */
    @Override
    public int deletePaymentInfoByPayId(Long payId) {
        return paymentInfoMapper.deletePaymentInfoByPayId(payId);
    }

    /**
     * 逻辑删除支付信息
     *
     * @param payId 支付信息主键
     * @return 结果
     */
    @Override
    public int logicDeletePaymentInfoByPayId(Long payId) {
        return paymentInfoMapper.logicDeletePaymentInfoByPayId(payId);
    }

    /**
     * 逻辑批量删除支付信息
     *
     * @param payIds 需要删除的数据主键集合
     * @return 结果
     */
    @Override
    public int logicDeletePaymentInfoByPayIds(String[] payIds) {
        return paymentInfoMapper.logicDeletePaymentInfoByPayIds(payIds);
    }

    /**
     * 逻辑批量删除支付信息
     *
     * @param paymentInfo 支付信息
     * @return 结果
     */
    @Override
    public int logicDeletePaymentInfoByCondition(PaymentInfo paymentInfo) {
        return paymentInfoMapper.logicDeletePaymentInfoByCondition(paymentInfo);
    }
}
