select
t.number2 任务编号,
t.task_level 任务级别,
t.Subordinate_system 所属体系,
t.department 所属部门,
t.content_task 任务内容,
t.planned_deliverables 拟交付物,
t.those_responsible 责任人,
t.completion_date 计划完成时间,
t.task_create_day 任务下达时间,
t.task_person 任务指派人,
t.task_reply_added 任务回复新增人,
t.tasks_reporting_day 上报任务时间,
t.tasks_reporting_day1 上报任务时间时分秒
from (
SELECT
number2,
task_level,
Subordinate_system,
department,
content_task,
planned_deliverables ,
those_responsible,
completion_date,
task_create_day,
task_person,
task_reply_added,
tasks_reporting_day,
tasks_reporting_day1,
row_number() over (partition by number2 order by tasks_reporting_day1 desc) rn
FROM "NEW_REPORT"."TASK_MAINTENANCE1"
) t
where t.rn<=1
${if(len(任务级别)==0,"","and t.task_level in ('"+任务级别+"')")}