|
@@ -322,7 +322,7 @@ func (d *TaskDao) CountTaskStageAnomalyNotHrbp(param ListTaskCondition) (int, er |
|
@@ -322,7 +322,7 @@ func (d *TaskDao) CountTaskStageAnomalyNotHrbp(param ListTaskCondition) (int, er |
322
|
and task.company_id =?
|
322
|
and task.company_id =?
|
323
|
and task.deleted_at isnull
|
323
|
and task.deleted_at isnull
|
324
|
and (
|
324
|
and (
|
325
|
- cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int)<floor(extract(epoch from now()))
|
325
|
+ cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
|
326
|
or
|
326
|
or
|
327
|
task.warn_flag = 1
|
327
|
task.warn_flag = 1
|
328
|
)
|
328
|
)
|
|
@@ -357,7 +357,7 @@ func (d *TaskDao) CountTaskStageAnomalyByHrbp(param ListTaskCondition) (int, err |
|
@@ -357,7 +357,7 @@ func (d *TaskDao) CountTaskStageAnomalyByHrbp(param ListTaskCondition) (int, err |
357
|
and task.deleted_at isnull
|
357
|
and task.deleted_at isnull
|
358
|
and t_task_ignore.id isnull
|
358
|
and t_task_ignore.id isnull
|
359
|
and (
|
359
|
and (
|
360
|
- cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int)<floor(extract(epoch from now()))
|
360
|
+ cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
|
361
|
or
|
361
|
or
|
362
|
task.warn_flag = 1
|
362
|
task.warn_flag = 1
|
363
|
)`
|
363
|
)`
|
|
@@ -419,7 +419,7 @@ and task.deleted_at isnull |
|
@@ -419,7 +419,7 @@ and task.deleted_at isnull |
419
|
and (
|
419
|
and (
|
420
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
420
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
421
|
or
|
421
|
or
|
422
|
- cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
422
|
+ cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
|
423
|
)
|
423
|
)
|
424
|
and task.leader ->>'id' in(?) `
|
424
|
and task.leader ->>'id' in(?) `
|
425
|
|
425
|
|
|
@@ -442,7 +442,7 @@ and task.deleted_at isnull |
|
@@ -442,7 +442,7 @@ and task.deleted_at isnull |
442
|
and (
|
442
|
and (
|
443
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
443
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
444
|
or
|
444
|
or
|
445
|
- cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
445
|
+ cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
|
446
|
)
|
446
|
)
|
447
|
and task.related_user @>? `
|
447
|
and task.related_user @>? `
|
448
|
|
448
|
|
|
@@ -510,7 +510,7 @@ func (d *TaskDao) CountTaskAnomalyByHrbp(param ListTaskCondition) (int, error) { |
|
@@ -510,7 +510,7 @@ func (d *TaskDao) CountTaskAnomalyByHrbp(param ListTaskCondition) (int, error) { |
510
|
)select count(*)
|
510
|
)select count(*)
|
511
|
from task
|
511
|
from task
|
512
|
left join t_task_ignore on t_task_ignore.task_id=task.id
|
512
|
left join t_task_ignore on t_task_ignore.task_id=task.id
|
513
|
- where 1=1 and task.anomaly>1 and task.company_id=?`
|
513
|
+ where 1=1 and task.anomaly>1 and task.company_id=? and task.deleted_at isnull`
|
514
|
condition := []interface{}{param.UserId, param.CompanyId}
|
514
|
condition := []interface{}{param.UserId, param.CompanyId}
|
515
|
whereSql := ``
|
515
|
whereSql := ``
|
516
|
if param.OnlyMy {
|
516
|
if param.OnlyMy {
|
|
@@ -615,7 +615,7 @@ and task.deleted_at isnull |
|
@@ -615,7 +615,7 @@ and task.deleted_at isnull |
615
|
and (
|
615
|
and (
|
616
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
616
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
617
|
or
|
617
|
or
|
618
|
- cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
618
|
+ cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
|
619
|
) `
|
619
|
) `
|
620
|
result := []TaskData4{}
|
620
|
result := []TaskData4{}
|
621
|
tx := d.transactionContext.PgTx
|
621
|
tx := d.transactionContext.PgTx
|
|
@@ -679,9 +679,9 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error) |
|
@@ -679,9 +679,9 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error) |
679
|
),
|
679
|
),
|
680
|
t_task as (
|
680
|
t_task as (
|
681
|
select
|
681
|
select
|
682
|
- cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) as c_plan_completed_at,
|
|
|
683
|
- cast(COALESCE(task.last_stage ->>'plan_completed_at','0') as int) as l_plan_completed_at,
|
|
|
684
|
- cast(COALESCE(task.last_stage ->>'real_completed_at','0') as int) as l_real_completed_at,
|
682
|
+ cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) as c_plan_completed_at,
|
|
|
683
|
+ cast(COALESCE(task.last_stage ->>'planCompletedAt','0') as int) as l_plan_completed_at,
|
|
|
684
|
+ cast(COALESCE(task.last_stage ->>'realCompletedAt','0') as int) as l_real_completed_at,
|
685
|
floor(extract(epoch from now())) as now_time,
|
685
|
floor(extract(epoch from now())) as now_time,
|
686
|
task.id ,
|
686
|
task.id ,
|
687
|
task.alias ,
|
687
|
task.alias ,
|