package com.sysu.admin.support.system.organ;

import com.xiesx.fastboot.core.jpa.JpaPlusRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface OrganRepository extends JpaPlusRepository<Organ, Long> {




    @Query(value = "SELECT id FROM sys_organ order by id asc limit 1", nativeQuery = true)
    Long findFirstId();

    @Query(value = "SELECT id FROM sys_organ where parent_id = ?1 and is_del = 0", nativeQuery = true)
    List<Long> findIdByParentId(Long parentId);

}
