作者 tangxvhui

更新查询条件

@@ -12,13 +12,13 @@ type SummaryEvaluationAdapter struct { @@ -12,13 +12,13 @@ type SummaryEvaluationAdapter struct {
12 } 12 }
13 13
14 type SummaryEvaluationHRBPAdapter struct { 14 type SummaryEvaluationHRBPAdapter struct {
15 - Id int `json:"id"` // 周期评估ID  
16 - TargetUserId int `json:"targetUserId"` // 目标用户ID  
17 - TargetUserName string `json:"targetUserName"` // 目标用户名称  
18 - Department string `json:"departmentVal"` // 部门(拼接文本)  
19 - Position string `json:"positionVal"` // 职位(拼接文本)  
20 - DutyTime string `json:"dutyTime"` // 入职时间(2006-01-02 15:04)  
21 - Status string `json:"statusVal"` // 完成状态(拼接文本)  
22 - EndTime string `json:"endTime"` // 截止时间(2006-01-02 15:04)  
23 - OverdueCount int `json:"overdueCount"` // 自评逾期次数 15 + Id int `json:"id,string"` // 周期评估ID
  16 + TargetUserId int `json:"targetUserId,string"` // 目标用户ID
  17 + TargetUserName string `json:"targetUserName"` // 目标用户名称
  18 + Department string `json:"departmentVal"` // 部门(拼接文本)
  19 + Position string `json:"positionVal"` // 职位(拼接文本)
  20 + DutyTime string `json:"dutyTime"` // 入职时间(2006-01-02 15:04)
  21 + Status string `json:"statusVal"` // 完成状态(拼接文本)
  22 + EndTime string `json:"endTime"` // 截止时间(2006-01-02 15:04)
  23 + OverdueCount int `json:"overdueCount"` // 自评逾期次数
24 } 24 }
@@ -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 }