czt
2025-11-28 dec93e6c6923238869a5accf278028cdd6a18bec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.fzzy.igds.repository;
 
import com.fzzy.igds.domain.Dept;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
 
import java.util.List;
 
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/26 15:48
 */
@Service
public interface DeptRepository extends JpaRepository<Dept, String> {
 
    /**
     * 根据id获取信息
     *
     * @param parentId
     * @return
     */
    @Query("from Dept where id like:parentId order by id")
    List<Dept> getDataByParentId(@Param("parentId") String parentId);
 
    /**
     * 根据companyId获取信息
     *
     * @param id
     * @return
     */
    @Query("from Dept where id =:id order by id")
    List<Dept> getDataById(@Param("id") String id);
 
    /**
     * 根据companyId获取信息
     *
     * @param companyId
     * @return
     */
    @Query("from Dept where companyId =:companyId order by id")
    List<Dept> getAllData(@Param("companyId") String companyId);
}