...
|
...
|
@@ -260,6 +260,40 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA |
|
|
return result, err
|
|
|
}
|
|
|
|
|
|
type UserAssessContentItem struct {
|
|
|
Category string `pg:"category"` //指标分类
|
|
|
Name string `pg:"name"` //指标名称
|
|
|
}
|
|
|
|
|
|
// 项目管理-成员列表 根据周期的id和日期获取员工的评估指标
|
|
|
// companyId int 公司id
|
|
|
// cycleId int, 评估周期id
|
|
|
// userId int, 用户id,谁要查看数据
|
|
|
// beginDay string, 周期中执行项目的时间
|
|
|
// hrbp 是否搜索HRBP角色的用户可以查看,1:是;-1:否
|
|
|
// limit int, 分页条数 不需要
|
|
|
// offset int 分页偏移 不需要
|
|
|
func (d *StaffAssessDao) SearchUserAssessContentItem(param SearchConditin1) ([]UserAssessContentItem, error) {
|
|
|
param.Offset = 0
|
|
|
param.Limit = 10000
|
|
|
|
|
|
sqlStr := `select
|
|
|
staff_assess_content.category,
|
|
|
staff_assess_content."name"
|
|
|
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,
|
|
|
staff_assess_content."name"
|
|
|
`
|
|
|
//获取前置sql语句
|
|
|
sqlStr0 := d.useTStaffAssess(param.CompanyId, param.CycleId, param.OperaterId, param.BeginDay, param.Hrbp, param.Limit, param.Offset, string(domain.AssessSelf))
|
|
|
sqlStr = sqlStr0 + sqlStr
|
|
|
tx := d.transactionContext.PgTx
|
|
|
result := []UserAssessContentItem{}
|
|
|
_, err := tx.Query(&result, sqlStr)
|
|
|
return result, err
|
|
|
}
|
|
|
|
|
|
// 项目管理-成员列表 根据周期的id和日期获取员工填写的评估内容,数量统计
|
|
|
// companyId int 公司id
|
|
|
// cycleId int, 评估周期id
|
...
|
...
|
@@ -1068,8 +1102,8 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u |
|
|
staff_assess_content.category,
|
|
|
staff_assess_content."name" ,
|
|
|
staff_assess_content.weight ,
|
|
|
staff_assess.cycle_id ,
|
|
|
staff_assess.cycle_name,
|
|
|
t_staff_assess_1.cycle_id ,
|
|
|
t_staff_assess_1.cycle_name,
|
|
|
t_staff_assess_1.target_user_id,
|
|
|
t_staff_assess_1.target_user_name,
|
|
|
sum(
|
...
|
...
|
@@ -1079,14 +1113,14 @@ func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, u |
|
|
ELSE 1
|
|
|
END) as cnt
|
|
|
from staff_assess_content
|
|
|
join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.id
|
|
|
join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.assess_id
|
|
|
group by staff_assess_content.category,
|
|
|
staff_assess_content."name" ,
|
|
|
staff_assess.cycle_id ,
|
|
|
staff_assess.cycle_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,user_id
|
|
|
order by cnt desc,target_user_id
|
|
|
`
|
|
|
sqlStr0 := d.useTStaffAssess(companyId, cycleId, userId, "", hrbp, 0, 5000, string(domain.AssessSelf))
|
|
|
sqlStr = sqlStr0 + sqlStr
|
...
|
...
|
|