作者 tangxvhui

调整sql 查询每日任务异常消息弹窗需要的数据

@@ -795,8 +795,17 @@ select @@ -795,8 +795,17 @@ select
795 from task where 1=1 795 from task where 1=1
796 and task.deleted_at isnull 796 and task.deleted_at isnull
797 and task.company_id=? 797 and task.company_id=?
798 -and (task.assist_flag+task.warn_flag +task.anomaly)>0  
799 and (task.leader ->>'id' in(?) or task.related_user @>?) 798 and (task.leader ->>'id' in(?) or task.related_user @>?)
  799 +and (
  800 + (task.warn_flag +task.anomaly)>0
  801 + or
  802 + task.assist_flag>task.assist_flag_max
  803 + )
  804 +and not (
  805 + task.current_stage ->>'id'='0'
  806 + and
  807 + task.last_stage ->>'id'<>'0'
  808 + )
800 ` 809 `
801 810
802 relatedUser := fmt.Sprintf("[%d]", relatedUserId) 811 relatedUser := fmt.Sprintf("[%d]", relatedUserId)