...
|
...
|
@@ -322,7 +322,7 @@ func (d *TaskDao) CountTaskStageAnomalyNotHrbp(param ListTaskCondition) (int, er |
|
|
and task.company_id =?
|
|
|
and task.deleted_at isnull
|
|
|
and (
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int)<floor(extract(epoch from now()))
|
|
|
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
|
|
|
or
|
|
|
task.warn_flag = 1
|
|
|
)
|
...
|
...
|
@@ -357,7 +357,7 @@ func (d *TaskDao) CountTaskStageAnomalyByHrbp(param ListTaskCondition) (int, err |
|
|
and task.deleted_at isnull
|
|
|
and t_task_ignore.id isnull
|
|
|
and (
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int)<floor(extract(epoch from now()))
|
|
|
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int)<floor(extract(epoch from now()))
|
|
|
or
|
|
|
task.warn_flag = 1
|
|
|
)`
|
...
|
...
|
@@ -419,7 +419,7 @@ and task.deleted_at isnull |
|
|
and (
|
|
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
|
|
or
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
)
|
|
|
and task.leader ->>'id' in(?) `
|
|
|
|
...
|
...
|
@@ -442,7 +442,7 @@ and task.deleted_at isnull |
|
|
and (
|
|
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
|
|
or
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
)
|
|
|
and task.related_user @>? `
|
|
|
|
...
|
...
|
@@ -510,7 +510,7 @@ func (d *TaskDao) CountTaskAnomalyByHrbp(param ListTaskCondition) (int, error) { |
|
|
)select count(*)
|
|
|
from task
|
|
|
left join t_task_ignore on t_task_ignore.task_id=task.id
|
|
|
where 1=1 and task.anomaly>1 and task.company_id=?`
|
|
|
where 1=1 and task.anomaly>1 and task.company_id=? and task.deleted_at isnull`
|
|
|
condition := []interface{}{param.UserId, param.CompanyId}
|
|
|
whereSql := ``
|
|
|
if param.OnlyMy {
|
...
|
...
|
@@ -615,7 +615,7 @@ and task.deleted_at isnull |
|
|
and (
|
|
|
task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'
|
|
|
or
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
|
|
|
) `
|
|
|
result := []TaskData4{}
|
|
|
tx := d.transactionContext.PgTx
|
...
|
...
|
@@ -679,9 +679,9 @@ func (d *TaskDao) ListTaskByHrbpV2(param ListTaskCondition) ([]ListTask, error) |
|
|
),
|
|
|
t_task as (
|
|
|
select
|
|
|
cast(COALESCE(task.current_stage ->>'plan_completed_at','0') as int) as c_plan_completed_at,
|
|
|
cast(COALESCE(task.last_stage ->>'plan_completed_at','0') as int) as l_plan_completed_at,
|
|
|
cast(COALESCE(task.last_stage ->>'real_completed_at','0') as int) as l_real_completed_at,
|
|
|
cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) as c_plan_completed_at,
|
|
|
cast(COALESCE(task.last_stage ->>'planCompletedAt','0') as int) as l_plan_completed_at,
|
|
|
cast(COALESCE(task.last_stage ->>'realCompletedAt','0') as int) as l_real_completed_at,
|
|
|
floor(extract(epoch from now())) as now_time,
|
|
|
task.id ,
|
|
|
task.alias ,
|
...
|
...
|
|