package com.crm.manager.dao.repository;

import com.crm.rely.backend.core.pojo.table.RiskLeverageGroupRuleTable;
import com.crm.rely.backend.core.pojo.table.RiskRevokeCreditRuleExcludeLoginTable;
import com.crm.rely.backend.dao.repository.BaseRepository;
import org.springframework.data.jpa.repository.Lock;
import org.springframework.stereotype.Repository;

import javax.persistence.LockModeType;
import java.util.List;

/**
 * @author: houn
 */
@Repository
public interface RiskLeverageGroupRuleRepository extends BaseRepository<RiskLeverageGroupRuleTable> {

    RiskLeverageGroupRuleTable getFirstById(Long id);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    List<RiskLeverageGroupRuleTable> findAllByLeverageGroupIdIn(List<Long> leverageGroupIds);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    List<RiskLeverageGroupRuleTable> findAllByLeverageGroupId(Long leverageGroupId);

    List<RiskLeverageGroupRuleTable> getAllByLeverageGroupId(Long leverageGroupId);
}
