作者 tangxvhui

更新查询条件

... ... @@ -12,13 +12,13 @@ type SummaryEvaluationAdapter struct {
}
type SummaryEvaluationHRBPAdapter struct {
Id int `json:"id"` // 周期评估ID
TargetUserId int `json:"targetUserId"` // 目标用户ID
TargetUserName string `json:"targetUserName"` // 目标用户名称
Department string `json:"departmentVal"` // 部门(拼接文本)
Position string `json:"positionVal"` // 职位(拼接文本)
DutyTime string `json:"dutyTime"` // 入职时间(2006-01-02 15:04)
Status string `json:"statusVal"` // 完成状态(拼接文本)
EndTime string `json:"endTime"` // 截止时间(2006-01-02 15:04)
OverdueCount int `json:"overdueCount"` // 自评逾期次数
Id int `json:"id,string"` // 周期评估ID
TargetUserId int `json:"targetUserId,string"` // 目标用户ID
TargetUserName string `json:"targetUserName"` // 目标用户名称
Department string `json:"departmentVal"` // 部门(拼接文本)
Position string `json:"positionVal"` // 职位(拼接文本)
DutyTime string `json:"dutyTime"` // 入职时间(2006-01-02 15:04)
Status string `json:"statusVal"` // 完成状态(拼接文本)
EndTime string `json:"endTime"` // 截止时间(2006-01-02 15:04)
OverdueCount int `json:"overdueCount"` // 自评逾期次数
}
... ...
... ... @@ -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{}{
"companyId": param.CompanyId,
"cycleId": param.CycleId,
"executorId": -1,
"types": domain.EvaluationHrbp,
"targetUserName": searchTargetName,
"limit": limit,
"offset": offset,
})
condition := map[string]interface{}{
"companyId": param.CompanyId,
"cycleId": param.CycleId,
"types": domain.EvaluationHrbp,
"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())
}
... ...