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 { /** * 获取所有的部件父子关系 * @return */ List findExtAll(); /** * 根据用户id获取部件信息 * @param userId * @return */ List getByUserPerms(@Param("userId") String userId); /** * 根据用户id获取部件信息 向上查询父 * @param userId * @return */ List getByUserPermsAs(@Param("userId") String userId); /** * 根据父节点查询所有子节点数据 * @return */ List findByParentId(@Param("parentId") String parentId); /** * 根据用户id及父节点id获取部件信息 * @return */ List 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 findComponentHierarchy(@Param("componentId") String componentId); }