切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
郑周
2 years ago
提交
14cf3f9bcd88099a500c0d12674ceb0d037fcdf3
1 个父辈
1095518c
1. 优化 部门的上级权限修改成 ---> 配置的上级权限
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
27 行增加
和
53 行删除
pkg/infrastructure/dao/staff_assess_dao.go
pkg/infrastructure/dao/staff_assess_dao.go
查看文件 @
14cf3f9
...
...
@@ -434,20 +434,24 @@ type SummaryAssess struct {
}
func
(
d
*
StaffAssessDao
)
SummaryAssess
(
companyId
int
,
operatorId
int
,
cycleId
int
,
beginDay
string
,
hrbp
int
)
([]
SummaryAssess
,
error
)
{
//`
//with t_user_department as (
// select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user"
// where "user".company_id= %d and "user".deleted_at isnull
//),
//t_department as (
// select department.id::text as depart_id from department where charge_user_ids @>'[%d]'
// and "department".deleted_at isnull
//),
//-- 部门主管(所有下级用户ID)
//t_user_1 as (
// select t_user_department.user_id::text from t_user_department
// join t_department on t_user_department.depart_id = t_department.depart_id
//),`
sqlString
:=
`
set time zone 'PRC';
with t_user_department as (
select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user"
where "user".company_id= %d and "user".deleted_at isnull
),
t_department as (
select department.id::text as depart_id from department where charge_user_ids @>'[%d]'
and "department".deleted_at isnull
),
-- 部门主管(所有下级用户ID)
t_user_1 as (
select t_user_department.user_id::text from t_user_department
join t_department on t_user_department.depart_id = t_department.depart_id
with t_user_1 as (
select "user".id::text as user_id from "user" where "user".parent_id =%d
),
-- 如果是HRBP
t_project_1 as(
...
...
@@ -520,7 +524,8 @@ func (d *StaffAssessDao) SummaryAssess(companyId int, operatorId int, cycleId in
)
)
`
params
:=
[]
interface
{}{
companyId
,
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
,
beginDay
}
params
:=
[]
interface
{}{
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
,
beginDay
}
//params := []interface{}{companyId, operatorId, cycleId, hrbp, cycleId, operatorId, cycleId, beginDay}
sqlString
=
fmt
.
Sprintf
(
sqlString
,
params
...
)
...
...
@@ -562,21 +567,10 @@ func (d *StaffAssessDao) MemberSummaryList(likeUserName string, companyId int, o
if
offset
<
0
{
offset
=
0
}
sqlString
:=
`
set time zone 'PRC';
with t_user_department as (
select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user"
where "user".company_id= %d and "user".deleted_at isnull
),
t_department as (
select department.id::text as depart_id from department where charge_user_ids @>'[%d]'
and "department".deleted_at isnull
),
-- 部门主管(所有下级用户ID)
t_user_1 as (
select t_user_department.user_id::text from t_user_department
join t_department on t_user_department.depart_id = t_department.depart_id
with t_user_1 as (
select "user".id::text as user_id from "user" where "user".parent_id =%d
),
-- 如果是HRBP
t_project_1 as(
...
...
@@ -642,7 +636,7 @@ func (d *StaffAssessDao) MemberSummaryList(likeUserName string, companyId int, o
)
)
`
params
:=
[]
interface
{}{
companyId
,
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
}
params
:=
[]
interface
{}{
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
}
// 筛选结果的所有评估数据
sqlString
=
fmt
.
Sprintf
(
sqlString
,
params
...
)
...
...
@@ -709,18 +703,8 @@ type PerformanceIndicatorAssess struct {
func
(
d
*
StaffAssessDao
)
MemberPerformanceIndicator
(
likeUserName
string
,
companyId
int
,
operatorId
int
,
cycleId
int
,
hrbp
int
,
assessType
string
,
userIds
[]
string
)
([]
PerformanceIndicatorAssess
,
error
)
{
sqlString
:=
`
set time zone 'PRC';
with t_user_department as (
select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user"
where "user".company_id= %d and "user".deleted_at isnull
),
t_department as (
select department.id::text as depart_id from department where charge_user_ids @>'[%d]'
and "department".deleted_at isnull
),
-- 部门主管(所有下级用户ID)
t_user_1 as (
select t_user_department.user_id::text from t_user_department
join t_department on t_user_department.depart_id = t_department.depart_id
with t_user_1 as (
select "user".id::text as user_id from "user" where "user".parent_id =%d
),
-- 如果是HRBP
t_project_1 as(
...
...
@@ -783,7 +767,7 @@ func (d *StaffAssessDao) MemberPerformanceIndicator(likeUserName string, company
)
)
`
params
:=
[]
interface
{}{
companyId
,
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
,
assessType
}
params
:=
[]
interface
{}{
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
,
assessType
}
sqlString
=
fmt
.
Sprintf
(
sqlString
,
params
...
)
sqlString
+=
` select
...
...
@@ -843,18 +827,8 @@ func (d *StaffAssessDao) ExportPerformanceIndicator(
userIds
[]
string
)
([]
ExportPerformanceIndicator
,
error
)
{
sqlString
:=
`
set time zone 'PRC';
with t_user_department as (
select "user".id as user_id ,jsonb_array_elements_text ("user".department_id) as depart_id from "user"
where "user".company_id= %d and "user".deleted_at isnull
),
t_department as (
select department.id::text as depart_id from department where charge_user_ids @>'[%d]'
and "department".deleted_at isnull
),
-- 部门主管(所有下级用户ID)
t_user_1 as (
select t_user_department.user_id::text from t_user_department
join t_department on t_user_department.depart_id = t_department.depart_id
with t_user_1 as (
select "user".id::text as user_id from "user" where "user".parent_id =%d
),
-- 如果是HRBP
t_project_1 as(
...
...
@@ -917,7 +891,7 @@ func (d *StaffAssessDao) ExportPerformanceIndicator(
)
)
`
params
:=
[]
interface
{}{
companyId
,
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
,
assessType
}
params
:=
[]
interface
{}{
operatorId
,
cycleId
,
hrbp
,
cycleId
,
operatorId
,
cycleId
,
assessType
}
sqlString
=
fmt
.
Sprintf
(
sqlString
,
params
...
)
sqlString
+=
` select
...
...
请
注册
或
登录
后发表评论