...
|
...
|
@@ -3,6 +3,7 @@ package dao |
|
|
import (
|
|
|
"github.com/go-pg/pg/v10"
|
|
|
pgTransaction "github.com/linmadan/egglib-go/transaction/pg"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
|
|
)
|
|
|
|
|
|
type SummaryEvaluationDao struct {
|
...
|
...
|
@@ -27,7 +28,7 @@ type PersonalCycle struct { |
|
|
// GetExecutorCycleList 获取执行人拥有的周期列表
|
|
|
// executorId 执行人id
|
|
|
// offset,limit 分页
|
|
|
func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType int) ([]PersonalCycle, error) {
|
|
|
func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, limit int, evaluationType domain.EvaluationType) ([]PersonalCycle, error) {
|
|
|
sqlStr := `select
|
|
|
distinct
|
|
|
summary_evaluation.cycle_id ,
|
...
|
...
|
@@ -43,7 +44,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
|
|
|
|
|
if evaluationType > 0 {
|
|
|
sqlStr += ` and summary_evaluation."types"=? `
|
|
|
condition = append(condition, evaluationType)
|
|
|
condition = append(condition, int(evaluationType))
|
|
|
}
|
|
|
|
|
|
condition = append(condition, offset, limit)
|
...
|
...
|
@@ -54,7 +55,7 @@ func (d *SummaryEvaluationDao) GetExecutorCycleList(executorId int, offset int, |
|
|
}
|
|
|
|
|
|
// CountExecutorCycleList 统计执行人拥有的周期列表
|
|
|
func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType int) (int, error) {
|
|
|
func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluationType domain.EvaluationType) (int, error) {
|
|
|
sqlStr := `select count(
|
|
|
distinct summary_evaluation.cycle_id
|
|
|
) as cnt
|
...
|
...
|
@@ -67,7 +68,7 @@ func (d *SummaryEvaluationDao) CountExecutorCycleList(executorId int, evaluation |
|
|
}
|
|
|
if evaluationType > 0 {
|
|
|
sqlStr += ` and summary_evaluation."types"=? `
|
|
|
condition = append(condition, evaluationType)
|
|
|
condition = append(condition, int(evaluationType))
|
|
|
}
|
|
|
|
|
|
var cnt int
|
...
|
...
|
|