select o.CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,count(0) as ObjectiveNum
from RB_OKR_Objective o
LEFT JOIN rb_employee e on e.EmployeeId = o.CreateBy
where o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2 and o.ProgressState ={startValue} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds)?"and o.CreateBy in ("+userIds+")":"")} group by o.CreateBy
)t order by t.ObjectiveNum {(orderBy==1?" asc":" desc")}
select o.CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,count(0) as ObjectiveNum
from RB_OKR_Objective o
LEFT JOIN rb_employee e on e.EmployeeId = o.CreateBy
where o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2 and o.Progress >={startValue}{(endValue>=0?"and o.Progress <="+endValue:"")} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds)?"and o.CreateBy in ("+userIds+")":"")} group by o.CreateBy
)t order by t.ObjectiveNum {(orderBy==1?" asc":" desc")}
select o.CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,count(0) as ObjectiveNum
from RB_OKR_Objective o
LEFT JOIN rb_employee e on e.EmployeeId = o.CreateBy
where o.Group_Id ={group_Id} and o.PeriodId ={periodId} AND o.Status =2 and o.Score >={startValue}{(endValue>=0?"and o.Score <="+endValue:"")} and e.IsLeave =0 {(!string.IsNullOrEmpty(userIds)?"and o.CreateBy in ("+userIds+")":"")} group by o.CreateBy
)t order by t.ObjectiveNum {(orderBy==1?" asc":" desc")}