package com.izouma.nineth.repo;

import com.izouma.nineth.domain.UserFundChangeLog;
import com.izouma.nineth.enums.FundChangeType;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.time.LocalDateTime;
import java.util.Optional;

public interface UserFundChangeLogRepo extends JpaRepository<UserFundChangeLog, Long>, JpaSpecificationExecutor<UserFundChangeLog> {

    /**
     * 查找资金流水
     * @param orderNo
     * @return
     */
    @Query("select ufc from UserFundChangeLog  ufc where ufc.del = false and ufc.changeType = ?1  and ufc.orderNo = ?2 ")
    Optional<UserFundChangeLog> findByChangeTypeAndOrderNo(FundChangeType type, String orderNo);


}
