package org.jeecg.modules.resManager.catalog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.modules.resManager.catalog.entity.Rescatalog;

import java.util.List;
import java.util.Map;

/**
 * @Description: rescatalog
 * @Author: jeecg-boot
 * @Date:   2022-07-06
 * @Version: V1.0
 */
public interface RescatalogMapper extends BaseMapper<Rescatalog> {

	/**
	 * 编辑节点状态
	 *
	 * @param id
	 * @param status
	 */
	void updateTreeNodeStatus(@Param("id") String id, @Param("status") String status);

	/**
	 * 【vue3专用】根据父级ID查询树节点数据
	 *
	 * @param pid
	 * @param query
	 * @return
	 */
	List<SelectTreeModel> queryListByPid(@Param("pid") String pid, @Param("query") Map<String, String> query);

	/**
	 * 根据用户查询用户资源目录权限
	 */
	public List<Rescatalog> queryByUser(@Param("username") String username);


	/**
	 * 根据用户查询用户资源目录是否有权限
	 */
	public int queryCountByUsername(@Param("username") String username,@Param("resId") String resId);

    void subLayerIdAdditive(int addid);

	void subLayerIdDecrement(int delid);
}
