...
|
...
|
@@ -1108,7 +1108,7 @@ type ContentCategoryName struct { |
|
|
|
|
|
// 员工绩效-综合管理-导出绩效指标
|
|
|
// 抽取出评估的指标
|
|
|
func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, userId int, hrbp int) ([]ContentCategoryName, error) {
|
|
|
func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, userId int, hrbp int, exportUserIds []string) ([]ContentCategoryName, error) {
|
|
|
sqlStr := `
|
|
|
select
|
|
|
staff_assess_content.category,
|
...
|
...
|
@@ -1126,19 +1126,25 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u |
|
|
END) as cnt
|
|
|
from staff_assess_content
|
|
|
join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.assess_id
|
|
|
group by staff_assess_content.category,
|
|
|
where 1=1
|
|
|
`
|
|
|
condition := []interface{}{}
|
|
|
if len(exportUserIds) > 0 {
|
|
|
condition = append(condition, pg.In(exportUserIds))
|
|
|
sqlStr += ` and t_staff_assess_1.target_user_id in(?) `
|
|
|
}
|
|
|
sqlStr += ` group by staff_assess_content.category,
|
|
|
staff_assess_content."name" ,
|
|
|
t_staff_assess_1.cycle_id ,
|
|
|
t_staff_assess_1.cycle_name,
|
|
|
staff_assess_content.weight ,
|
|
|
target_user_id,target_user_name
|
|
|
order by cnt desc,target_user_id
|
|
|
`
|
|
|
order by cnt desc,target_user_id `
|
|
|
sqlStr0 := d.useTStaffAssess(companyId, cycleId, userId, "", hrbp, 5000, 0, string(domain.AssessSelf))
|
|
|
sqlStr = sqlStr0 + sqlStr
|
|
|
tx := d.transactionContext.PgTx
|
|
|
result := []ContentCategoryName{}
|
|
|
_, err := tx.Query(&result, sqlStr)
|
|
|
_, err := tx.Query(&result, sqlStr, condition...)
|
|
|
return result, err
|
|
|
}
|
|
|
|
...
|
...
|
|