package com.judong.chuanyiserver.dao;

import com.judong.chuanyiserver.entity.Department;
import com.judong.chuanyiserver.entity.TreeDepartment;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DepartmentDao {

    DepartmentDao getDepartmentByName(String departmentName);

    Integer addDepartment(Department department);

    Department getDepartmentByNoIdName(int id, String departmentName);

    Integer updateDepartment(Department department);

    Long getDepartmentCount();

    List<Department> getDepartmentListByPage(Long startNum, Long limitNum);

    Department getDepartmentById(Integer id);

    /**
     * 根据父亲id查自己的一级子部门
     */
    List<Department> queryDepartmentListByparentId(Integer parentId);

    /**
     * 根据id查自己是哪些部门的父亲
     */
    List<Department> queryDepartmentListByid(Integer id);

    /**
     * 逻辑删除(批量)
     */
    Integer isDeleteByid(@Param("ids") List<Integer> ids);


}
