...
|
...
|
@@ -139,7 +139,7 @@ func (d *TaskAnomalyDao) List1(userId int, companyId int, taskName string, categ |
|
|
// pageSize 分页大小
|
|
|
// pageNumber 分页页码
|
|
|
// subLevel 我的下级的层级
|
|
|
func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, category int, leaderId string, dayTime string, subLevel int, limit int, offset int) (int, []ListTaskAnomaly, error) {
|
|
|
func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, category int, leaderId []string, dayTime string, subLevel int, limit int, offset int) (int, []ListTaskAnomaly, error) {
|
|
|
sqlStr1 := `with
|
|
|
-- 人员自身以及全下级
|
|
|
recursive t_user as (
|
...
|
...
|
@@ -232,6 +232,7 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
|
|
task.end_time as "task_end_time",
|
|
|
task.sort_by as "task_sort_by",
|
|
|
task.leader->>'name' as "leader_name",
|
|
|
task.leader ->>'id' as "leader_id"
|
|
|
task.level_name
|
|
|
from task
|
|
|
left join t_task_ignore on task.id=t_task_ignore.task_id
|
...
|
...
|
@@ -261,6 +262,11 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
|
|
sqlStr1 += ` and task_anomaly.category=? `
|
|
|
sqlStr2 += ` and task_anomaly.category=? `
|
|
|
}
|
|
|
if len(leaderId) > 0 {
|
|
|
condition = append(condition, pg.In(leaderId))
|
|
|
sqlStr2 += ` and t_task.leader_id in (?) `
|
|
|
sqlStr1 += ` and t_task.leader_id in (?) `
|
|
|
}
|
|
|
condition = append(condition, limit, offset)
|
|
|
sqlStr1 += ` order by task_anomaly.id desc limit ? offset ? `
|
|
|
|
...
|
...
|
@@ -281,7 +287,7 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
|
|
// dayTime 搜索条件日期 ,例:"2006-01-02"
|
|
|
// pageSize 分页大小
|
|
|
// pageNumber 分页页码
|
|
|
func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, category int, dayTime string, leaderId string, limit int, offset int) (int, []ListTaskAnomaly, error) {
|
|
|
func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, category int, dayTime string, leaderId []string, limit int, offset int) (int, []ListTaskAnomaly, error) {
|
|
|
sqlStr1 := ` with t_task_ignore as (
|
|
|
select task_ignore.id ,task_ignore.task_id
|
|
|
from task_ignore
|
...
|
...
|
@@ -345,9 +351,9 @@ func (d *TaskAnomalyDao) List3(userId int, companyId int, taskName string, categ |
|
|
|
|
|
}
|
|
|
if len(leaderId) > 0 {
|
|
|
condition = append(condition, fmt.Sprintf(`{"id":"%s"}`, leaderId))
|
|
|
sqlStr1 += ` and task.leader@>? `
|
|
|
sqlStr2 += ` and task.leader@>? `
|
|
|
condition = append(condition, pg.In(leaderId))
|
|
|
sqlStr1 += ` and task.leader->>'id' in (?) `
|
|
|
sqlStr2 += ` and task.leader->>'id' in (?) `
|
|
|
}
|
|
|
condition = append(condition, limit, offset)
|
|
|
sqlStr1 += ` order by task_anomaly.id desc limit ? offset ? `
|
...
|
...
|
|