作者 tangxvhui

更新搜索查询sql

... ... @@ -249,10 +249,11 @@ func (d *StaffAssessDao) SearchUserAssessContent(param SearchConditin1) ([]UserA
sqlStr += ` and t_staff_assess_1.target_user_name like ? `
condition = append(condition, "%"+param.TargetUserName+"%")
}
condition = append(condition, param.Limit, param.Offset)
//加入排序
sqlStr += ` order by convert_to(t_staff_assess_1.target_user_name,'GBK'),staff_assess_content.sort_by `
sqlStr += ` order by convert_to(t_staff_assess_1.target_user_name,'GBK'),staff_assess_content.sort_by limit ? offset ?`
//获取前置sql语句
sqlStr0 := d.useTStaffAssess(param.CompanyId, param.CycleId, param.OperaterId, param.BeginDay, param.Hrbp, param.Limit, param.Offset, string(domain.AssessSelf))
sqlStr0 := d.useTStaffAssess(param.CompanyId, param.CycleId, param.OperaterId, param.BeginDay, param.Hrbp, 99999, 0, string(domain.AssessSelf))
sqlStr = sqlStr0 + sqlStr
tx := d.transactionContext.PgTx
result := []UserAssessContent{}
... ...
... ... @@ -299,22 +299,15 @@ func (d *StaffAssessDao) ListTargetUserNoInvite(companyId int, cycleId int, begi
}
type UserSelfStaffAssess struct {
AssessId string `pg:"assess_id"`
EvaluationProjectName string `pg:"evaluation_project_name"` //项目名称
CompanyId string `pg:"company_id"` //公司id
ContentId int `pg:"content_id"` //
TargetUserId string `pg:"target_user_id"` //被评估人的id
TargetUserName string `pg:"target_user_name"` //被评估人的名称
BeginDay string `pg:"begin_day"` //评估的日期
EvaluationProjectId string `pg:"evaluation_project_id"` //项目id
Value string `pg:"value"` //评估填写的值
LevelValue string `pg:"level_value"` //评级的值
Rule domain.EvaluationRule `pg:"rule"` //规则
SortBy int `pg:"sort_by"` //评估项顺序
Category string `pg:"category"` //评估项分类
ContentName string `pg:"content_name"` //评估项名称
Weight float64 `pg:"weight"` //权重
CycleId string `pg:"cycle_id"` //周期id
AssessId string `pg:"assess_id"`
EvaluationProjectName string `pg:"evaluation_project_name"` //项目名称
CompanyId string `pg:"company_id"` //公司id
ContentId int `pg:"content_id"` //
TargetUserId string `pg:"target_user_id"` //被评估人的id
TargetUserName string `pg:"target_user_name"` //被评估人的名称
BeginDay string `pg:"begin_day"` //评估的日期
EvaluationProjectId string `pg:"evaluation_project_id"` //项目id
CycleId string `pg:"cycle_id"` //周期id
}
type SearchConditin3 struct {
... ...