正在显示
1 个修改的文件
包含
3 行增加
和
12 行删除
@@ -333,18 +333,9 @@ func (d *StaffAssessDao) CountUserAssess(param SearchConditin1) (int, error) { | @@ -333,18 +333,9 @@ func (d *StaffAssessDao) CountUserAssess(param SearchConditin1) (int, error) { | ||
333 | func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, beginDay string, hrbp int, limit int, offset int, assessType string) string { | 333 | func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, beginDay string, hrbp int, limit int, offset int, assessType string) string { |
334 | sqlstr := ` | 334 | sqlstr := ` |
335 | set time zone 'PRC'; | 335 | set time zone 'PRC'; |
336 | - with t_user_department as ( | ||
337 | - select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user" | ||
338 | - where "user".company_id= %d and "user".deleted_at isnull | ||
339 | - ), | ||
340 | - t_department as ( | ||
341 | - select department.id::text as depart_id from department where charge_user_ids @>'[%d]' | ||
342 | - and "department".deleted_at isnull | ||
343 | - ), | ||
344 | -- 部门主管 | 336 | -- 部门主管 |
345 | - t_user_1 as ( | ||
346 | - select t_user_department.user_id::text from t_user_department | ||
347 | - join t_department on t_user_department.depart_id = t_department.depart_id | 337 | + with t_user_1 as ( |
338 | + select "user".id::text as user_id from "user" where "user".parent_id =%d | ||
348 | ), | 339 | ), |
349 | -- 如果是hrbp | 340 | -- 如果是hrbp |
350 | t_project_1 as( | 341 | t_project_1 as( |
@@ -413,7 +404,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | @@ -413,7 +404,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, | ||
413 | "assessType": ` and staff_assess."types" ='%s' `, | 404 | "assessType": ` and staff_assess."types" ='%s' `, |
414 | } | 405 | } |
415 | params := []interface{}{ | 406 | params := []interface{}{ |
416 | - companyId, userId, cycleId, hrbp, cycleId, userId, cycleId, | 407 | + userId, cycleId, hrbp, cycleId, userId, cycleId, |
417 | } | 408 | } |
418 | extWhere := "" | 409 | extWhere := "" |
419 | if len(beginDay) > 0 { | 410 | if len(beginDay) > 0 { |
-
请 注册 或 登录 后发表评论