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