作者 tangxvhui

更新sql 调整

@@ -228,8 +228,6 @@ func (d *TaskDao) TaskStageAnomalyByLeader(leaderId []string) ([]TaskData3, erro @@ -228,8 +228,6 @@ func (d *TaskDao) TaskStageAnomalyByLeader(leaderId []string) ([]TaskData3, erro
228 from task where 1=1 228 from task where 1=1
229 and task.deleted_at isnull 229 and task.deleted_at isnull
230 and ( 230 and (
231 - task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'  
232 - or  
233 cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now())) 231 cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
234 ) 232 )
235 and task.leader ->>'id' in(?) ` 233 and task.leader ->>'id' in(?) `
@@ -251,8 +249,6 @@ func (d *TaskDao) TaskStageAnomalyByRelatedUser(relatedUserId int) ([]TaskData3, @@ -251,8 +249,6 @@ func (d *TaskDao) TaskStageAnomalyByRelatedUser(relatedUserId int) ([]TaskData3,
251 from task where 1=1 249 from task where 1=1
252 and task.deleted_at isnull 250 and task.deleted_at isnull
253 and ( 251 and (
254 - task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'  
255 - or  
256 cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now())) 252 cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
257 ) 253 )
258 and task.related_user @>? ` 254 and task.related_user @>? `
@@ -405,8 +401,6 @@ func (d TaskDao) TaskStageAnomalyAll() ([]TaskData4, error) { @@ -405,8 +401,6 @@ func (d TaskDao) TaskStageAnomalyAll() ([]TaskData4, error) {
405 from task where 1=1 401 from task where 1=1
406 and task.deleted_at isnull 402 and task.deleted_at isnull
407 and ( 403 and (
408 - task.last_stage ->>'planCompletedAt'< task.last_stage ->>'realCompletedAt'  
409 - or  
410 cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now())) 404 cast(COALESCE(task.current_stage ->>'planCompletedAt','0') as int) between 1 and floor(extract(epoch from now()))
411 ) ` 405 ) `
412 result := []TaskData4{} 406 result := []TaskData4{}