作者 tangxvhui

更新

... ... @@ -87,7 +87,8 @@ func (d *TaskAnomalyDao) List1(userId int, companyId int, taskName string, categ
left join t_task_ignore on task_anomaly.task_id=t_task_ignore.task_id
where t_task_ignore.id isnull and task.deleted_at isnull
and task_anomaly.company_id = ?
and task.leader->>'id'='?' `
and task.leader->>'id'='?'
and task_anomaly.is_last=1 `
sqlStr2 := ` with t_task_ignore as (
select task_ignore.id ,task_ignore.task_id
... ... @@ -99,7 +100,8 @@ func (d *TaskAnomalyDao) List1(userId int, companyId int, taskName string, categ
left join t_task_ignore on task_anomaly.task_id=t_task_ignore.task_id
where t_task_ignore.id isnull and task.deleted_at isnull
and task_anomaly.company_id = ?
and task.leader->>'id'='?' `
and task.leader->>'id'='?'
and task_anomaly.is_last=1 `
condition := []interface{}{userId, companyId, userId}
if len(dayTime) > 0 {
... ... @@ -201,7 +203,9 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ
task_anomaly.notice_who,
task_anomaly.created_at
from t_task
join task_anomaly on t_task.task_id= task_anomaly.task_id `
join task_anomaly on t_task.task_id= task_anomaly.task_id
where 1=1 and task_anomaly.is_last=1
`
sqlStr2 := `with
-- 人员自身以及全下级
... ... @@ -246,7 +250,8 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ
)
select count(*) as cnt
from t_task
join task_anomaly on t_task.task_id= task_anomaly.task_id `
join task_anomaly on t_task.task_id= task_anomaly.task_id
where 1=1 and task_anomaly.is_last=1`
condition := []interface{}{userId, userId, companyId, subLevel}
if len(dayTime) > 0 {
condition = append(condition, dayTime)
... ... @@ -322,6 +327,7 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ
and task_anomaly.company_id = ?
and task.related_user@> ?
and task.leader->>'id' <> ?
and task_anomaly.is_last=1
`
sqlStr2 := ` with t_task_ignore as (
... ... @@ -335,7 +341,9 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ
where t_task_ignore.id isnull and task.deleted_at isnull
and task_anomaly.company_id = ?
and task.related_user@> ?
and task.leader->>'id' <> ? `
and task.leader->>'id' <> ?
and task_anomaly.is_last=1
`
condition := []interface{}{userId, companyId, fmt.Sprintf("[%d]", userId), strconv.Itoa(userId)}
if len(dayTime) > 0 {
... ...