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

import org.apache.ibatis.annotations.Param;
import org.jeecg.common.system.vo.SelectTreeModel;
import org.jeecg.modules.resManager.catalog.entity.Rescatalog;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.util.List;

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

	/**根节点父ID的值*/
	public static final String ROOT_PID_VALUE = "0";
	
	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";
	
	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";

	/**
	 * 新增节点
	 *
	 * @param rescatalog
	 */
	void addRescatalog(Rescatalog rescatalog);
	
	/**
   * 修改节点
   *
   * @param rescatalog
   * @throws JeecgBootException
   */
	void updateRescatalog(Rescatalog rescatalog) throws JeecgBootException;
	
	/**
	 * 删除节点
	 *
	 * @param id
   * @throws JeecgBootException
	 */
	void deleteRescatalog(String id) throws JeecgBootException;

	  /**
	   * 查询所有数据，无分页
	   *
	   * @param queryWrapper
	   * @return List<Rescatalog>
	   */
    List<Rescatalog> queryTreeListNoPage(QueryWrapper<Rescatalog> queryWrapper);

	/**
	 * 【vue3专用】根据父级编码加载分类字典的数据
	 *
	 * @param parentCode
	 * @return
	 */
	List<SelectTreeModel> queryListByCode(String parentCode);

	/**
	 * 【vue3专用】根据pid查询子节点集合
	 *
	 * @param pid
	 * @return
	 */
	List<SelectTreeModel> queryListByPid(String pid);


	/**
	 * 根据用户查询所有数据，无分页
	 *
	 * @param username
	 * @return List<Rescatalog>
	 */
    List<Rescatalog> queryByUser(String username);


	/**
	 * 查询用户是否具有当前resid对应的权限
	 *
	 * @param username
	 * @return List<Rescatalog>
	 */
	int queryCountByUsername(String username,String resId);

	/**
	 * 新增节点,子图层id递加
	 *
	 * @param addid
	 */
	void subLayerIdAdditive(int addid);
	/**
	 * 删除节点,子图层id递减
	 *
	 * @param delid
	 */
	void subLayerIdDecrement(int delid);
}
