select * from
(
select
task_level ,
content_task ,
planned_deliverables ,
those_responsible ,
completion_date ,
actual_completion_date ,
task_create_day ,
this_week_state ,
remaining_days ,
task_reply_added ,
row_number() over (partition by number2 order by tasks_reporting_day desc) rn
from NEW_REPORT.TASK_MAINTENANCE
) t
where t.rn<=1
${if(len(任务编号)==0,"","and number2 in ('"+任务编号+"')")}
${if(len(责任人)==0,"","and those_responsible in ('"+责任人+"')")}
${if(len(任务内容)==0,""," and content_task like '%"+ 任务内容 +"%'")}