package com.ghy.system.service.impl;

import java.util.List;
import com.ghy.common.utils.DateUtils;
import com.ghy.system.domain.AdapyPayment;
import com.ghy.system.mapper.AdapyPaymentMapper;
import com.ghy.system.service.IAdapyPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ghy.common.core.text.Convert;

/**
 * 支付流水Service业务层处理
 *
 * @author clunt
 * @date 2023-05-31
 */
@Service
public class AdapyPaymentServiceImpl implements IAdapyPaymentService
{
    @Autowired
    private AdapyPaymentMapper adapyPaymentMapper;

    /**
     * 查询支付流水
     *
     * @param paymentId 支付流水主键
     * @return 支付流水
     */
    @Override
    public AdapyPayment selectAdapyPaymentByPaymentId(String paymentId)
    {
        return adapyPaymentMapper.selectAdapyPaymentByPaymentId(paymentId);
    }

    /**
     * 查询支付流水列表
     *
     * @param adapyPayment 支付流水
     * @return 支付流水
     */
    @Override
    public List<AdapyPayment> selectAdapyPaymentList(AdapyPayment adapyPayment)
    {
        return adapyPaymentMapper.selectAdapyPaymentList(adapyPayment);
    }

    /**
     * 新增支付流水
     *
     * @param adapyPayment 支付流水
     * @return 结果
     */
    @Override
    public int insertAdapyPayment(AdapyPayment adapyPayment)
    {
        adapyPayment.setCreateTime(DateUtils.getNowDate());
        return adapyPaymentMapper.insertAdapyPayment(adapyPayment);
    }

    /**
     * 修改支付流水
     *
     * @param adapyPayment 支付流水
     * @return 结果
     */
    @Override
    public int updateAdapyPayment(AdapyPayment adapyPayment)
    {
        adapyPayment.setUpdateTime(DateUtils.getNowDate());
        return adapyPaymentMapper.updateAdapyPayment(adapyPayment);
    }

    /**
     * 批量删除支付流水
     *
     * @param paymentIds 需要删除的支付流水主键
     * @return 结果
     */
    @Override
    public int deleteAdapyPaymentByPaymentIds(String paymentIds)
    {
        return adapyPaymentMapper.deleteAdapyPaymentByPaymentIds(Convert.toStrArray(paymentIds));
    }

    /**
     * 删除支付流水信息
     *
     * @param paymentId 支付流水主键
     * @return 结果
     */
    @Override
    public int deleteAdapyPaymentByPaymentId(String paymentId)
    {
        return adapyPaymentMapper.deleteAdapyPaymentByPaymentId(paymentId);
    }
}
