SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,
CASE WHEN t.CreateBy IS NOT NULL THEN 1 ELSE 2 END AS Status FROM
rb_employee e
LEFT JOIN (SELECT o.CreateBy FROM rb_okr_objective o WHERE o.Group_Id ={groupId} and o.Status <>5 and o.PeriodId={periodId} and o.CreateBy in({userIds}) GROUP BY o.CreateBy) t ON e.EmployeeId = t.CreateBy
WHERE e.RB_Group_id={groupId} and e.EmployeeId in({userIds})
)tt order by tt.Status {(orderBy==1?"asc":"desc")}
SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,
CASE WHEN t.UserId IS NOT NULL THEN 1 ELSE 2 END AS Status FROM
rb_employee e
LEFT JOIN (
SELECT UserId FROM rb_okr_updateprogress WHERE Group_Id={groupId} and PeriodId={periodId} and UpdateTime >= '{date}' and UserId in ({userIds}) GROUP BY UserId
) t ON e.EmployeeId = t.UserId
WHERE e.RB_Group_id={groupId} and e.EmployeeId in({userIds})
)tt order by tt.Status {(orderBy==1?"asc":"desc")}
SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,
CASE WHEN t.CreateBy IS NOT NULL THEN 1 ELSE 2 END AS Status FROM
rb_employee e
LEFT JOIN (SELECT o.CreateBy FROM rb_okr_objective o WHERE o.Group_Id ={groupId} and o.Status <>5 and o.PeriodId={periodId} and o.Score >0 and o.CreateBy in({userIds}) GROUP BY o.CreateBy) t ON e.EmployeeId = t.CreateBy
WHERE e.RB_Group_id={groupId} and e.EmployeeId in({userIds})
)tt order by tt.Status {(orderBy==1?"asc":"desc")}
SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,e.RB_Department_Id,
CASE WHEN t.CreateBy IS NOT NULL THEN 1 ELSE 2 END AS Status FROM
rb_employee e
LEFT JOIN (SELECT o.CreateBy FROM rb_okr_objective o WHERE o.Group_Id ={groupId} and o.Status <>5 and o.PeriodId={periodId} GROUP BY o.CreateBy) t ON e.EmployeeId = t.CreateBy
WHERE e.RB_Group_id={groupId} and e.RB_Department_Id in({deptIds})
SELECT e.EmployeeId as CreateBy,e.EmName,e.EmPhoto,e.DeptName,e.PostName,e.RB_Department_Id,
CASE WHEN t.CreateBy IS NOT NULL THEN 1 ELSE 2 END AS Status FROM
rb_employee e
LEFT JOIN (SELECT o.CreateBy FROM rb_okr_objective o WHERE o.Group_Id ={groupId} and o.Status <>5 and o.PeriodId={periodId} and o.Score >0 GROUP BY o.CreateBy) t ON e.EmployeeId = t.CreateBy
WHERE e.RB_Group_id={groupId} and e.RB_Department_Id in({deptIds})