package com.crm.manager.dao.repository;

import com.crm.rely.backend.core.pojo.table.RiskLeverageGroupExcludeLoginTable;
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 RiskLeverageGroupExcludeLoginRepository extends BaseRepository<RiskLeverageGroupExcludeLoginTable> {

    RiskLeverageGroupExcludeLoginTable getFirstById(Long id);

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

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

    List<RiskLeverageGroupExcludeLoginTable> getAllByLeverageGroupId(Long leverageGroupId);
}
