|
@@ -1108,7 +1108,7 @@ type ContentCategoryName struct { |
|
@@ -1108,7 +1108,7 @@ type ContentCategoryName struct { |
1108
|
|
1108
|
|
1109
|
// 员工绩效-综合管理-导出绩效指标
|
1109
|
// 员工绩效-综合管理-导出绩效指标
|
1110
|
// 抽取出评估的指标
|
1110
|
// 抽取出评估的指标
|
1111
|
-func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, userId int, hrbp int) ([]ContentCategoryName, error) {
|
1111
|
+func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, userId int, hrbp int, exportUserIds []string) ([]ContentCategoryName, error) {
|
1112
|
sqlStr := `
|
1112
|
sqlStr := `
|
1113
|
select
|
1113
|
select
|
1114
|
staff_assess_content.category,
|
1114
|
staff_assess_content.category,
|
|
@@ -1126,19 +1126,25 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u |
|
@@ -1126,19 +1126,25 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u |
1126
|
END) as cnt
|
1126
|
END) as cnt
|
1127
|
from staff_assess_content
|
1127
|
from staff_assess_content
|
1128
|
join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.assess_id
|
1128
|
join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.assess_id
|
1129
|
- group by staff_assess_content.category,
|
1129
|
+ where 1=1
|
|
|
1130
|
+ `
|
|
|
1131
|
+ condition := []interface{}{}
|
|
|
1132
|
+ if len(exportUserIds) > 0 {
|
|
|
1133
|
+ condition = append(condition, pg.In(exportUserIds))
|
|
|
1134
|
+ sqlStr += ` and t_staff_assess_1.target_user_id in(?) `
|
|
|
1135
|
+ }
|
|
|
1136
|
+ sqlStr += ` group by staff_assess_content.category,
|
1130
|
staff_assess_content."name" ,
|
1137
|
staff_assess_content."name" ,
|
1131
|
t_staff_assess_1.cycle_id ,
|
1138
|
t_staff_assess_1.cycle_id ,
|
1132
|
t_staff_assess_1.cycle_name,
|
1139
|
t_staff_assess_1.cycle_name,
|
1133
|
staff_assess_content.weight ,
|
1140
|
staff_assess_content.weight ,
|
1134
|
target_user_id,target_user_name
|
1141
|
target_user_id,target_user_name
|
1135
|
- order by cnt desc,target_user_id
|
|
|
1136
|
- `
|
1142
|
+ order by cnt desc,target_user_id `
|
1137
|
sqlStr0 := d.useTStaffAssess(companyId, cycleId, userId, "", hrbp, 5000, 0, string(domain.AssessSelf))
|
1143
|
sqlStr0 := d.useTStaffAssess(companyId, cycleId, userId, "", hrbp, 5000, 0, string(domain.AssessSelf))
|
1138
|
sqlStr = sqlStr0 + sqlStr
|
1144
|
sqlStr = sqlStr0 + sqlStr
|
1139
|
tx := d.transactionContext.PgTx
|
1145
|
tx := d.transactionContext.PgTx
|
1140
|
result := []ContentCategoryName{}
|
1146
|
result := []ContentCategoryName{}
|
1141
|
- _, err := tx.Query(&result, sqlStr)
|
1147
|
+ _, err := tx.Query(&result, sqlStr, condition...)
|
1142
|
return result, err
|
1148
|
return result, err
|
1143
|
}
|
1149
|
}
|
1144
|
|
1150
|
|