切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
ec13016c075963dec6eb440b006115a828f0da00
2 个父辈
f29e2461
5a3ef89c
Merge branch 'test'
隐藏空白字符变更
内嵌
并排对比
正在显示
15 个修改的文件
包含
266 行增加
和
19 行删除
pkg/application/evaluation_cycle/cycle_service.go
pkg/application/staff_assess/service/service.go
pkg/application/staff_assess/service/service_v2.go
pkg/application/summary_evaluation/service/scheduled.go
pkg/application/summary_evaluation/service/scheduled_v2.go
pkg/domain/staff_assess_task.go
pkg/domain/summary_evaluation.go
pkg/infrastructure/dao/staff_assess_dao.go
pkg/infrastructure/dao/staff_assess_dao_2.go
pkg/infrastructure/dao/summary_evaluation_dao.go
pkg/infrastructure/repository/pg_evaluation_item_used_repository.go
pkg/infrastructure/repository/pg_staff_assess_task_repository.go
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
sql/2023-04-01.sql
sql/2023-04-03.sql
pkg/application/evaluation_cycle/cycle_service.go
查看文件 @
ec13016
package
service
import
(
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/evaluation_cycle/adapter"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/evaluation_cycle/command"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
"strconv"
"time"
)
type
EvaluationCycleService
struct
{
...
...
@@ -356,7 +357,7 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf
projectRepository
:=
factory
.
CreateEvaluationProjectRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
taskRepository
:=
factory
.
CreateNodeTaskRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
staffRepository
:=
factory
.
CreateStaffAssessTaskRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
summaryEvaluationRepository
:=
factory
.
CreateSummaryEvaluationRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
})
// 删除周期
cycle
,
err
:=
cycleRepository
.
FindOne
(
map
[
string
]
interface
{}{
"id"
:
in
.
Id
})
if
err
!=
nil
{
...
...
@@ -380,11 +381,6 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf
if
_
,
err
:=
projectRepository
.
Remove
(
projects
[
i
]);
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
// 删除项目已生成的周期评估数据
if
err
:=
staffRepository
.
RemoveByProjectId
(
int
(
projects
[
i
]
.
Id
));
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
// 删除周期下的所有定时任务
...
...
@@ -398,6 +394,14 @@ func (rs *EvaluationCycleService) Remove(in *command.DeleteCycleCommand) (interf
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
}
// 删除项目已生成的周期评估数据
if
err
:=
staffRepository
.
RemoveByCycleId
(
int
(
cycle
.
Id
));
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
//
if
err
:=
summaryEvaluationRepository
.
RemoveByCycleId
(
cycle
.
Id
);
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
TRANSACTION_ERROR
,
err
.
Error
())
...
...
pkg/application/staff_assess/service/service.go
查看文件 @
ec13016
...
...
@@ -920,7 +920,7 @@ func (srv StaffAssessServeice) GetAssessInfo(param *query.AssessInfoQuery) (*ada
}
}
else
if
assessData
.
Status
==
domain
.
StaffAssessUncompleted
{
//未完成
assessContentList
,
err
=
srv
.
getAssess
SelfInfoUncompleted
(
transactionContext
,
assessData
)
assessContentList
,
err
=
srv
.
getAssess
InfoUncompletedV2
(
transactionContext
,
assessData
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取项目填写内容"
+
err
.
Error
())
}
...
...
@@ -1059,7 +1059,7 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma
}
}
else
if
assessData
.
Status
==
domain
.
StaffAssessUncompleted
{
//未完成
assessContentList
,
err
=
srv
.
getAssess
SelfInfoUncompleted
(
transactionContext
,
assessData
)
assessContentList
,
err
=
srv
.
getAssess
InfoUncompletedV2
(
transactionContext
,
assessData
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取项目填写内容"
+
err
.
Error
())
}
...
...
@@ -1077,9 +1077,13 @@ func (srv StaffAssessServeice) SaveAssessInfo(param *command.SaveAssessInfoComma
if
!
ok
{
continue
}
if
v
.
Required
==
domain
.
NodeRequiredYes
&&
len
(
item
.
Value
)
==
0
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
v
.
Category
+
"-"
+
v
.
Name
+
":必填项"
)
if
assessData
.
Types
==
domain
.
AssessSelf
{
//每日自评需要检查必填项
if
v
.
Required
==
domain
.
NodeRequiredYes
&&
len
(
item
.
Value
)
==
0
{
return
nil
,
application
.
ThrowError
(
application
.
BUSINESS_ERROR
,
v
.
Category
+
"-"
+
v
.
Name
+
":必填项"
)
}
}
v
.
Value
=
item
.
Value
if
len
(
item
.
Value
)
>
0
{
// 转换填入的评估值
...
...
pkg/application/staff_assess/service/service_v2.go
查看文件 @
ec13016
...
...
@@ -4,6 +4,7 @@ import (
"fmt"
"sort"
"strconv"
"time"
"github.com/linmadan/egglib-go/core/application"
"github.com/linmadan/egglib-go/utils/tool_funs"
...
...
@@ -373,7 +374,7 @@ func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecu
continue
}
projectIdMap
[
assessList
[
i
]
.
EvaluationProjectId
]
=
struct
{}{}
assessContentListTemp
,
err
:=
srv
.
getAssess
SelfInfoUncompleted
(
transactionContext
,
assessList
[
i
])
assessContentListTemp
,
err
:=
srv
.
getAssess
InfoUncompletedV2
(
transactionContext
,
assessList
[
i
])
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取评估任务"
+
err
.
Error
())
}
...
...
@@ -720,7 +721,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA
}
}
else
if
assessData
.
Status
==
domain
.
StaffAssessUncompleted
{
//未完成
assessContentList
,
err
=
srv
.
getAssess
SelfInfoUncompleted
(
transactionContext
,
assessData
)
assessContentList
,
err
=
srv
.
getAssess
InfoUncompletedV2
(
transactionContext
,
assessData
)
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取项目填写内容"
+
err
.
Error
())
}
...
...
@@ -795,7 +796,7 @@ func (srv StaffAssessServeice) ListTargetUserInviteAssess(param *query.ListTarge
if
err
:=
transactionContext
.
CommitTransaction
();
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
err
.
Error
())
}
var
resultList
[]
map
[
string
]
interface
{}
resultList
:=
[]
map
[
string
]
interface
{}
{}
for
_
,
v
:=
range
assessList
{
item
:=
map
[
string
]
interface
{}{
"id"
:
v
.
Id
,
...
...
@@ -922,3 +923,65 @@ func (srv StaffAssessServeice) SelectAssessInviteUserV2(param *query.SelectAsses
}
return
tool_funs
.
SimpleWrapGridMap
(
int64
(
cnt
),
listData
),
nil
}
// 获取未完成的员工评估内容
func
(
srv
StaffAssessServeice
)
getAssessInfoUncompletedV2
(
transactionContext
application
.
TransactionContext
,
assess
*
domain
.
StaffAssess
)
([]
*
domain
.
StaffAssessContent
,
error
)
{
evaluationItemRepo
:=
factory
.
CreateEvaluationItemUsedRepository
(
map
[
string
]
interface
{}{
"transactionContext"
:
transactionContext
,
})
var
evaluationItemList
[]
*
domain
.
EvaluationItemUsed
var
err
error
_
,
evaluationItemList
,
err
=
evaluationItemRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
assess
.
EvaluationProjectId
,
"nodeId"
:
assess
.
LinkNodeId
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取项目填写内容"
+
err
.
Error
())
}
if
len
(
evaluationItemList
)
==
0
{
//如果当前节点没有评估内容,就去 使用自评节点的评估内容
_
,
evaluationItemList
,
err
=
evaluationItemRepo
.
Find
(
map
[
string
]
interface
{}{
"evaluationProjectId"
:
assess
.
EvaluationProjectId
,
"nodeType"
:
domain
.
LinkNodeSelfAssessment
,
})
if
err
!=
nil
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"获取自评项目填写内容"
+
err
.
Error
())
}
}
var
contentList
[]
*
domain
.
StaffAssessContent
nowTime
:=
time
.
Now
()
for
i
,
v
:=
range
evaluationItemList
{
item
:=
&
domain
.
StaffAssessContent
{
Id
:
0
,
StaffAssessId
:
assess
.
Id
,
SortBy
:
i
+
1
,
Category
:
v
.
Category
,
Name
:
v
.
Name
,
PromptTitle
:
v
.
PromptTitle
,
PromptText
:
v
.
PromptText
,
Remark
:
nil
,
Value
:
""
,
ReteResult
:
""
,
CreatedAt
:
nowTime
,
Weight
:
v
.
Weight
,
Required
:
v
.
Required
,
UpdatedAt
:
nowTime
,
DeletedAt
:
nil
,
Rule
:
v
.
Rule
,
}
var
remarks
[]
domain
.
AssessContemtRemark
for
_
,
vv
:=
range
v
.
EntryItems
{
ritem
:=
domain
.
AssessContemtRemark
{
Title
:
vv
.
Title
,
HintText
:
vv
.
HintText
,
Definition
:
vv
.
Definition
,
RemarkText
:
""
,
}
remarks
=
append
(
remarks
,
ritem
)
}
item
.
Remark
=
remarks
contentList
=
append
(
contentList
,
item
)
}
return
contentList
,
nil
}
...
...
pkg/application/summary_evaluation/service/scheduled.go
查看文件 @
ec13016
...
...
@@ -20,7 +20,7 @@ func sendSummaryEvaluation(project *domain.EvaluationProject,
userMap
map
[
int64
]
*
domain
.
User
,
departmentMap
map
[
int64
]
*
domain
.
Department
)
([]
domain
.
SummaryEvaluation
,
error
)
{
//自评的时间范围
beginTimeSelf
:=
project
.
EndTime
endTimeSelf
:=
dayZeroTime
(
project
.
EndTime
)
.
Add
(
3
*
24
*
time
.
Hour
-
time
.
Second
)
endTimeSelf
:=
dayZeroTime
(
project
.
EndTime
)
.
Add
(
4
*
24
*
time
.
Hour
-
time
.
Second
)
//人资、360评估的时间范围
beginTime360
:=
endTimeSelf
endTime360
:=
endTimeSelf
.
Add
(
2
*
24
*
time
.
Hour
)
...
...
pkg/application/summary_evaluation/service/scheduled_v2.go
查看文件 @
ec13016
...
...
@@ -195,7 +195,8 @@ func (se *summaryEvaluationPublisher) sendSummaryEvaluationV2(
}
//自评的时间范围
beginTimeSelf
:=
*
cycleData
.
TimeEnd
endTimeSelf
:=
dayZeroTime
(
beginTimeSelf
)
.
Add
(
3
*
24
*
time
.
Hour
-
time
.
Second
)
//修改 周期结束时间那天的第二天开始计算
endTimeSelf
:=
dayZeroTime
(
beginTimeSelf
)
.
Add
(
4
*
24
*
time
.
Hour
-
time
.
Second
)
//人资、360评估的时间范围
beginTime360
:=
endTimeSelf
endTime360
:=
endTimeSelf
.
Add
(
2
*
24
*
time
.
Hour
)
...
...
pkg/domain/staff_assess_task.go
查看文件 @
ec13016
...
...
@@ -42,4 +42,5 @@ type StaffAssessTaskRepository interface {
FindOne
(
queryOptions
map
[
string
]
interface
{})
(
*
StaffAssessTask
,
error
)
Find
(
queryOptions
map
[
string
]
interface
{})
(
int
,
[]
*
StaffAssessTask
,
error
)
RemoveByProjectId
(
id
int
)
error
RemoveByCycleId
(
id
int
)
error
}
...
...
pkg/domain/summary_evaluation.go
查看文件 @
ec13016
...
...
@@ -68,6 +68,7 @@ type SummaryEvaluationRepository interface {
FindOne
(
queryOptions
map
[
string
]
interface
{})
(
*
SummaryEvaluation
,
error
)
Find
(
queryOptions
map
[
string
]
interface
{})
(
int
,
[]
*
SummaryEvaluation
,
error
)
RemoveByProjectId
(
id
int
)
error
RemoveByCycleId
(
id
int64
)
error
}
// 计算总分。TotalScore 保留1位小数
...
...
pkg/infrastructure/dao/staff_assess_dao.go
查看文件 @
ec13016
...
...
@@ -1280,6 +1280,7 @@ func (d *StaffAssessDao) CountUncompletedSelfAssess(companyId int, projectIds []
AND staff_assess.types = 'self'
AND staff_assess.evaluation_project_id IN (?)
AND staff_assess.status = 'uncompleted'
AND staff_assess.end_time < now()
GROUP BY
evaluation_project_id, target_user_id`
...
...
pkg/infrastructure/dao/staff_assess_dao_2.go
查看文件 @
ec13016
...
...
@@ -125,6 +125,7 @@ and staff_assess.evaluation_project_id in (
// hrbp 是否搜索HRBP角色的用户可以查看,1:是;-1:否 (必填)
func
(
d
*
StaffAssessDao
)
catchProjectIdByPermission
(
companyId
int
,
cycleId
int
,
operaterId
int
,
hrbp
int
)
string
{
withSql
:=
`
set time zone 'PRC';
with
t_project_0 as(
select evaluation_project.id as project_id,
...
...
pkg/infrastructure/dao/summary_evaluation_dao.go
查看文件 @
ec13016
...
...
@@ -39,7 +39,9 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(companyId int, executorId in
summary_evaluation.cycle_id ,
summary_evaluation.cycle_name
from summary_evaluation
where summary_evaluation.company_id=?
where summary_evaluation.company_id=?
and summary_evaluation.begin_time <=now()
and summary_evaluation.deleted_at isnull
`
tx
:=
d
.
transactionContext
.
PgTx
condition
:=
[]
interface
{}{
...
...
@@ -64,7 +66,7 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(companyId int, executorId
distinct summary_evaluation.cycle_id
) as cnt
from summary_evaluation
where summary_evaluation.company_id=? `
where summary_evaluation.company_id=?
and summary_evaluation.deleted_at isnull
`
tx
:=
d
.
transactionContext
.
PgTx
condition
:=
[]
interface
{}{
...
...
pkg/infrastructure/repository/pg_evaluation_item_used_repository.go
查看文件 @
ec13016
...
...
@@ -93,6 +93,10 @@ func (repo *EvaluationItemUsedRepository) Find(queryOptions map[string]interface
query
.
Where
(
"node_type=?"
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"nodeId"
];
ok
{
query
.
Where
(
"node_id=?"
,
v
)
}
if
v
,
ok
:=
queryOptions
[
"evaluatorId"
];
ok
{
query
.
Where
(
"evaluator_id=?"
,
v
)
}
...
...
pkg/infrastructure/repository/pg_staff_assess_task_repository.go
查看文件 @
ec13016
...
...
@@ -153,3 +153,13 @@ func (repo *StaffAssessTaskRepository) RemoveByProjectId(id int) error {
Update
()
return
err
}
func
(
repo
*
StaffAssessTaskRepository
)
RemoveByCycleId
(
id
int
)
error
{
tx
:=
repo
.
transactionContext
.
PgTx
nowTime
:=
time
.
Now
()
_
,
err
:=
tx
.
Model
(
&
models
.
StaffAssessTask
{})
.
Where
(
"cycle_id=?"
,
id
)
.
Set
(
"deleted_at=?"
,
nowTime
)
.
Update
()
return
err
}
...
...
pkg/infrastructure/repository/pg_summary_evaluation_repository.go
查看文件 @
ec13016
...
...
@@ -197,3 +197,13 @@ func (repo *SummaryEvaluationRepository) RemoveByProjectId(id int) error {
Update
()
return
err
}
func
(
repo
*
SummaryEvaluationRepository
)
RemoveByCycleId
(
id
int64
)
error
{
tx
:=
repo
.
transactionContext
.
PgTx
nowTime
:=
time
.
Now
()
_
,
err
:=
tx
.
Model
(
&
models
.
SummaryEvaluation
{})
.
Where
(
"cycle_id=?"
,
id
)
.
Set
(
"deleted_at=?"
,
nowTime
)
.
Update
()
return
err
}
...
...
sql/2023-04-01.sql
0 → 100644
查看文件 @
ec13016
-- 数据修复
-- 需备份 evaluation_item_used 表数据
WITH
t1
AS
(
SELECT
evaluation_project
.
company_id
,
evaluation_project
.
id
AS
project_id
,
jsonb_array_elements
(
evaluation_project
.
"template"
#>
'{linkNodes}'
)
AS
nodes
FROM
evaluation_project
WHERE
evaluation_project
.
"template"
#>
'{linkNodes}'
<>
'null'
ORDER
BY
id
),
t2
AS
(
SELECT
t1
.
company_id
,
t1
.
project_id
,
t1
.
nodes
->>
'id'
AS
node_id
,
t1
.
nodes
->>
'type'
AS
node_type
,
jsonb_array_elements
(
t1
.
nodes
#>
'{nodeContents}'
)
AS
node_contents
FROM
t1
WHERE
t1
.
nodes
#>
'{nodeContents}'
<>
'null'
),
t3
AS
(
SELECT
t2
.
company_id
,
t2
.
project_id
,
cast
(
t2
.
node_id
AS
int8
)
AS
node_id
,
cast
(
t2
.
node_type
AS
int8
)
AS
node_type
,
t2
.
node_contents
->>
'category'
AS
"category"
,
t2
.
node_contents
->>
'name'
AS
"name"
,
cast
(
t2
.
node_contents
->>
'ruleId'
AS
int8
)
AS
"rule_id"
FROM
t2
),
t4
as
(
SELECT
t3
.
project_id
,
t3
.
node_type
,
t3
.
"category"
,
t3
.
"name"
,
row_to_json
(
"evaluation_rule"
.
*
)
as
"rule"
,
"evaluation_rule"
.
"type"
as
rule_type
FROM
t3
join
"evaluation_rule"
on
t3
.
rule_id
=
"evaluation_rule"
.
id
),
t5
as
(
SELECT
evaluation_item_used
.
"id"
,
evaluation_item_used
.
evaluation_project_id
,
evaluation_item_used
.
node_type
,
evaluation_item_used
.
category
,
evaluation_item_used
.
"name"
FROM
evaluation_item_used
WHERE
"rule"
=
'{}'
or
"rule"
ISNULL
),
t6
as
(
SELECT
t5
.
"id"
,
t4
.
"rule"
,
t4
.
rule_type
FROM
t5
,
t4
WHERE
t5
.
evaluation_project_id
=
t4
.
project_id
and
t5
.
node_type
=
t4
.
node_type
and
t5
.
category
=
t4
.
category
and
t5
.
"name"
=
t4
.
"name"
)
update
evaluation_item_used
set
"rule"
=
t6
.
"rule"
,
rule_type
=
t6
.
"rule_type"
FROM
t6
WHERE
evaluation_item_used
.
"id"
=
t6
.
"id"
;
-- 修复数据
with
t1
as
(
SELECT
evaluation_rule
.
id
::
TEXT
,
evaluation_rule
.
"name"
,
evaluation_rule
.
remark
,
evaluation_rule
.
company_id
::
TEXT
as
"companyId"
,
evaluation_rule
.
creator_id
::
TEXT
as
"creatorId"
,
evaluation_rule
.
"type"
,
evaluation_rule
.
rating
,
evaluation_rule
.
score
,
evaluation_rule
.
sys_type
as
"sysType"
FROM
evaluation_rule
),
t2
as
(
SELECT
t1
.
id
,
row_to_json
(
t1
.
*
)
as
row_j
FROM
t1
),
t3
as
(
SELECT
evaluation_item_used
.
id
,
t2
.
row_j
FROM
evaluation_item_used
join
t2
on
t2
.
id
=
evaluation_item_used
.
"rule"
->>
'id'
WHERE
evaluation_item_used
.
"rule"
->
'companyId'
ISNULL
and
evaluation_item_used
.
"rule"
->
'id'
is
not
null
)
update
evaluation_item_used
SET
"rule"
=
t3
.
row_j
FROM
t3
WHERE
evaluation_item_used
.
id
=
t3
.
id
;
-- 修改开始结束时间
UPDATE
summary_evaluation
set
begin_time
=
'2023-03-31 23:59:00+08'
,
end_time
=
'2023-04-02 23:59:00+08'
WHERE
id
=
36
;
UPDATE
summary_evaluation
set
begin_time
=
'2023-04-02 23:59:00+08'
,
end_time
=
'2023-04-04 23:59:00+08'
WHERE
id
=
37
-- 修改数据summary_evaluation 表数据
with
t1
as
(
SELECT
summary_evaluation
.
id
,
summary_evaluation
.
evaluation_project_id
FROM
summary_evaluation
WHERE
to_char
(
summary_evaluation
.
begin_time
,
'YYYY-MM-DD'
)
=
'2023-03-31'
and
to_char
(
summary_evaluation
.
end_time
,
'YYYY-MM-DD'
)
=
'2023-04-02'
and
company_id
=
1
)
update
summary_evaluation
set
end_time
=
end_time
+
'1 day'
FROM
t1
WHERE
summary_evaluation
.
evaluation_project_id
=
t1
.
evaluation_project_id
\ No newline at end of file
...
...
sql/2023-04-03.sql
0 → 100644
查看文件 @
ec13016
-- 调整旧数据
WITH
t1
AS
(
SELECT
evaluation_cycle
.
id
AS
cycle_id
FROM
evaluation_cycle
WHERE
deleted_at
IS
NOT
NULL
)
UPDATE
summary_evaluation
SET
deleted_at
=
now
()
FROM
t1
WHERE
summary_evaluation
.
cycle_id
=
t1
.
cycle_id
...
...
请
注册
或
登录
后发表评论