cuijian
2025-06-16 ec1bf4658e36a17f971a54007920a44c5378b7dc
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
46
47
package org.jeecg.modules.dnc.mapper;
 
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.dnc.dto.ComponentExt;
import org.jeecg.modules.dnc.entity.ComponentInfo;
 
import java.util.List;
 
public interface ComponentInfoMapper extends BaseMapper<ComponentInfo> {
    /**
     * 获取所有的部件父子关系
     * @return
     */
    List<ComponentExt> findExtAll();
    /**
     * 根据用户id获取部件信息
     * @param userId
     * @return
     */
    List<ComponentExt> getByUserPerms(@Param("userId") String userId);
 
    /**
     * 根据用户id获取部件信息 向上查询父
     * @param userId
     * @return
     */
    List<ComponentExt> getByUserPermsAs(@Param("userId") String userId);
    /**
     * 根据父节点查询所有子节点数据
     * @return
     */
    List<ComponentExt> findByParentId(@Param("parentId") String parentId);
    /**
     * 根据用户id及父节点id获取部件信息
     * @return
     */
    List<ComponentExt> getByParentIdAndUserPerms(@Param("parentId") String parentId, @Param("userId") String userId);
 
    @Select("SELECT * FROM nc_component_info WHERE component_id = #{componentId}")
    ComponentInfo selectById(@Param("componentId") String componentId);
 
    // 递归查询部件层级结构
    List<ComponentInfo> findComponentHierarchy(@Param("componentId") String componentId);
 
}