|
@@ -438,26 +438,23 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval |
|
@@ -438,26 +438,23 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval |
438
|
staffAssessDaoRepo := dao.NewStaffAssessDao(map[string]interface{}{"transactionContext": transactionContext})
|
438
|
staffAssessDaoRepo := dao.NewStaffAssessDao(map[string]interface{}{"transactionContext": transactionContext})
|
439
|
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
439
|
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
|
440
|
positionRepo := factory.CreatePositionRepository(map[string]interface{}{"transactionContext": transactionContext})
|
440
|
positionRepo := factory.CreatePositionRepository(map[string]interface{}{"transactionContext": transactionContext})
|
441
|
- var searchTargetName string
|
|
|
442
|
- if len(param.SearchName) > 0 {
|
|
|
443
|
- searchTargetName = "%" + param.SearchName + "%"
|
|
|
444
|
- } else {
|
|
|
445
|
- searchTargetName = ""
|
|
|
446
|
- }
|
441
|
+
|
447
|
limit := param.PageSize
|
442
|
limit := param.PageSize
|
448
|
offset := limit * (param.PageNumber - 1)
|
443
|
offset := limit * (param.PageNumber - 1)
|
449
|
if offset < 0 {
|
444
|
if offset < 0 {
|
450
|
offset = 0
|
445
|
offset = 0
|
451
|
}
|
446
|
}
|
452
|
- count, list, err := evaluationRepo.Find(map[string]interface{}{
|
|
|
453
|
- "companyId": param.CompanyId,
|
|
|
454
|
- "cycleId": param.CycleId,
|
|
|
455
|
- "executorId": -1,
|
|
|
456
|
- "types": domain.EvaluationHrbp,
|
|
|
457
|
- "targetUserName": searchTargetName,
|
|
|
458
|
- "limit": limit,
|
|
|
459
|
- "offset": offset,
|
|
|
460
|
- })
|
447
|
+ condition := map[string]interface{}{
|
|
|
448
|
+ "companyId": param.CompanyId,
|
|
|
449
|
+ "cycleId": param.CycleId,
|
|
|
450
|
+ "types": domain.EvaluationHrbp,
|
|
|
451
|
+ "limit": limit,
|
|
|
452
|
+ "offset": offset,
|
|
|
453
|
+ }
|
|
|
454
|
+ if len(param.SearchName) > 0 {
|
|
|
455
|
+ condition["targetUserName"] = "%" + param.SearchName + "%"
|
|
|
456
|
+ }
|
|
|
457
|
+ count, list, err := evaluationRepo.Find(condition)
|
461
|
if err != nil {
|
458
|
if err != nil {
|
462
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
459
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
463
|
}
|
460
|
}
|