SELECT "c".TASK_LEVEL,
"c".NUMBER2,
"c".SUBORDINATE_SYSTEM,
"c".CONTENT_TASK,
"c".PLANNED_DELIVERABLES,
"c".THOSE_RESPONSIBLE,
"c".COMPLETION_DATE,
"c".REMAINING_DAYS,
"c".ACTUAL_COMPLETION_DATE,
"c".STATE,
"c".LAST_WEEK_STATE,
"c".THIS_WEEK_STATE,
"c".DEPARTMENT,
"c".TASK_PERSON,
"c".TASK_CREATE_DAY,
"c".TASKS_REPORTING_DAY,
"c".TASK_REPLY_ADDED,
"c".FYMONTH,
"c".FDATE,
"c".WEEK
FROM(SELECT
"a".TASK_LEVEL,
"a".NUMBER2,
"a".SUBORDINATE_SYSTEM,
"a".CONTENT_TASK,
"a".PLANNED_DELIVERABLES,
"a".THOSE_RESPONSIBLE,
"a".COMPLETION_DATE,
"a".REMAINING_DAYS,
"a".ACTUAL_COMPLETION_DATE,
"a".STATE,
"a".LAST_WEEK_STATE,
"a".THIS_WEEK_STATE,
"a".DEPARTMENT,
"a".TASK_PERSON,
"a".TASK_CREATE_DAY,
"a".TASKS_REPORTING_DAY,
"a".TASK_REPLY_ADDED,
"b".FYMONTH,
"b".FDATE,
CASE SUBSTR("b".FMWEEK,7,1)
WHEN '1' THEN '第一周'
WHEN '2' THEN '第二周'
WHEN '3' THEN '第三周'
WHEN '4' THEN '第四周'
WHEN '5' THEN '第五周'
ELSE '第六周' END WEEK
FROM
NEW_REPORT.TASK_MAINTENANCE "a" ,
NEW_REPORT.MDM_TIME "b"
WHERE
"a".TASKS_REPORTING_DAY = "b".FDATE)"c"
where 1=1
${if(len(任务级别)==0,"","and 'c'.task_level in ('"+任务级别+"')")}
${if(len(责任人)==0,""," and 'c'.those_responsible like '%"+ 责任人 +"%'")}
${if(len(任务内容)==0,""," and 'c'.content_task like '%"+ 任务内容 +"%'")}
${if(len(计划完成日)==0, ""," and TO_CHAR('c'.COMPLETION_DATE, 'YYYY-MM-DD') = '"+计划完成日+ "'")}
${if(len(任务状态)==0,"","and 'c'.state in ('"+任务状态+"')")}
${if(len(week)==0,"","and 'c'.WEEK in('"+week+"')")}
order by "c".number2