作者 tangxvhui

更新查询条件

... ... @@ -12,8 +12,8 @@ type SummaryEvaluationAdapter struct {
}
type SummaryEvaluationHRBPAdapter struct {
Id int `json:"id"` // 周期评估ID
TargetUserId int `json:"targetUserId"` // 目标用户ID
Id int `json:"id,string"` // 周期评估ID
TargetUserId int `json:"targetUserId,string"` // 目标用户ID
TargetUserName string `json:"targetUserName"` // 目标用户名称
Department string `json:"departmentVal"` // 部门(拼接文本)
Position string `json:"positionVal"` // 职位(拼接文本)
... ...
... ... @@ -438,26 +438,23 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval
staffAssessDaoRepo := dao.NewStaffAssessDao(map[string]interface{}{"transactionContext": transactionContext})
userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext})
positionRepo := factory.CreatePositionRepository(map[string]interface{}{"transactionContext": transactionContext})
var searchTargetName string
if len(param.SearchName) > 0 {
searchTargetName = "%" + param.SearchName + "%"
} else {
searchTargetName = ""
}
limit := param.PageSize
offset := limit * (param.PageNumber - 1)
if offset < 0 {
offset = 0
}
count, list, err := evaluationRepo.Find(map[string]interface{}{
condition := map[string]interface{}{
"companyId": param.CompanyId,
"cycleId": param.CycleId,
"executorId": -1,
"types": domain.EvaluationHrbp,
"targetUserName": searchTargetName,
"limit": limit,
"offset": offset,
})
}
if len(param.SearchName) > 0 {
condition["targetUserName"] = "%" + param.SearchName + "%"
}
count, list, err := evaluationRepo.Find(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ...