作者 tangxvhui

调整 sql 查询结果

... ... @@ -262,8 +262,6 @@ func (srv StaffAssessServeice) CreateStaffAssessTask(transactionContext applicat
}
}
//处理生成的项目评估
return map[string]interface{}{
"assessTaskId": assessTaskData.Id,
}, nil
... ...
... ... @@ -1264,8 +1264,10 @@ func (d *StaffAssessDao) SearchExecutorAssessBeforeNow(executorId int, companyId
to_char(staff_assess.end_time at time zone 'PRC','YYYY-MM-DD HH24:MI:SS') as end_time,
to_char(staff_assess.begin_time at time zone 'PRC','YYYY-MM-DD HH24:MI:SS') as begin_time
from staff_assess
join staff_assess_task on staff_assess.staff_assess_task_id = staff_assess_task.id
WHERE staff_assess.company_id=?
and staff_assess.deleted_at isnull
and staff_assess_task.deleted_at isnull
and (
staff_assess.end_time < now() or staff_assess.status ='completed'
)
... ... @@ -1282,11 +1284,13 @@ func (d *StaffAssessDao) SearchExecutorAssessBeforeNow(executorId int, companyId
distinct (staff_assess.cycle_id ,to_char(staff_assess.begin_time at time zone 'PRC','YYYY-MM-DD'))
) as cnt
from staff_assess
join staff_assess_task on staff_assess.staff_assess_task_id = staff_assess_task.id
WHERE staff_assess.company_id=?
and staff_assess.deleted_at isnull
and (
staff_assess.end_time < now() or staff_assess.status ='completed'
)
and staff_assess_task.deleted_at isnull
and staff_assess.executor ->> 'userId'='?'
`
condition2 := []interface{}{
... ... @@ -1317,11 +1321,13 @@ func (d *StaffAssessDao) SearchExecutorAssessAfterNow(executorId int, companyId
to_char(staff_assess.end_time at time zone 'PRC','YYYY-MM-DD HH24:MI:SS') as end_time,
to_char(staff_assess.begin_time at time zone 'PRC','YYYY-MM-DD HH24:MI:SS') as begin_time
from staff_assess
join staff_assess_task on staff_assess.staff_assess_task_id = staff_assess_task.id
WHERE staff_assess.company_id=?
and staff_assess.deleted_at isnull
and (
staff_assess.end_time >= now() and staff_assess.status ='uncompleted'
)
and staff_assess_task.deleted_at isnull
and staff_assess.executor ->> 'userId'='?'
order by begin_day`
condition1 := []interface{}{
... ...