|
@@ -3,6 +3,7 @@ package dao |
|
@@ -3,6 +3,7 @@ package dao |
|
3
|
import (
|
3
|
import (
|
|
4
|
"github.com/go-pg/pg/v10"
|
4
|
"github.com/go-pg/pg/v10"
|
|
5
|
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
|
5
|
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
|
|
|
|
6
|
+ "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
6
|
)
|
7
|
)
|
|
7
|
|
8
|
|
|
8
|
type SummaryEvaluationDao struct {
|
9
|
type SummaryEvaluationDao struct {
|
|
@@ -27,7 +28,7 @@ type PersonalCycle struct { |
|
@@ -27,7 +28,7 @@ type PersonalCycle struct { |
|
27
|
// GetExecutorCycleList 获取执行人拥有的周期列表
|
28
|
// GetExecutorCycleList 获取执行人拥有的周期列表
|
|
28
|
// executorId 执行人id
|
29
|
// executorId 执行人id
|
|
29
|
// offset,limit 分页
|
30
|
// offset,limit 分页
|
|
30
|
-func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType int) ([]PersonalCycle, error) {
|
31
|
+func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType domain.EvaluationType) ([]PersonalCycle, error) {
|
|
31
|
sqlStr := `select
|
32
|
sqlStr := `select
|
|
32
|
distinct
|
33
|
distinct
|
|
33
|
summary_evaluation.cycle_id ,
|
34
|
summary_evaluation.cycle_id ,
|
|
@@ -43,7 +44,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
|
@@ -43,7 +44,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
|
43
|
|
44
|
|
|
44
|
if evaluationType > 0 {
|
45
|
if evaluationType > 0 {
|
|
45
|
sqlStr += ` and summary_evaluation."types"=? `
|
46
|
sqlStr += ` and summary_evaluation."types"=? `
|
|
46
|
- condition = append(condition, evaluationType)
|
47
|
+ condition = append(condition, int(evaluationType))
|
|
47
|
}
|
48
|
}
|
|
48
|
|
49
|
|
|
49
|
condition = append(condition, offset, limit)
|
50
|
condition = append(condition, offset, limit)
|
|
@@ -54,7 +55,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
|
@@ -54,7 +55,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
|
54
|
}
|
55
|
}
|
|
55
|
|
56
|
|
|
56
|
// CountExecutorCycleList 统计执行人拥有的周期列表
|
57
|
// CountExecutorCycleList 统计执行人拥有的周期列表
|
|
57
|
-func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType int) (int, error) {
|
58
|
+func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType domain.EvaluationType) (int, error) {
|
|
58
|
sqlStr := `select count(
|
59
|
sqlStr := `select count(
|
|
59
|
distinct summary_evaluation.cycle_id
|
60
|
distinct summary_evaluation.cycle_id
|
|
60
|
) as cnt
|
61
|
) as cnt
|
|
@@ -67,7 +68,7 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation |
|
@@ -67,7 +68,7 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation |
|
67
|
}
|
68
|
}
|
|
68
|
if evaluationType > 0 {
|
69
|
if evaluationType > 0 {
|
|
69
|
sqlStr += ` and summary_evaluation."types"=? `
|
70
|
sqlStr += ` and summary_evaluation."types"=? `
|
|
70
|
- condition = append(condition, evaluationType)
|
71
|
+ condition = append(condition, int(evaluationType))
|
|
71
|
}
|
72
|
}
|
|
72
|
|
73
|
|
|
73
|
var cnt int
|
74
|
var cnt int
|