|
@@ -145,7 +145,9 @@ func (d *StaffAssessDao) AllAssessCycleList(companyId int) ([]AssessCycle, error |
|
@@ -145,7 +145,9 @@ func (d *StaffAssessDao) AllAssessCycleList(companyId int) ([]AssessCycle, error |
145
|
staff_assess_task.company_id ,
|
145
|
staff_assess_task.company_id ,
|
146
|
staff_assess_task.cycle_name
|
146
|
staff_assess_task.cycle_name
|
147
|
from staff_assess_task
|
147
|
from staff_assess_task
|
148
|
- where staff_assess_task.company_id = ?`
|
148
|
+ where staff_assess_task.company_id = ?
|
|
|
149
|
+ and staff_assess_task.deleted_at isnull
|
|
|
150
|
+ `
|
149
|
|
151
|
|
150
|
tx := d.transactionContext.PgTx
|
152
|
tx := d.transactionContext.PgTx
|
151
|
condition := []interface{}{
|
153
|
condition := []interface{}{
|
|
@@ -172,7 +174,8 @@ func (d *StaffAssessDao) AllAssessCycleDayList(companyId int, cycleId int) ([]As |
|
@@ -172,7 +174,8 @@ func (d *StaffAssessDao) AllAssessCycleDayList(companyId int, cycleId int) ([]As |
172
|
staff_assess_task.company_id
|
174
|
staff_assess_task.company_id
|
173
|
from staff_assess_task
|
175
|
from staff_assess_task
|
174
|
where staff_assess_task.cycle_id = ?
|
176
|
where staff_assess_task.cycle_id = ?
|
175
|
- and company_id =? `
|
177
|
+ and company_id =?
|
|
|
178
|
+ and staff_assess_task.deleted_at isnull `
|
176
|
|
179
|
|
177
|
tx := d.transactionContext.PgTx
|
180
|
tx := d.transactionContext.PgTx
|
178
|
condition := []interface{}{
|
181
|
condition := []interface{}{
|
|
@@ -292,10 +295,11 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
|
@@ -292,10 +295,11 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
292
|
set time zone 'PRC';
|
295
|
set time zone 'PRC';
|
293
|
with t_user_department as (
|
296
|
with t_user_department as (
|
294
|
select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user"
|
297
|
select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user"
|
295
|
- where "user".company_id= %d
|
298
|
+ where "user".company_id= %d and "user".deleted_at isnull
|
296
|
),
|
299
|
),
|
297
|
t_department as (
|
300
|
t_department as (
|
298
|
- select department.id::text as depart_id from department where charge_user_ids @>'[%d]'
|
301
|
+ select department.id::text as depart_id from department where charge_user_ids @>'[%d]'
|
|
|
302
|
+ and "department".deleted_at isnull
|
299
|
),
|
303
|
),
|
300
|
-- 部门主管
|
304
|
-- 部门主管
|
301
|
t_user_1 as (
|
305
|
t_user_1 as (
|
|
@@ -308,6 +312,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
|
@@ -308,6 +312,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
308
|
from evaluation_project
|
312
|
from evaluation_project
|
309
|
where evaluation_project.cycle_id =%d
|
313
|
where evaluation_project.cycle_id =%d
|
310
|
and evaluation_project.hr_bp = %d
|
314
|
and evaluation_project.hr_bp = %d
|
|
|
315
|
+ and evaluation_project.deleted_at isnull
|
311
|
),
|
316
|
),
|
312
|
-- 如果的项目管理员
|
317
|
-- 如果的项目管理员
|
313
|
t_project_2 as(
|
318
|
t_project_2 as(
|
|
@@ -316,6 +321,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
|
@@ -316,6 +321,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
316
|
where evaluation_project.cycle_id =%d
|
321
|
where evaluation_project.cycle_id =%d
|
317
|
and evaluation_project.pmp =1
|
322
|
and evaluation_project.pmp =1
|
318
|
and evaluation_project.pmp_ids @>'["%d"]'
|
323
|
and evaluation_project.pmp_ids @>'["%d"]'
|
|
|
324
|
+ and evaluation_project.deleted_at isnull
|
319
|
),
|
325
|
),
|
320
|
-- 合并数据
|
326
|
-- 合并数据
|
321
|
t_project_3 as (
|
327
|
t_project_3 as (
|
|
@@ -331,6 +337,8 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
|
@@ -331,6 +337,8 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, |
331
|
to_char(staff_assess.begin_time,'YYYY-MM-DD') as begin_day,
|
337
|
to_char(staff_assess.begin_time,'YYYY-MM-DD') as begin_day,
|
332
|
staff_assess.evaluation_project_id
|
338
|
staff_assess.evaluation_project_id
|
333
|
from staff_assess
|
339
|
from staff_assess
|
|
|
340
|
+ join staff_assess_task on staff_assess.staff_assess_task_id = staff_assess_task.id
|
|
|
341
|
+ and staff_assess_task.deleted_at isnull
|
334
|
where staff_assess.cycle_id = %d
|
342
|
where staff_assess.cycle_id = %d
|
335
|
and to_char(staff_assess.begin_time,'YYYY-MM-DD')='%s'
|
343
|
and to_char(staff_assess.begin_time,'YYYY-MM-DD')='%s'
|
336
|
and staff_assess."types" ='self'
|
344
|
and staff_assess."types" ='self'
|