package com.crm.manager.dao.repository;

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

    RiskLeverageLoginTable getFirstById(Long id);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    RiskLeverageLoginTable findFirstById(Long id);

    @Lock(LockModeType.PESSIMISTIC_WRITE)
    List<RiskLeverageLoginTable> findAllByIdIn(List<Long> ids);

    boolean existsByLogin(Long login);
}
