作者 Your Name

Merge branch 'dev-tangxvhui' into test

  1 +package service
  2 +
  3 +import (
  4 + "fmt"
  5 + "strings"
  6 +
  7 + "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
  8 +)
  9 +
  10 +// 员工绩效-综合管理-导出绩效指标
  11 +
  12 +// excel表头部字段
  13 +type headerLevel struct {
  14 + Name string
  15 + Filter map[string]int
  16 + Child []headerLevel
  17 +}
  18 +
  19 +// 添加下一层级的字段
  20 +func (h *headerLevel) addChild(name string) (child *headerLevel) {
  21 + cIndex, ok := h.Filter[name]
  22 + if !ok {
  23 + h.Child = append(h.Child, headerLevel{
  24 + Name: name,
  25 + Filter: map[string]int{},
  26 + Child: []headerLevel{},
  27 + })
  28 + h.Filter[name] = len(h.Child) - 1
  29 + cIndex = h.Filter[name]
  30 + }
  31 + return &h.Child[cIndex]
  32 +}
  33 +
  34 +// 获取表头的所有列表名
  35 +func (h *headerLevel) collectAllColumn(all *[][]string) {
  36 + for _, v := range h.Child {
  37 + v.collectColumn(&v, all, nil)
  38 + }
  39 +}
  40 +
  41 +func (h *headerLevel) collectColumn(child *headerLevel, columns *[][]string, column *[]string) {
  42 + if column == nil {
  43 + column = &[]string{}
  44 + }
  45 + *column = append(*column, h.Name)
  46 + for _, v := range child.Child {
  47 + if len(v.Child) > 0 {
  48 + v.collectColumn(&v, columns, column)
  49 + }
  50 + if len(v.Child) == 0 {
  51 + item := make([]string, len(*column))
  52 + copy(item, *column)
  53 + item = append(item, v.Name)
  54 + *columns = append(*columns, item)
  55 + }
  56 + }
  57 +}
  58 +
  59 +type exportData struct {
  60 + userName []string //员工的名称列表 ,对应excel文件的多个sheet
  61 + usrIdMap map[string]string
  62 + userDayMap map[string][]string //每个员工对应的日期列表 key=员工名称 value= 日期列表
  63 + tableHeader map[string]*headerLevel //每个员工数据表格对应表头 key=员工名称
  64 + data map[string]*strings.Builder //每个员工表头对应的评估填写的数据 key=员工名称+日期+表头
  65 + data2 map[string]string //每个员工评估项的标准描述
  66 + data3 map[string]string //每个员工评估项的标准权重
  67 +}
  68 +
  69 +// 设置表格头部字段。和对应的员工列表
  70 +func (e *exportData) setCategoryNameList(param []dao.ContentCategoryName) {
  71 + for _, v := range param {
  72 + if _, ok := e.usrIdMap[v.TargetUserId]; !ok {
  73 + if _, ok := e.tableHeader[v.TargetUserName]; ok {
  74 + //出现重名,id不同但名称相同
  75 + uname := fmt.Sprintf("%s%d", v.TargetUserName, len(e.usrIdMap))
  76 + e.usrIdMap[v.TargetUserId] = uname
  77 + } else {
  78 + e.usrIdMap[v.TargetUserId] = v.TargetUserName
  79 + }
  80 + e.userName = append(e.userName, e.usrIdMap[v.TargetUserId])
  81 + }
  82 + userName := e.usrIdMap[v.TargetUserId]
  83 + if _, ok := e.tableHeader[userName]; !ok {
  84 + e.tableHeader[userName] = &headerLevel{
  85 + Name: "个人绩效评估等级统计表",
  86 + Filter: map[string]int{},
  87 + Child: []headerLevel{},
  88 + }
  89 + }
  90 + child := e.tableHeader[userName].addChild(v.Category) //第一级,"分类"
  91 + if v.Weight == 0 {
  92 + child = child.addChild("加分项") //第二级 '得分项' '加分项'
  93 + } else {
  94 + child = child.addChild("得分项") //第二级 '得分项' '加分项'
  95 + }
  96 + child.addChild(v.Name) //第三级 评估项名称
  97 + }
  98 +}
  99 +
  100 +func (e *exportData) setData(param []*dao.ExportData2) {
  101 + userName := ""
  102 + key := ""
  103 + userDay := map[string]struct{}{}
  104 + for _, v := range param {
  105 + //员工填写的评估内容
  106 + if _, ok := e.usrIdMap[v.TargetUserId]; !ok {
  107 + continue
  108 + }
  109 + userName = e.usrIdMap[v.TargetUserId]
  110 + if v.Weight == 0 {
  111 + key = fmt.Sprintf("%s-%s-加分项-%s-%s", userName, v.BeginDay, v.Category, v.ContentName)
  112 + e.data3[key] = ""
  113 + } else {
  114 + key = fmt.Sprintf("%s-%s-得分项-%s-%s", userName, v.BeginDay, v.Category, v.ContentName)
  115 + e.data3[key] = fmt.Sprintf("%.2f %%", v.Weight)
  116 + }
  117 + e.data[key] = &strings.Builder{}
  118 + e.data[key].WriteString(v.Value + "\n") //填写的等级
  119 + for _, vv := range v.Remark {
  120 + e.data[key].WriteString(vv.Definition + "\n")
  121 + e.data[key].WriteString(vv.RemarkText + "\n")
  122 + }
  123 + e.data2[key] = v.PromptText
  124 + if _, ok := userDay[userName+v.BeginDay]; !ok {
  125 + userDay[userName+v.BeginDay] = struct{}{}
  126 + e.userDayMap[userName] = append(e.userDayMap[userName], v.BeginDay)
  127 + }
  128 + }
  129 +}
@@ -211,13 +211,6 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs @@ -211,13 +211,6 @@ func (srv StaffAssessServeice) ListUserAssessContentCycleDay(param *query.ListAs
211 return &result, nil 211 return &result, nil
212 } 212 }
213 213
214 -type excelTableHeader struct {  
215 - Level1 string  
216 - Level2 string  
217 - Level3 string  
218 - Level4 string  
219 -}  
220 -  
221 func (srv StaffAssessServeice) ExportUserAssess(param *query.ListAssessContentCycleDay) (*excelize.File, error) { 214 func (srv StaffAssessServeice) ExportUserAssess(param *query.ListAssessContentCycleDay) (*excelize.File, error) {
222 transactionContext, err := factory.CreateTransactionContext(nil) 215 transactionContext, err := factory.CreateTransactionContext(nil)
223 if err != nil { 216 if err != nil {
@@ -590,3 +583,68 @@ func (srv StaffAssessServeice) AnalysisData(param *query.ListAssessContentCycleD @@ -590,3 +583,68 @@ func (srv StaffAssessServeice) AnalysisData(param *query.ListAssessContentCycleD
590 } 583 }
591 return &result, nil 584 return &result, nil
592 } 585 }
  586 +
  587 +func (srv StaffAssessServeice) ExportUserAssess2(param *query.SummaryCommand) (*excelize.File, error) {
  588 + transactionContext, err := factory.CreateTransactionContext(nil)
  589 + if err != nil {
  590 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  591 + }
  592 + if err := transactionContext.StartTransaction(); err != nil {
  593 + return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
  594 + }
  595 + defer func() {
  596 + _ = transactionContext.RollbackTransaction()
  597 + }()
  598 +
  599 + roleRepo := factory.CreateRoleRepository(map[string]interface{}{
  600 + "transactionContext": transactionContext,
  601 + })
  602 + roleUserRepo := factory.CreateRoleUserRepository(map[string]interface{}{
  603 + "transactionContext": transactionContext,
  604 + })
  605 + _, roleList, err := roleRepo.Find(map[string]interface{}{
  606 + "type": domain.RoleTypeSystem,
  607 + "companyId": param.CompanyId,
  608 + })
  609 + if err != nil {
  610 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
  611 + }
  612 + _, userRoleList, err := roleUserRepo.Find(map[string]interface{}{
  613 + "companyId": param.CompanyId,
  614 + "userId": param.OperatorId,
  615 + })
  616 + if err != nil {
  617 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取用户的角色信息列表"+err.Error())
  618 + }
  619 + hrbp := -1
  620 + for _, v := range userRoleList {
  621 + for _, v2 := range roleList {
  622 + if v.RoleId == v2.Id {
  623 + hrbp = 1
  624 + break
  625 + }
  626 + }
  627 + if hrbp == 1 {
  628 + break
  629 + }
  630 + }
  631 + // assessDao := dao.NewStaffAssessDao(map[string]interface{}{
  632 + // "transactionContext": transactionContext,
  633 + // })
  634 + // 获取所有的评估项
  635 + // categoryNameList, err := assessDao.SearchContentCategoryName(param.CompanyId, param.CycleId, param.OperatorId, hrbp)
  636 + // if err != nil {
  637 + // return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  638 + // }
  639 + // categoryNameTree := map[string]headerLevel{}
  640 + // userNameMap := map[string]struct{}{} //处理员工重名
  641 + // userIdMap := map[string]string{} //映射员工id和员工名称
  642 + // userNameList := []string{} //员工名称列表
  643 + if err := transactionContext.CommitTransaction(); err != nil {
  644 + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
  645 + }
  646 +
  647 + // tableHeader := excelTableHeader{}
  648 +
  649 + return nil, nil
  650 +}
  1 +package service
  2 +
  3 +// excel表头部字段
  4 +type excelTableHeader struct {
  5 + Level1 string
  6 + Level2 string
  7 + Level3 string
  8 + Level4 string
  9 +}
@@ -209,7 +209,6 @@ type UserAssessContent struct { @@ -209,7 +209,6 @@ type UserAssessContent struct {
209 209
210 type SearchConditin1 struct { 210 type SearchConditin1 struct {
211 CompanyId int //公司id 211 CompanyId int //公司id
212 - AssessId int //评估任务id  
213 CycleId int //周期id 212 CycleId int //周期id
214 BeginDay string //评估的日期 213 BeginDay string //评估的日期
215 TargetUserName string //被评估人的名称 214 TargetUserName string //被评估人的名称
@@ -289,14 +288,14 @@ func (d *StaffAssessDao) CountUserAssess(param SearchConditin1) (int, error) { @@ -289,14 +288,14 @@ func (d *StaffAssessDao) CountUserAssess(param SearchConditin1) (int, error) {
289 } 288 }
290 289
291 // 生成的sql 根据用户的查看权限 ,获取可查看的评估任务, 290 // 生成的sql 根据用户的查看权限 ,获取可查看的评估任务,
292 -// companyId int 公司id  
293 -// cycleId int, 评估周期id  
294 -// userId int, 用户id,谁要查看数据  
295 -// beginDay string, 周期中执行项目的时间  
296 -// hrbp 是否搜索HRBP角色的用户可以查看,1:是;-1:否  
297 -// limit int, 分页条数  
298 -// offset int 分页偏移  
299 -// assessType string 评估的类型 291 +// companyId int 公司id (必填)
  292 +// cycleId int, 评估周期id (必填)
  293 +// userId int, 用户id,谁要查看数据 (必填)
  294 +// beginDay string, 周期中执行项目的时间 (选填)
  295 +// hrbp 是否搜索HRBP角色的用户可以查看,1:是;-1:否 (必填)
  296 +// limit int, 分页条数 (必填)
  297 +// offset int 分页偏移 (必填)
  298 +// assessType string 评估的类型 (选填)
300 func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, beginDay string, hrbp int, limit int, offset int, assessType string) string { 299 func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, beginDay string, hrbp int, limit int, offset int, assessType string) string {
301 sqlstr := ` 300 sqlstr := `
302 set time zone 'PRC'; 301 set time zone 'PRC';
@@ -340,6 +339,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, @@ -340,6 +339,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int,
340 t_staff_assess_0 as ( 339 t_staff_assess_0 as (
341 select staff_assess.id as assess_id, 340 select staff_assess.id as assess_id,
342 staff_assess.cycle_id, 341 staff_assess.cycle_id,
  342 + staff_assess.cycle_name,
343 staff_assess.target_user->>'userId' as target_user_id, 343 staff_assess.target_user->>'userId' as target_user_id,
344 staff_assess.target_user->>'userName' as target_user_name, 344 staff_assess.target_user->>'userName' as target_user_name,
345 to_char(staff_assess.begin_time,'YYYY-MM-DD') as begin_day, 345 to_char(staff_assess.begin_time,'YYYY-MM-DD') as begin_day,
@@ -348,8 +348,8 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, @@ -348,8 +348,8 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int,
348 join staff_assess_task on staff_assess.staff_assess_task_id = staff_assess_task.id 348 join staff_assess_task on staff_assess.staff_assess_task_id = staff_assess_task.id
349 and staff_assess_task.deleted_at isnull 349 and staff_assess_task.deleted_at isnull
350 where staff_assess.cycle_id = %d 350 where staff_assess.cycle_id = %d
351 - and to_char(staff_assess.begin_time,'YYYY-MM-DD')='%s'  
352 - and staff_assess."types" ='%s' 351 + %s
  352 + -- 根据条件拼接查询条件
353 ), 353 ),
354 -- 根据查看权限过滤合并数据 354 -- 根据查看权限过滤合并数据
355 t_staff_assess_1 as ( 355 t_staff_assess_1 as (
@@ -357,6 +357,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, @@ -357,6 +357,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int,
357 t_staff_assess_0.target_user_id, 357 t_staff_assess_0.target_user_id,
358 t_staff_assess_0.target_user_name, 358 t_staff_assess_0.target_user_name,
359 t_staff_assess_0.begin_day, 359 t_staff_assess_0.begin_day,
  360 + t_staff_assess_0.cycle_name,
360 t_staff_assess_0.cycle_id 361 t_staff_assess_0.cycle_id
361 from t_staff_assess_0 362 from t_staff_assess_0
362 join t_project_3 on t_staff_assess_0.evaluation_project_id = t_project_3.project_id 363 join t_project_3 on t_staff_assess_0.evaluation_project_id = t_project_3.project_id
@@ -364,6 +365,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, @@ -364,6 +365,7 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int,
364 t_staff_assess_0.target_user_id, 365 t_staff_assess_0.target_user_id,
365 t_staff_assess_0.target_user_name, 366 t_staff_assess_0.target_user_name,
366 t_staff_assess_0.begin_day, 367 t_staff_assess_0.begin_day,
  368 + t_staff_assess_0.cycle_name,
367 t_staff_assess_0.cycle_id 369 t_staff_assess_0.cycle_id
368 from t_staff_assess_0 370 from t_staff_assess_0
369 join t_user_1 on t_staff_assess_0.target_user_id=t_user_1.user_id 371 join t_user_1 on t_staff_assess_0.target_user_id=t_user_1.user_id
@@ -371,10 +373,25 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int, @@ -371,10 +373,25 @@ func (d *StaffAssessDao) useTStaffAssess(companyId int, cycleId int, userId int,
371 limit %d offset %d 373 limit %d offset %d
372 ) 374 )
373 ` 375 `
  376 + //根据条件拼接查询条件
  377 + staffAssessWhere := map[string]string{
  378 + "beginDay": ` and to_char(staff_assess.begin_time,'YYYY-MM-DD') like '%s' `,
  379 + "assessType": ` and staff_assess."types" ='%s' `,
  380 + }
374 params := []interface{}{ 381 params := []interface{}{
375 - companyId, userId, cycleId, hrbp, cycleId, userId, cycleId, beginDay, assessType, limit, offset, 382 + companyId, userId, cycleId, hrbp, cycleId, userId, cycleId,
376 } 383 }
377 384
  385 + if len(beginDay) > 0 {
  386 + str := fmt.Sprintf(staffAssessWhere["beginDay"]+"\n", beginDay)
  387 + params = append(params, str)
  388 + }
  389 +
  390 + if len(assessType) > 0 {
  391 + str := fmt.Sprintf(staffAssessWhere["assessType"]+"\n", assessType)
  392 + params = append(params, str)
  393 + }
  394 + params = append(params, limit, offset)
378 sqlstr = fmt.Sprintf(sqlstr, params...) 395 sqlstr = fmt.Sprintf(sqlstr, params...)
379 return sqlstr 396 return sqlstr
380 } 397 }
@@ -781,6 +798,8 @@ func (d *StaffAssessDao) MemberPerformanceIndicator(likeUserName string, company @@ -781,6 +798,8 @@ func (d *StaffAssessDao) MemberPerformanceIndicator(likeUserName string, company
781 type ExportData1 struct { 798 type ExportData1 struct {
782 AssessId string 799 AssessId string
783 ContentId int 800 ContentId int
  801 + CycleId string //周期id
  802 + CycleName string //周期名称
784 TargetUserId string //被评估人的id 803 TargetUserId string //被评估人的id
785 TargetUserName string //被评估人的名称 804 TargetUserName string //被评估人的名称
786 BeginDay string //评估的日期 805 BeginDay string //评估的日期
@@ -803,11 +822,20 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa @@ -803,11 +822,20 @@ func (d *StaffAssessDao) ExportDataUserAssess(param SearchConditin1) ([]ExportDa
803 param.Limit = 5000 822 param.Limit = 5000
804 } 823 }
805 sqlStr := ` select 824 sqlStr := ` select
806 - t_staff_assess_1.target_user_id,t_staff_assess_1.target_user_name,t_staff_assess_1.begin_day,  
807 - t_staff_assess_1.assess_id,staff_assess_content.id as content_id,  
808 - staff_assess_content.value ,staff_assess_content.sort_by ,  
809 - staff_assess_content.category ,staff_assess_content."name" as content_name ,  
810 - staff_assess_content.weight,staff_assess_content.prompt_text ,staff_assess_content.remark 825 + t_staff_assess_1.target_user_id,
  826 + t_staff_assess_1.target_user_name,
  827 + t_staff_assess_1.begin_day,
  828 + t_staff_assess_1.assess_id,
  829 + t_staff_assess_1.cycle_id,
  830 + t_staff_assess_1.cycle_name,
  831 + staff_assess_content.id as content_id,
  832 + staff_assess_content.value ,
  833 + staff_assess_content.sort_by ,
  834 + staff_assess_content.category ,
  835 + staff_assess_content."name" as content_name ,
  836 + staff_assess_content.weight,
  837 + staff_assess_content.prompt_text ,
  838 + staff_assess_content.remark
811 from t_staff_assess_1 839 from t_staff_assess_1
812 left join staff_assess_content on t_staff_assess_1.assess_id = staff_assess_content.staff_assess_id 840 left join staff_assess_content on t_staff_assess_1.assess_id = staff_assess_content.staff_assess_id
813 where 1=1 841 where 1=1
@@ -890,3 +918,99 @@ func (d *StaffAssessDao) CountAssessCycleMe(executorId int, companyId int) (int, @@ -890,3 +918,99 @@ func (d *StaffAssessDao) CountAssessCycleMe(executorId int, companyId int) (int,
890 _, err := tx.QueryOne(pg.Scan(&result), sqlStr, condition...) 918 _, err := tx.QueryOne(pg.Scan(&result), sqlStr, condition...)
891 return result, err 919 return result, err
892 } 920 }
  921 +
  922 +// 评估的指标
  923 +type ContentCategoryName struct {
  924 + Category string //指标分类
  925 + Name string //指标名称
  926 + Weight float64 //指标权重
  927 + CycleId string //周期id
  928 + CycleName string //周期名称
  929 + TargetUserId string //评估的目标员工id
  930 + TargetUserName string //评估的目标员工名称
  931 + Cnt int //排序
  932 +}
  933 +
  934 +// 员工绩效-综合管理-导出绩效指标
  935 +// 抽取出评估的指标
  936 +func (d *StaffAssessDao) SearchContentCategoryName(companyId int, cycleId int, userId int, hrbp int) ([]ContentCategoryName, error) {
  937 + sqlStr := `
  938 + select
  939 + staff_assess_content.category,
  940 + staff_assess_content."name" ,
  941 + staff_assess_content.weight ,
  942 + staff_assess.cycle_id ,
  943 + staff_assess.cycle_name,
  944 + t_staff_assess_1.target_user_id,
  945 + t_staff_assess_1.target_user_name,
  946 + sum(
  947 + case
  948 + when staff_assess_content.value isnull then 0
  949 + when staff_assess_content.value='' then 0
  950 + ELSE 1
  951 + END) as cnt
  952 + from staff_assess_content
  953 + join t_staff_assess_1 on staff_assess_content.staff_assess_id = t_staff_assess_1.id
  954 + group by staff_assess_content.category,
  955 + staff_assess_content."name" ,
  956 + staff_assess.cycle_id ,
  957 + staff_assess.cycle_name,
  958 + staff_assess_content.weight ,
  959 + target_user_id,target_user_name
  960 + order by cnt desc,user_id
  961 + `
  962 + sqlStr0 := d.useTStaffAssess(companyId, cycleId, userId, "", hrbp, 0, 5000, string(domain.AssessSelf))
  963 + sqlStr = sqlStr0 + sqlStr
  964 + tx := d.transactionContext.PgTx
  965 + result := []ContentCategoryName{}
  966 + _, err := tx.Query(&result, sqlStr)
  967 + return result, err
  968 +}
  969 +
  970 +type ExportData2 struct {
  971 + CycleId string `pg:"cycle_id"` //周期id
  972 + CycleName string `pg:"cycle_name"` //周期名称
  973 + TargetUserId string `pg:"target_user_id"` //被评估人的id
  974 + TargetUserName string `pg:"target_user_name"` //被评估人的名称
  975 + BeginDay string `pg:"begin_day"` //评估的日期
  976 + Value string `pg:"value"` //评估填写的值
  977 + Category string `pg:"category"` //评估项分类
  978 + ContentName string `pg:"content_name"` //评估项名称
  979 + Weight float64 `pg:"weight"` //权重
  980 + PromptText string `pg:"prompt_text"` //评估标准
  981 + Remark []domain.AssessContemtRemark `pg:"remark"`
  982 +}
  983 +
  984 +// 员工绩效-综合管理-导出绩效指标
  985 +// companyId int 公司id
  986 +// cycleId int, 评估周期id
  987 +// userId int, 用户id,谁要查看数据
  988 +// hrbp 是否搜索HRBP角色的用户可以查看,1:是;-1:否
  989 +func (d *StaffAssessDao) ExportDataUserAssess2(companyId int, cycleId int, operaterId int, hrbp int) ([]*ExportData2, error) {
  990 + sqlStr := ` select
  991 + t_staff_assess_1.target_user_id,
  992 + t_staff_assess_1.target_user_name,
  993 + t_staff_assess_1.begin_day,
  994 + t_staff_assess_1.cycle_id,
  995 + t_staff_assess_1.cycle_name,
  996 + staff_assess_content.value ,
  997 + staff_assess_content.category ,
  998 + staff_assess_content."name" as content_name ,
  999 + staff_assess_content.weight,
  1000 + staff_assess_content.prompt_text ,
  1001 + staff_assess_content.remark
  1002 + from t_staff_assess_1
  1003 + left join staff_assess_content on t_staff_assess_1.assess_id = staff_assess_content.staff_assess_id
  1004 + where 1=1
  1005 + `
  1006 + condition := []interface{}{}
  1007 + //加入排序
  1008 + sqlStr += ` order by t_staff_assess_1.begin_day`
  1009 + //获取前置sql语句
  1010 + sqlStr0 := d.useTStaffAssess(companyId, cycleId, operaterId, "", hrbp, 5000, 0, string(domain.AssessSelf))
  1011 + sqlStr = sqlStr0 + sqlStr
  1012 + tx := d.transactionContext.PgTx
  1013 + result := []*ExportData2{}
  1014 + _, err := tx.Query(&result, sqlStr, condition...)
  1015 + return result, err
  1016 +}