...
|
...
|
@@ -210,6 +210,39 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA |
|
|
return result, err
|
|
|
}
|
|
|
|
|
|
//根据周期的id和日期获取员工填写的评估内容,数量统计
|
|
|
//companyId int 公司id
|
|
|
//cycleId int, 评估周期id
|
|
|
//userId int, 用户id,谁要查看数据
|
|
|
//beginDay string, 周期中执行项目的时间
|
|
|
//hrbp 是否搜索HRBP角色的用户可以查看,1:是;-1:否
|
|
|
//limit int, 分页条数
|
|
|
//offset int 分页偏移
|
|
|
func (d *StaffAssessDao) CountUserAssess(param SearchConditin1) ([]UserAssessContent, error) {
|
|
|
sqlStr := ` select
|
|
|
t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day,
|
|
|
staff_assess_content.value ,staff_assess_content.sort_by ,
|
|
|
staff_assess_content.category ,staff_assess_content."name" as content_name ,
|
|
|
staff_assess_content.weight
|
|
|
from t_staff_assess_1
|
|
|
left join staff_assess_content on t_staff_assess_1.assess_id = staff_assess_content.staff_assess_id
|
|
|
`
|
|
|
condition := []interface{}{}
|
|
|
if len(param.TargetUserName) > 0 {
|
|
|
sqlStr += ` where t_staff_assess_1.target_user_name like ? `
|
|
|
condition = append(condition, param.TargetUserName)
|
|
|
}
|
|
|
//加入排序
|
|
|
sqlStr += ` order by convert_to(t_staff_assess_1.target_user_name,'GBK'),staff_assess_content.sort_by `
|
|
|
//获取前置sql语句
|
|
|
sqlStr0 := d.useTStaffAssess(param.CompanyId, param.CycleId, param.OperaterId, param.BeginDay, param.Hrbp, param.Limit, param.Offset)
|
|
|
sqlStr = sqlStr0 + sqlStr
|
|
|
tx := d.transactionContext.PgTx
|
|
|
var result []UserAssessContent
|
|
|
_, err := tx.QueryOne(&result, sqlStr, condition...)
|
|
|
return result, err
|
|
|
}
|
|
|
|
|
|
//生成的sql 根据用户的查看权限 ,获取可查看的评估任务,
|
|
|
//companyId int 公司id
|
|
|
//cycleId int, 评估周期id
|
...
|
...
|
|