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 { @Query("from SysDept where parentId is null order by id") List listDept(); @Query("from SysDept where parentId=:parentId order by id") List listDeptByParent(@Param("parentId") String parentId); @Query("from SysDept where id=:id order by id") List listDeptById(@Param("id") String id); }