切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
587bb9efa3c75f3fbcf238544cab492c73dae136
1 个父辈
ea58c7d8
暂存
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
49 行增加
和
0 行删除
pkg/infrastructure/dao/staff_assess_dao.go
pkg/infrastructure/dao/staff_assess_dao.go
查看文件 @
587bb9e
...
...
@@ -249,3 +249,52 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA
_
,
err
:=
tx
.
QueryOne
(
&
result
,
sqlStr
,
condition
...
)
return
result
,
err
}
// 根据用户的查看权限 合并用户
// 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= 526
// ),
// t_department as (
// select department.id::text as depart_id from department where charge_user_ids @>'[3330208201102336]'
// ),
// -- 如果是部门管理员 获取用户列表
// t_user_1 as (
// select t_user_department.user_id from t_user_department
// join t_department on t_user_department.depart_id = t_department.depart_id
// ),
// -- 如果是hrbp
// t_user_2 as(
// select jsonb_array_elements_text (evaluation_project.recipients) as user_id
// from evaluation_project
// where evaluation_project.cycle_id =1592787960795762688
// and evaluation_project.hr_bp = 1
// ),
// -- 如果是项目管理员
// t_user_3 as(
// select jsonb_array_elements_text (evaluation_project.recipients) as user_id
// from evaluation_project
// where evaluation_project.cycle_id =1592787960795762688
// and evaluation_project.pmp =1
// and evaluation_project.pmp_ids @>'[3330208201102336]'
// ),
// -- 合并用户
// t_user_all as(
// select t_user_1.user_id::text from t_user_1
// union
// select t_user_2.user_id::text from t_user_2
// union
// select t_user_3.user_id::text from t_user_3
// ),
// -- 根据用户提取评估列表
// t_staff_assess as(
// select staff_assess.id as assess_id,
// staff_assess.target_user->>'userId' as user_id,
// staff_assess.target_user->>'userName' as user_name
// from staff_assess
// join t_user_all on staff_assess.target_user->>'userId'= t_user_all.user_id
// where staff_assess.cycle_id = 1592787960795762688
// and to_char(staff_assess.begin_time,'YYYY-MM-DD')='2022-11-24'
// and staff_assess."types" ='self'
// limit 1 offset 0
// )
...
...
请
注册
或
登录
后发表评论