Commit 982ccbfa authored by 黄奎's avatar 黄奎

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 9fee22c0 5e75b49c
...@@ -45,6 +45,11 @@ namespace Edu.Model.ViewModel.User ...@@ -45,6 +45,11 @@ namespace Edu.Model.ViewModel.User
/// </summary> /// </summary>
public string QDeptIds { get; set; } public string QDeptIds { get; set; }
/// <summary>
/// 上级ids
/// </summary>
public string QParentIds { get; set; }
/// <summary> /// <summary>
/// 上级部门名称 /// 上级部门名称
/// </summary> /// </summary>
......
This diff is collapsed.
...@@ -110,6 +110,10 @@ WHERE 1=1 ...@@ -110,6 +110,10 @@ WHERE 1=1
{ {
builder.Append($" AND A.{nameof(RB_Department_ViewModel.ParentId)}={query.ParentId} "); builder.Append($" AND A.{nameof(RB_Department_ViewModel.ParentId)}={query.ParentId} ");
} }
if (!string.IsNullOrEmpty(query.QParentIds))
{
builder.Append($" AND A.{nameof(RB_Department_ViewModel.ParentId)} in({query.QParentIds}) ");
}
if (query.DeptId > 0) if (query.DeptId > 0)
{ {
builder.Append($" AND A.{nameof(RB_Department_ViewModel.DeptId)}={query.DeptId} "); builder.Append($" AND A.{nameof(RB_Department_ViewModel.DeptId)}={query.DeptId} ");
...@@ -127,6 +131,29 @@ WHERE 1=1 ...@@ -127,6 +131,29 @@ WHERE 1=1
{ {
builder.Append($" AND A.{nameof(RB_Department_ViewModel.DeptId)} IN({query.QDeptIds}) "); builder.Append($" AND A.{nameof(RB_Department_ViewModel.DeptId)} IN({query.QDeptIds}) ");
} }
if (!string.IsNullOrEmpty(query.ManagerIds))
{
var ManagerList = query.ManagerIds.Split(',');
builder.Append($" AND ");
for (var i = 1; i <= ManagerList.Count(); i++)
{
if (i == ManagerList.Count() && i == 1)
{
builder.Append($" FIND_IN_SET('{ManagerList[i - 1]}', A.{nameof(RB_Department_ViewModel.ManagerIds)})");
}
else if (i == 1)
{
builder.Append($" (FIND_IN_SET('{ManagerList[i - 1]}', A.{nameof(RB_Department_ViewModel.ManagerIds)}) OR ");
}
else if (i == ManagerList.Count())
{
builder.Append($" FIND_IN_SET('{ManagerList[i - 1]}', A.{nameof(RB_Department_ViewModel.ManagerIds)}))");
}
else {
builder.Append($" FIND_IN_SET('{ManagerList[i - 1]}', A.{nameof(RB_Department_ViewModel.ManagerIds)}) OR ");
}
}
}
return Get<RB_Department_ViewModel>(builder.ToString(), parameters).ToList(); return Get<RB_Department_ViewModel>(builder.ToString(), parameters).ToList();
} }
else else
......
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