package com.skr.mdm.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.skr.mdm.bean.vo.aumanage.AuDepartmentVO;
import com.skr.mdm.bean.vo.department.DepartmentHierarchyVO;
import com.skr.mdm.entity.AuDepartmentDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public interface AuDepartmentDao extends BaseMapper<AuDepartmentDO> {

	/**
	 * 根据公司ID删除
	 * @param companyId 公司ID
	 */
	void deleteByCompanyId(@Param("companyId") Integer companyId);

	List<AuDepartmentVO> selectDepartmentListByIds(@Param("list") ArrayList<String> departmentList);


	DepartmentHierarchyVO selectParentId(@Param("departmentId") Integer departmentId);

	/**
	 * 获取部门下最大的排序权重
	 * @param parentId
	 * @return
	 */
	Integer getMaxWeight(Integer parentId);
}