zhangherong
2025-06-25 23855599412c4d61b38d78f0f3abd3430a48b5b1
lxzn-module-dnc/src/main/java/org/jeecg/modules/dnc/mapper/ComponentInfoMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,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);
}