...
|
...
|
@@ -440,7 +440,7 @@ type CycleAndProjectItem struct { |
|
|
}
|
|
|
|
|
|
// 获取某个人的自评的周期和项目
|
|
|
func (d *StaffAssessDao) ListCycleAndProject(userId int, companyId int, offset int, limit int) (result []CycleAndProjectItem, err error) {
|
|
|
func (d *StaffAssessDao) ListCycleAndProject(userId int, companyId int, cycleId int, offset int, limit int) (result []CycleAndProjectItem, err error) {
|
|
|
sqlStr := `select
|
|
|
distinct
|
|
|
staff_assess.cycle_id ,
|
...
|
...
|
@@ -453,10 +453,17 @@ func (d *StaffAssessDao) ListCycleAndProject(userId int, companyId int, offset i |
|
|
and company_id=?
|
|
|
and target_user->>'userId'=?
|
|
|
and "types"='self'
|
|
|
order by cycle_id desc
|
|
|
limit ? offset ? `
|
|
|
`
|
|
|
|
|
|
condition := []interface{}{companyId, strconv.Itoa(userId)}
|
|
|
if cycleId > 0 {
|
|
|
condition = append(condition, cycleId)
|
|
|
sqlStr += ` and cycle_id=? `
|
|
|
}
|
|
|
condition = append(condition, limit, offset)
|
|
|
sqlStr += ` order by cycle_id desc limit ? offset ? `
|
|
|
|
|
|
tx := d.transactionContext.PgTx
|
|
|
condition := []interface{}{companyId, strconv.Itoa(userId), limit, offset}
|
|
|
_, err = tx.Query(&result, sqlStr, condition...)
|
|
|
return result, err
|
|
|
} |
...
|
...
|
|