package com.zcloud.modules.sys.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.zcloud.common.utils.PageUtils;
import com.zcloud.modules.sys.entity.SysDictionariesEntity;
import org.springframework.transaction.annotation.Transactional;

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


/**
 * 字典管理
 */
public interface SysDictionariesService extends IService<SysDictionariesEntity> {

	PageUtils queryPage(Map<String, Object> params);

	/**
	 * 根据父字典，查询子字典(返回树）
	 * @param parentId 父字典ID
	 */
	List<SysDictionariesEntity> listTreeCte(String parentId);

	/**
	 * 根据父字典，查询子字典（返回所有子字典集合）
	 * @param parentId 父字典ID
	 */
	List<SysDictionariesEntity> listAllCte(String parentId);


	/**
	 * 删除
	 */
	void delete(String dictionaries);

	/**
	 * 根据编码查询
	 * @param id
	 */
	SysDictionariesEntity queryByBianma(String id);

	/**
	 * 根据ID递归查询所有ID
	 * @param bianma 编码
	 */
	String getRecurrenceIds(String bianma);


    //	private List<SysDictionariesEntity> getAlldictionariesList(List<Integer> dictionariesIdList){
//		//查询根菜单列表
//		List<SysDictionariesEntity> dictionariesList = queryListParentId(0, dictionariesIdList);
//		//递归获取子菜单
//		getdictionariesTreeList(dictionariesList, dictionariesIdList);
//
//		return dictionariesList;
//	}

//	/**
//	 * 递归
//	 */
//	private List<SysDictionariesEntity> getdictionariesTreeList(List<SysDictionariesEntity> dictionariesList, List<Integer> dictionariesIdList){
//		List<SysDictionariesEntity> subdictionariesList = new ArrayList<SysDictionariesEntity>();
//
//		for(SysDictionariesEntity entity : dictionariesList){
//			//目录
//			if(entity.getType() == Constant.dictionariesType.CATALOG.getValue()){
//				entity.setList(getdictionariesTreeList(queryListParentId(entity.getdictionariesId(), dictionariesIdList), dictionariesIdList));
//			}
//			subdictionariesList.add(entity);
//		}
//
//		return subdictionariesList;
//	}

    void importAreaFromJson();
}
