/*
 *
 *      Copyright (c) 2018-2025, hnqz All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: hnqz
 *
 */

package com.qunzhixinxi.hnqz.admin.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qunzhixinxi.hnqz.admin.api.dto.DeptTree;
import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
import org.apache.ibatis.annotations.Param;

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

/**
 * <p>
 * 部门管理 服务类
 * </p>
 *
 * @author hnqz
 * @since 2018-01-20
 */
public interface SysDeptService extends IService<SysDept> {

	/**
	 * 查询部门树菜单
	 *
	 * @return 树
	 */
	List<DeptTree> selectTree(SysDept sysDept);

	List<DeptTree> selectTreeAddUser(SysDept sysDept);

	/**
	 * 添加信息部门
	 *
	 * @param sysDept
	 * @return
	 */
	Integer saveDept(SysDept sysDept);

	/**
	 * 删除部门
	 *
	 * @param id 部门 ID
	 * @return 成功、失败
	 */
	Boolean removeDeptById(Integer id);


	/**
	 * 更新部门
	 *
	 * @param sysDept 部门信息
	 * @return 成功、失败
	 */
	Boolean updateDeptById(SysDept sysDept);

	List<SysDept> listScope(SysDept sysDept);

	List<SysDept> selectDeptByName(@Param("query") SysDept sysDept);

	SysDept selectDeptId(SysDept sysDept);

	SysDept selectDeptById(SysDept sysDept);

	List<SysDept> getAllParentDept(SysDept sysDept);

	/**
	 * 针对级别获取企业组织码
	 *
	 * @param levelId id
	 * @param level   层级
	 * @return 企业组织码
	 */
	String selectEntCodeByLevelId(long levelId, int level);


	SysDept selectByDeptId(Integer deptId);

	List<SysDept> selectByName(String entname);

	List getParentDept(SysDept sysDept);

	List convertToName();

	List getChildDept(SysDept sysDept);
}
