package com.yn.bftl.thirdparty.modules.business.repository;

import com.yn.bftl.common.modules.subaccount.entity.ChinaumsRefund;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 银联退款单Repository
 *
 * @author huabiao
 * @create 2022/12/20  11:28
 **/
@Repository
public interface ChinaumsRefundRepository extends JpaRepository<ChinaumsRefund, Long> {

    /**
     * 银联退款单-根据平台退款单ID查询
     *
     * @param platformRefundId 平台退款单ID
     * @return 银联退款单数组
     * @author huabiao
     * @create 2022/12/20  14:28
     */
    List<ChinaumsRefund> findAllByPlatformRefundId(Long platformRefundId);

    /**
     * 银联退款单-根据原始订单号查询
     *
     * @param origTradeId 原始系统订单号
     * @return 银联退款单数组
     * @author huabiao
     * @create 2022/12/28  11:08
     */
    List<ChinaumsRefund> findAllByOrigTradeId(String origTradeId);

    /**
     * 银联退款单-根据平台订单号查询
     *
     * @param outOrderNo 平台订单号
     * @return 银联退款单
     * @author huabiao
     * @create 2023/9/8  11:09
     */
    ChinaumsRefund findFirstByOutOrderNo(String outOrderNo);

    /**
     * 银联退款单-根据平台退款单ID和退款状态查询
     *
     * @param platformRefundId 平台退款单ID
     * @param status           银联退款单状态
     * @return 银联退款单数组
     * @author huabiao
     * @create 2022/12/20  14:28
     */
    List<ChinaumsRefund> findAllByPlatformRefundIdAndStatus(Long platformRefundId, String status);

    /**
     * 银联退款单-根据平台退款单ID数组查询
     *
     * @param platformRefundIdList 平台退款单ID数组
     * @return 银联退款单列表
     * @description
     * @author huabiao
     * @create 2023/9/8  15:33
     */
    List<ChinaumsRefund> findAllByPlatformRefundIdIn(List<Long> platformRefundIdList);

}
