package cn.quantgroup.customer.repo;

import cn.quantgroup.customer.entity.OfflineRepaySubmitRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.querydsl.QueryDslPredicateExecutor;

import java.util.List;

public interface OfflineRepaySubmitRecordRepo extends JpaRepository<OfflineRepaySubmitRecord,Long>, QueryDslPredicateExecutor<OfflineRepaySubmitRecord> {
    OfflineRepaySubmitRecord findBySerialNoEquals(String serialNo);

    OfflineRepaySubmitRecord findFirstByUniqueIdEquals(String uniqueId);

    OfflineRepaySubmitRecord findFirstByUniqueIdEqualsAndApprovalStatusNot(String uniqueId,Integer approvalStatus);

    List<OfflineRepaySubmitRecord> findByUserIdEqualsAndRepayTypeEquals(Integer userId,Integer repayType);

    List<OfflineRepaySubmitRecord> findByUserIdEqualsAndRepayTypeEqualsAndApprovalStatusNot(Integer userId,Integer repayType,Integer approvalStatus);

    OfflineRepaySubmitRecord findBySerialNoEqualsAndApprovalStatusEquals(String serialNo,Integer approvalStatus);
}
