切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
347774eb136aa1b1bc57e47419a67c66a2b04884
1 个父辈
03ae6475
优化
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
20 行增加
和
7 行删除
pkg/infrastructure/dao/task_dao.go
pkg/infrastructure/dao/task_dao.go
查看文件 @
347774e
...
...
@@ -597,18 +597,31 @@ type TaskData4 struct {
// TaskStageAnomalyAll 获取所有异常的里程碑任务,
func
(
d
TaskDao
)
TaskStageAnomalyAll
()
([]
TaskData4
,
error
)
{
sqlStr
:=
`select distinct
// sqlStr := `select distinct
// task.id as task_id,
// task."name" as task_name ,
// task.alias as task_alias,
// task.leader ->>'id' as leader_id,
// task.leader ->>'name' as leader_name
// from task
// join task_stage on task.id=task_stage.task_id
// where 1=1
// and task_stage.real_completed_at=0
// and task_stage.plan_completed_at<extract(epoch from now())
// `
sqlStr
:=
`select
task.id as task_id,
task."name" as task_name ,
task.alias as task_alias,
task.leader ->>'id' as leader_id,
task.leader ->>'name' as leader_name
from task
join task_stage on task.id=task_stage.task_id
where 1=1
and task_stage.real_completed_at=0
and task_stage.plan_completed_at<extract(epoch from now())
`
from task where 1=1
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()))
) `
result
:=
[]
TaskData4
{}
tx
:=
d
.
transactionContext
.
PgTx
_
,
err
:=
tx
.
Query
(
&
result
,
sqlStr
)
...
...
请
注册
或
登录
后发表评论