Commit 47e4d978 authored by 黄奎's avatar 黄奎

页面修改

parent 206ed886
......@@ -57,5 +57,10 @@ namespace Edu.Model.ViewModel.User
/// 部门查询
/// </summary>
public string QDeptIds { get; set; }
/// <summary>
/// 部门编号
/// </summary>
public int Dept_Id { get; set; }
}
}
......@@ -173,7 +173,7 @@ namespace Edu.Module.User
}
if (isQueryPost)
{
postList= postRepository.GetPostListRepository(new RB_Post_ViewModel()
postList= postRepository.GetPostListExtRepository(new RB_Post_ViewModel()
{
Group_Id = query.Group_Id,
});
......@@ -229,22 +229,22 @@ namespace Edu.Module.User
#region 添加岗位
if (isQueryPost)
{
//var tempPostList = postList?.Where(qitem => qitem.RB_Dept_Id == fItem.DeptId)?.ToList();
//if (tempPostList != null && tempPostList.Count > 0)
//{
// foreach (var pItem in tempPostList)
// {
// tModel.ChildList.Add(new DepartmentTree_ViewModel()
// {
// DeptId = pItem.PostId,
// DeptName = pItem.PostName,
// ParentId = 0,
// ChildList = new List<DepartmentTree_ViewModel>(),
// School_Id = fItem.School_Id,
// DataType = 3,
// });
// }
//}
var tempPostList = postList?.Where(qitem => qitem.Dept_Id == fItem.DeptId)?.ToList();
if (tempPostList != null && tempPostList.Count > 0)
{
foreach (var pItem in tempPostList)
{
tModel.ChildList.Add(new DepartmentTree_ViewModel()
{
DeptId = pItem.PostId,
DeptName = pItem.PostName,
ParentId = 0,
ChildList = new List<DepartmentTree_ViewModel>(),
School_Id = fItem.School_Id,
DataType = 3,
});
}
}
}
#endregion
......@@ -308,22 +308,22 @@ namespace Edu.Module.User
#region 添加岗位
if (postList != null && postList.Count > 0)
{
//var tempPostList = postList?.Where(qitem => qitem.RB_Dept_Id == item.DeptId)?.ToList();
//if (tempPostList != null && tempPostList.Count > 0)
//{
// foreach (var pItem in tempPostList)
// {
// model.ChildList.Add(new DepartmentTree_ViewModel()
// {
// DeptId = pItem.PostId,
// DeptName = pItem.PostName,
// ParentId = 0,
// ChildList = new List<DepartmentTree_ViewModel>(),
// School_Id = item.School_Id,
// DataType = 3,
// });
// }
//}
var tempPostList = postList?.Where(qitem => qitem.Dept_Id == item.DeptId)?.ToList();
if (tempPostList != null && tempPostList.Count > 0)
{
foreach (var pItem in tempPostList)
{
model.ChildList.Add(new DepartmentTree_ViewModel()
{
DeptId = pItem.PostId,
DeptName = pItem.PostName,
ParentId = 0,
ChildList = new List<DepartmentTree_ViewModel>(),
School_Id = item.School_Id,
DataType = 3,
});
}
}
}
#endregion
......
......@@ -100,6 +100,48 @@ WHERE 1=1
}
}
/// <summary>
/// 获取部门岗位管理列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Post_ViewModel> GetPostListExtRepository(RB_Post_ViewModel query)
{
DynamicParameters parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*,B.Dept_Id
FROM rb_post AS A INNER JOIN rb_department_post AS B ON A.PostId=B.PostId
WHERE 1=1
");
builder.Append($" AND A.{nameof(RB_Post_ViewModel.Status)}={(int)DateStateEnum.Normal} ");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.Group_Id)}={query.Group_Id} ");
}
if (query.PostId > 0)
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.PostId)}={query.PostId} ");
}
if (!string.IsNullOrEmpty(query.QPostIds))
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.PostId)} IN({query.QPostIds}) ");
}
if (!string.IsNullOrEmpty(query.PostName))
{
builder.Append($" AND A.{nameof(RB_Post_ViewModel.PostName)} LIKE @PostName ");
parameters.Add("PostName", "%" + query.PostName.Trim() + "%");
}
return Get<RB_Post_ViewModel>(builder.ToString(), parameters).ToList();
}
else
{
return new List<RB_Post_ViewModel>();
}
}
/// <summary>
/// 根据部门编号获取岗位列表
/// </summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment