package kr.co.accura.wtm.domain.user.repository;

import kr.co.accura.wtm.domain.user.entity.OrgHierarchy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface OrgHierarchyRepository extends JpaRepository<OrgHierarchy, Long> {

    List<OrgHierarchy> findByParent_Id(Long parentId);

    List<OrgHierarchy> findByLevel(Integer level);

    List<OrgHierarchy> findByIsActiveTrueOrderBySortOrder();

    Optional<OrgHierarchy> findByCode(String code);
}
