|
|
|
@ -2,26 +2,25 @@
|
|
|
|
|
-- 获取任务列表
|
|
|
|
|
#sql("getJobList")
|
|
|
|
|
select t1.*,
|
|
|
|
|
#if(self)
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (2311)) as finish_count,
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (2310,2311)) as total_count,
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (0)) as forward_count, --转发数量
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (0)) as forward_finish_count, --转发完成数量
|
|
|
|
|
#end
|
|
|
|
|
#if(next)
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1111,1211,2311)) as finish_count,
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1110,1111,1210,1211,2310,2311)) as total_count,
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1120,1121,1122,2120,2121,2122)) as forward_count, --转发数量
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1122,2122)) as forward_finish_count, --转发完成数量
|
|
|
|
|
#end
|
|
|
|
|
|
|
|
|
|
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id and t2.is_check=1) as already_check_sheet,
|
|
|
|
|
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id) as all_sheet
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1111,1211,2311)) as finish_count,
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1110,1111,1210,1211,2310,2311)) as total_count,
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1120,1121,1122,2120,2121,2122)) as forward_count, --转发数量
|
|
|
|
|
(select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id and t2.status_code in (1122,2122)) as forward_finish_count, --转发完成数量
|
|
|
|
|
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id and t2.is_check=1) as already_check_sheet,
|
|
|
|
|
(select count(1) from t_collect_job_sheet as t2 where t2.job_id=t1.job_id) as all_sheet
|
|
|
|
|
from t_collect_job as t1
|
|
|
|
|
where t1.publish_role_id = #para(publish_role_id) and t1.bureau_id=#para(bureau_id)
|
|
|
|
|
#if(job_name)
|
|
|
|
|
and t1.job_name like #para(job_name, "like")
|
|
|
|
|
#end
|
|
|
|
|
#if(self)
|
|
|
|
|
and (select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id
|
|
|
|
|
and t2.bureau_id=t2.target_id)>0
|
|
|
|
|
#end
|
|
|
|
|
#if(next)
|
|
|
|
|
and (select count(1) from t_collect_job_target as t2 where t2.job_id=t1.job_id
|
|
|
|
|
and t2.bureau_id=t2.target_id)=0
|
|
|
|
|
#end
|
|
|
|
|
order by t1.job_id desc
|
|
|
|
|
#end
|
|
|
|
|
|
|
|
|
|