123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- using System.Collections.Generic;
- using System.Threading.Tasks;
- using GxPress.Entity;
- using GxPress.Request.Department;
- using GxPress.Result.Department;
- using Datory;
- namespace GxPress.Repository.Interface
- {
- public interface IDepartmentRepository : IRepository
- {
- Task<bool> ExistsChildrenAsync(int parentId);
- Task<Department> GetAsync(int id);
- Task<Department> GetAsync(string name);
- Task<string> GetNameAsync(int id);
- Task<int> InsertAsync(Department department);
- Task<bool> UpdateAsync(Department department);
- Task<IEnumerable<DepartmentResult>> GetListAsync(int parentId);
- /// <summary>
- /// 添加
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- Task<Department> AddAsync(Department request);
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- Task<bool> DeleteAsync(int id);
- /// <summary>
- /// 删除
- /// </summary>
- /// <param name="query"></param>
- /// <returns></returns>
- Task<bool> DeleteAsync(SqlKata.Query query);
- /// <summary>
- /// 更新
- /// </summary>
- /// <param name="id"></param>
- /// <param name="request"></param>
- /// <returns></returns>
- Task<bool> UpdateAsync(int id, Department request);
- /// <summary>
- /// 获取树列表
- /// </summary>
- /// <param name="id"></param>
- /// <returns></returns>
- Task<List<DepartmentTreeResult>> GetTreeAsync(int id);
- /// <summary>
- /// 根据部门ID获取成员以及下级部门
- /// </summary>
- /// <param name="request"></param>
- /// <returns></returns>
- Task<DepartmentUserResult> GetDepartmentUserResultAsync(DepartmentUserRequest request);
- /// <summary>
- /// 根据PID获取所用部门
- /// </summary>
- /// <param name="id"></param>
- /// <param name="departments"></param>
- /// <returns></returns>
- /// <summary>
- /// 获取所用下级部门
- /// </summary>
- /// <param name="id"></param>
- /// <param name="departments"></param>
- /// <returns></returns>
- Task<List<DepartmentResult>> GetDepartmentById(int id, List<DepartmentResult> departments);
- Task<string> GetDepartmentFullPathAsync(int departmentId, string departmentName);
- /// <summary>
- /// 获取所用下级部门
- /// </summary>
- /// <param name="id"></param>
- /// <param name="departments"></param>
- /// <returns></returns>
- Task<List<Department>> GetDepartmentByPid(int Pid, List<Department> departments);
- Task<IEnumerable<Department>> GetAllAsync(SqlKata.Query query);
- /// <summary>
- /// 获取全部部门
- /// </summary>
- /// <returns></returns>
- Task<List<DepartmentTreeResult>> GetAllDepartmentAsync();
- /// <summary>
- /// 获取所用下级部门
- /// </summary>
- /// <param name="id"></param>
- /// <param name="departments"></param>
- /// <returns></returns>
- Task<List<Department>> GetDepartmentByPid(int Pid, List<Department> departments, List<Department> allDepartments);
- Task<IEnumerable<Entity.Department>> GetUserInDepartmentAsync(List<int> departmentIds);
- /// <summary>
- /// 获取所用上级部门
- /// </summary>
- /// <param name="id"></param>
- /// <param name="departments"></param>
- /// <returns></returns>
- Task<List<Department>> GetParentDepartmentById(int id, List<Department> departments);
- }
- }
|