CZT
2023-09-15 d6aa5189807dbbb1532e093af075473d28f52aae
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}