...
|
...
|
@@ -108,6 +108,17 @@ func (d *TaskAnomalyDao) List1(userId int, companyId int, taskName string, categ |
|
|
condition = append(condition, dayTime)
|
|
|
sqlStr2 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
sqlStr1 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
switch category {
|
|
|
case domain.AnomalyCategoryType1:
|
|
|
sqlStr2 += " and task_anomaly.warn_flag=1 "
|
|
|
sqlStr1 += " and task_anomaly.warn_flag=1 "
|
|
|
case domain.AnomalyCategoryType2:
|
|
|
sqlStr2 += " and task_anomaly.assess_flag=1 "
|
|
|
sqlStr1 += " and task_anomaly.assess_flag=1 "
|
|
|
// case domain.AnomalyCategoryType3:
|
|
|
// sqlStr2 += " and task_anomaly.assist_flag=1 "
|
|
|
// sqlStr1 += " and task_anomaly.assist_flag=1 "
|
|
|
}
|
|
|
}
|
|
|
if len(taskName) > 0 {
|
|
|
condition = append(condition, "%"+taskName+"%")
|
...
|
...
|
@@ -253,11 +264,7 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
|
|
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)
|
|
|
sqlStr2 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
sqlStr1 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
}
|
|
|
|
|
|
if len(taskName) > 0 {
|
|
|
condition = append(condition, "%"+taskName+"%")
|
|
|
sqlStr2 += ` and t_task.task_alias like ? `
|
...
|
...
|
@@ -268,6 +275,22 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
|
|
sqlStr1 += ` and task_anomaly.category=? `
|
|
|
sqlStr2 += ` and task_anomaly.category=? `
|
|
|
}
|
|
|
if len(dayTime) > 0 {
|
|
|
condition = append(condition, dayTime)
|
|
|
sqlStr2 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
sqlStr1 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
switch category {
|
|
|
case domain.AnomalyCategoryType1:
|
|
|
sqlStr2 += " and task_anomaly.warn_flag=1 "
|
|
|
sqlStr1 += " and task_anomaly.warn_flag=1 "
|
|
|
case domain.AnomalyCategoryType2:
|
|
|
sqlStr2 += " and task_anomaly.assess_flag=1 "
|
|
|
sqlStr1 += " and task_anomaly.assess_flag=1 "
|
|
|
// case domain.AnomalyCategoryType3:
|
|
|
// sqlStr2 += " and task_anomaly.assist_flag=1 "
|
|
|
// sqlStr1 += " and task_anomaly.assist_flag=1 "
|
|
|
}
|
|
|
}
|
|
|
if len(leaderId) > 0 {
|
|
|
condition = append(condition, pg.In(leaderId))
|
|
|
sqlStr2 += ` and t_task.leader_id in (?) `
|
...
|
...
|
@@ -350,6 +373,17 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ |
|
|
condition = append(condition, dayTime)
|
|
|
sqlStr2 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
sqlStr1 += ` and to_char(task_anomaly.created_at,'yyyy-MM-dd') =? `
|
|
|
switch category {
|
|
|
case domain.AnomalyCategoryType1:
|
|
|
sqlStr2 += " and task_anomaly.warn_flag=1 "
|
|
|
sqlStr1 += " and task_anomaly.warn_flag=1 "
|
|
|
case domain.AnomalyCategoryType2:
|
|
|
sqlStr2 += " and task_anomaly.assess_flag=1 "
|
|
|
sqlStr1 += " and task_anomaly.assess_flag=1 "
|
|
|
// case domain.AnomalyCategoryType3:
|
|
|
// sqlStr2 += " and task_anomaly.assist_flag=1 "
|
|
|
// sqlStr1 += " and task_anomaly.assist_flag=1 "
|
|
|
}
|
|
|
}
|
|
|
if len(taskName) > 0 {
|
|
|
condition = append(condition, "%"+taskName+"%")
|
...
|
...
|
@@ -443,7 +477,7 @@ func (d TaskAnomalyDao) SearchForUser(userId int, companyId int, taskName string |
|
|
task_anomaly.created_at
|
|
|
from t_task
|
|
|
join task_anomaly on t_task.task_id= task_anomaly.task_id
|
|
|
where t_task.task_alias like ?`
|
|
|
where t_task.task_alias like ? and task_anomaly.is_last=1 `
|
|
|
condition := []interface{}{userId, userId, companyId, fmt.Sprintf("[%d]", userId)}
|
|
|
condition = append(condition, "%"+taskName+"%")
|
|
|
result := []ListTaskAnomaly{}
|
...
|
...
|
|