Commit c12a315b authored by 吴春's avatar 吴春

提交代码

parent e43fea97
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.OKR
{
public class OKRPersonalDimension
{
/// <summary>
/// 员工id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 员工名称
/// </summary>
public string EmployeeName { get; set; }
/// <summary>
/// 员工头像
/// </summary>
public string UserIcon { get; set; }
/// <summary>
/// 员工部门
/// </summary>
public int Dept_Id { get; set; }
/// <summary>
/// 填写量
/// </summary>
public int ObjectiveNCount { get; set; }
/// <summary>
/// 对齐量
/// </summary>
public int OBjectiveRelation { get; set; }
/// <summary>
/// 打分量
/// </summary>
public decimal ScoreCount { get; set; }
/// <summary>
/// 类型 1-我的上级,2-我的下级,3-我的同级,4-我的关注
/// </summary>
public int Type { get; set; }
}
}
This diff is collapsed.
......@@ -219,7 +219,8 @@ where {where} order by o.Sort asc";
{
sql += $@" AND Sort > {startSort} ";
}
if (endSort > 0) {
if (endSort > 0)
{
sql += $@" and Sort < {endSort} ";
}
return Execute(sql) > 0;
......@@ -272,5 +273,43 @@ LEFT JOIN RB_OKR_Objective o2 on re.ParentId = o2.Id
WHERE o1.Group_Id={group_Id} and o1.`Status` <>5 and o2.`Status` <>5 and o1.PeriodId ={periodId} and o1.CreateBy in ({id}) GROUP BY o2.CreateBy";
return Get<RB_OKR_Objective_ViewModel>(sql).ToList();
}
/// <summary>
/// 获取个人维度打分以及目标量
/// </summary>
/// <param name="group_Id"></param>
/// <param name="periodId"></param>
/// <param name="id"></param>
/// <returns></returns>
public List<RB_OKR_Objective_ViewModel> GetOKRPersonalAlignList(int group_Id, int periodId, string CreateBys)
{
string where = string.Empty;
if (!string.IsNullOrWhiteSpace(CreateBys))
{
where = $" and a.CreateBy in({CreateBys})";
}
string sql = $@"SELECT COUNT(*) as ChildNum,a.CreateBy ,SUM(Score) as Score from rb_okr_objective as a LEFT JOIN rb_okr_objectiverelation as b on a.Id=b.ObjectiveId
WHERE a.Group_Id={group_Id} and a.`Status` <>5 and a.PeriodId ={periodId} {where}
GROUP BY a.CreateBy";
return Get<RB_OKR_Objective_ViewModel>(sql).ToList();
}
/// <summary>
/// 获取个人维度对齐量
/// </summary>
/// <param name="group_Id"></param>
/// <param name="periodId"></param>
/// <param name="id"></param>
/// <returns></returns>
public List<RB_OKR_Objective_ViewModel> GetOKRPersonalRelationAlignList(int group_Id, int periodId, string CreateBys,int id)
{
string sql = $@"SELECT COUNT(0) as ChildNum,o2.CreateBy FROM
rb_okr_objectiverelation or1
LEFT JOIN rb_okr_objective o1 on or1.ObjectiveId = o1.Id
LEFT JOIN rb_okr_objective o2 on or1.ParentId = o2.Id
WHERE o1.CreateBy in({CreateBys}) and o2.CreateBy ={id} and o1.`Status`=2 and o1.Group_Id={group_Id} and o1.PeriodId ={periodId} and o2.Group_Id={group_Id} and o2.PeriodId ={periodId} and o2.`Status`=2 group by o1.CreateBy ";
return Get<RB_OKR_Objective_ViewModel>(sql).ToList();
}
}
}
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