|
@@ -32,7 +32,10 @@ type ExecutorCycle struct { |
|
@@ -32,7 +32,10 @@ type ExecutorCycle struct { |
32
|
// offset,limit 分页
|
32
|
// offset,limit 分页
|
33
|
func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, isHrbp bool) ([]ExecutorCycle, error) {
|
33
|
func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, isHrbp bool) ([]ExecutorCycle, error) {
|
34
|
sqlStr := `select
|
34
|
sqlStr := `select
|
35
|
- distinct
|
35
|
+ distinct on(
|
|
|
36
|
+ summary_evaluation.cycle_id ,
|
|
|
37
|
+ summary_evaluation.cycle_name)
|
|
|
38
|
+ summary_evaluation.created_at ,
|
36
|
summary_evaluation.cycle_id ,
|
39
|
summary_evaluation.cycle_id ,
|
37
|
summary_evaluation.cycle_name
|
40
|
summary_evaluation.cycle_name
|
38
|
from summary_evaluation
|
41
|
from summary_evaluation
|
|
@@ -46,9 +49,10 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
|
@@ -46,9 +49,10 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
46
|
sqlStr += ` or summary_evaluation."types"=4 `
|
49
|
sqlStr += ` or summary_evaluation."types"=4 `
|
47
|
}
|
50
|
}
|
48
|
condition = append(condition, offset, limit)
|
51
|
condition = append(condition, offset, limit)
|
49
|
- sqlStr += ` order by summary_evaluation.cycle_id desc offset ? limit ? `
|
52
|
+
|
|
|
53
|
+ sqlStr1 := `with t1 as ( ` + sqlStr + ` ) select * from t1 order by t1.created_at desc offset ? limit ? `
|
50
|
result := []ExecutorCycle{}
|
54
|
result := []ExecutorCycle{}
|
51
|
- _, err := tx.Query(&result, sqlStr, condition...)
|
55
|
+ _, err := tx.Query(&result, sqlStr1, condition...)
|
52
|
return result, err
|
56
|
return result, err
|
53
|
}
|
57
|
}
|
54
|
|
58
|
|