package org.jeecg.modules.system.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.jeecg.modules.system.entity.SysArea;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysTenant;

import java.util.List;

/**
 * @Description: sys_area
 * @Author: jeecg-boot
 * @Date: 2022-01-05
 * @Version: V1.0
 */
public interface ISysAreaService extends IService<SysArea> {

	/**根节点父ID的值*/
	public static final String ROOT_PID_VALUE = "0";

	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";

	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";

	/**新增节点*/
	void addSysArea(SysArea sysArea);

	/**修改节点*/
	void updateSysArea(SysArea sysArea) throws JeecgBootException;

	/**删除节点*/
	void deleteSysArea(String id) throws JeecgBootException;

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

	/**查询所有父元素id*/
    String[] findParentIdPath(String Id);

	IPage<SysArea> queryPage(Integer pageNo, Integer pageSize, String name, String code, Integer isSpecial, String status);

	List<SysArea> listWithTree();

	List<SysArea> listWithTreeByNameAndCode();

	List<SysArea> listWithTreeById();

	String[] findParentIdPathName(String id);

	List<SysArea> getChildArea(String id);

	List<String> listAreaId(String id);

	List<String> getChildId(String id);

	List<SysArea> getAllChild();

	List<SysArea> getDepartAllChild();

	void changeRelatedStatus(String id, String status);

	void changeRelatedArea(SysArea sysArea, SysArea sysAreaEntity);

	List<String> quickGetChild(String id);
}