package com.fzzy.sys.repository;
|
|
import com.fzzy.sys.entity.SysDept;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.data.repository.query.Param;
|
|
import java.util.List;
|
|
public interface DeptRepository extends JpaRepository<SysDept, String> {
|
|
|
@Query("from SysDept where parentId is null order by id")
|
List<SysDept> listDept();
|
|
@Query("from SysDept where parentId=:parentId order by id")
|
List<SysDept> listDeptByParent(@Param("parentId") String parentId);
|
|
@Query("from SysDept where id=:id order by id")
|
List<SysDept> listDeptById(@Param("id") String id);
|
}
|