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

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

/**
 * 分账退款单
 *
 * @author huabiao
 * @create 2023/5/4  16:20
 **/
@Repository
public interface SubaccountRefundRepository extends JpaRepository<SubaccountRefund, Long> {

    /**
     * 分账退款单-根据单号查询
     *
     * @param sn 单号
     * @return 分账退款单
     * @author huabiao
     * @create 2023/5/4  17:48
     */
    SubaccountRefund findFirstBySn(String sn);

    /**
     * 分账退款单-根据退款单号和分账类型
     *
     * @param refundSn       退款单号
     * @param subaccountType 分账类型
     * @return 分账退款单
     * @author huabiao
     * @create 2023/5/5  10:27
     */
    SubaccountRefund findFirstByRefundSnAndSubaccountType(String refundSn, SubaccountType subaccountType);
}
