|
@@ -132,9 +132,12 @@ func (d *TaskAnomalyDao) List1(userId int, companyId int, taskName string, categ |
|
@@ -132,9 +132,12 @@ func (d *TaskAnomalyDao) List1(userId int, companyId int, taskName string, categ |
132
|
// userId 谁要查看数据
|
132
|
// userId 谁要查看数据
|
133
|
// companyId 公司id
|
133
|
// companyId 公司id
|
134
|
// dayTime 搜索条件日期 ,例:"2006-01-02"
|
134
|
// dayTime 搜索条件日期 ,例:"2006-01-02"
|
|
|
135
|
+// taskName 任务名称
|
|
|
136
|
+// category 异常分类
|
135
|
// pageSize 分页大小
|
137
|
// pageSize 分页大小
|
136
|
// pageNumber 分页页码
|
138
|
// pageNumber 分页页码
|
137
|
-func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, category int, leaderId string, dayTime string, limit int, offset int) (int, []ListTaskAnomaly, error) {
|
139
|
+// subLevel 我的下级的层级
|
|
|
140
|
+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) {
|
138
|
sqlStr1 := `with
|
141
|
sqlStr1 := `with
|
139
|
-- 人员自身以及全下级
|
142
|
-- 人员自身以及全下级
|
140
|
recursive t_user as (
|
143
|
recursive t_user as (
|
|
@@ -172,7 +175,7 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
|
@@ -172,7 +175,7 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
172
|
and t_task_ignore.id isnull
|
175
|
and t_task_ignore.id isnull
|
173
|
and task.deleted_at isnull
|
176
|
and task.deleted_at isnull
|
174
|
and task.leader ->>'id' in (
|
177
|
and task.leader ->>'id' in (
|
175
|
- select t_user.id::text from t_user where t_user."level">0
|
178
|
+ select t_user.id::text from t_user where t_user."level"=?
|
176
|
)
|
179
|
)
|
177
|
)
|
180
|
)
|
178
|
select
|
181
|
select
|
|
@@ -232,7 +235,7 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
|
@@ -232,7 +235,7 @@ func (d *TaskAnomalyDao) List2(userId int, companyId int, taskName string, categ |
232
|
and t_task_ignore.id isnull
|
235
|
and t_task_ignore.id isnull
|
233
|
and task.deleted_at isnull
|
236
|
and task.deleted_at isnull
|
234
|
and task.leader ->>'id' in (
|
237
|
and task.leader ->>'id' in (
|
235
|
- select t_user.id::text from t_user where t_user."level">0
|
238
|
+ select t_user.id::text from t_user where t_user."level"=?
|
236
|
)
|
239
|
)
|
237
|
)
|
240
|
)
|
238
|
select count(*) as cnt
|
241
|
select count(*) as cnt
|