diff --git a/SQL/202512/20251215/report_work_order_statistics.sql b/SQL/202512/20251215/report_work_order_statistics.sql index 8eb2fd3..cac396c 100644 --- a/SQL/202512/20251215/report_work_order_statistics.sql +++ b/SQL/202512/20251215/report_work_order_statistics.sql @@ -1,5 +1,5 @@ delete from "LOWCODE_FRAME"."LOWCODE_REPORT" where "REPORT_CODE" = 'report_work_order_statistics'; -insert into "LOWCODE_FRAME"."LOWCODE_REPORT"("ID", "TENANT_ID", "CREATE_USER", "CREATE_TIME", "CREATE_DEPT", "UPDATE_USER", "UPDATE_TIME", "IS_DELETED", "REPORT_NAME", "REPORT_CODE", "GROUP_REPORT_ID", "JAVA_CONFIG", "DATA_CONFIG", "TABLE_CONFIG", "DATA_SOURCES_CONFIG", "DATA_SOURCES_CODE") values(2000399466478268417, 1, 1, '2025-12-15 10:56:13', 100, 1, '2025-12-15 11:16:28', 0, '工单统计报表', 'report_work_order_statistics', 1960535736475779074, '', 'page,authFalse', 'height,header,menu,index,border', '{"dataOrigin":"1998318491426455554","executeSql":"select\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''day'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE)\r\n and \"GMT_CREATE\" < TRUNC(SYSDATE) + 1\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''month'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''mm'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''mm''), 1)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''year'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''yyyy'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''yyyy''), 12)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}","optionData":{"optionObj":{"select":[],"from":[],"where":[],"groupBy":"","having":"","orderBy":[]},"customSql":"select\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''day'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE)\r\n and \"GMT_CREATE\" < TRUNC(SYSDATE) + 1\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''month'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''mm'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''mm''), 1)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''year'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''yyyy'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''yyyy''), 12)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}","aliasObj":{"lc_power_env_alert_message":"tbl_lpeam"},"typeKey":"custom"}}', 'master'); +insert into "LOWCODE_FRAME"."LOWCODE_REPORT"("ID", "TENANT_ID", "CREATE_USER", "CREATE_TIME", "CREATE_DEPT", "UPDATE_USER", "UPDATE_TIME", "IS_DELETED", "REPORT_NAME", "REPORT_CODE", "GROUP_REPORT_ID", "JAVA_CONFIG", "DATA_CONFIG", "TABLE_CONFIG", "DATA_SOURCES_CONFIG", "DATA_SOURCES_CODE") values(2000399466478268417, 1, 1, '2025-12-15 10:56:13', 100, 1, '2025-12-15 16:10:04', 0, '工单统计报表', 'report_work_order_statistics', 1960535736475779074, '', 'page,authFalse', 'height,header,menu,index,border', '{"dataOrigin":"1998318491426455554","executeSql":"select\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''day'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE)\r\n and \"GMT_CREATE\" < TRUNC(SYSDATE) + 1\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\n and \"TENANT\" = ''1821414781587267584''\r\n and \"CAMPUS_ID\" in (\r\n select\r\n item\r\n from\r\n (\r\n select\r\n REGEXP_SUBSTR(#{campus_id}, ''[^,]+'', 1, LEVEL) as item\r\n from\r\n dual connect by LEVEL <= LENGTH(REGEXP_REPLACE(#{campus_id}, ''[^,]'', '''')) + 1\r\n )\r\n )\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''month'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''mm'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''mm''), 1)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\n and \"TENANT\" = ''1821414781587267584''\r\n and \"CAMPUS_ID\" in (\r\n select\r\n item\r\n from\r\n (\r\n select\r\n REGEXP_SUBSTR(#{campus_id}, ''[^,]+'', 1, LEVEL) as item\r\n from\r\n dual connect by LEVEL <= LENGTH(REGEXP_REPLACE(#{campus_id}, ''[^,]'', '''')) + 1\r\n )\r\n )\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''year'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''yyyy'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''yyyy''), 12)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\n and \"TENANT\" = ''1821414781587267584''\r\n and \"CAMPUS_ID\" in (\r\n select\r\n item\r\n from\r\n (\r\n select\r\n REGEXP_SUBSTR(#{campus_id}, ''[^,]+'', 1, LEVEL) as item\r\n from\r\n dual connect by LEVEL <= LENGTH(REGEXP_REPLACE(#{campus_id}, ''[^,]'', '''')) + 1\r\n )\r\n )","optionData":{"optionObj":{"select":[],"from":[],"where":[],"groupBy":"","having":"","orderBy":[]},"customSql":"select\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''day'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE)\r\n and \"GMT_CREATE\" < TRUNC(SYSDATE) + 1\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\n and \"TENANT\" = ''1821414781587267584''\r\n and \"CAMPUS_ID\" in (\r\n select\r\n item\r\n from\r\n (\r\n select\r\n REGEXP_SUBSTR(#{campus_id}, ''[^,]+'', 1, LEVEL) as item\r\n from\r\n dual connect by LEVEL <= LENGTH(REGEXP_REPLACE(#{campus_id}, ''[^,]'', '''')) + 1\r\n )\r\n )\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''month'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''mm'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''mm''), 1)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\n and \"TENANT\" = ''1821414781587267584''\r\n and \"CAMPUS_ID\" in (\r\n select\r\n item\r\n from\r\n (\r\n select\r\n REGEXP_SUBSTR(#{campus_id}, ''[^,]+'', 1, LEVEL) as item\r\n from\r\n dual connect by LEVEL <= LENGTH(REGEXP_REPLACE(#{campus_id}, ''[^,]'', '''')) + 1\r\n )\r\n )\r\nunion all\r\nselect\r\n count(\r\n case\r\n when \"STATUS\" = ''未处理'' then 1\r\n else null\r\n end\r\n ) as pending,\r\n count(\r\n case\r\n when \"STATUS\" = ''已处理'' then 1\r\n else null\r\n end\r\n ) as processed,\r\n count(\r\n case\r\n when \"STATUS\" = ''已关闭'' then 1\r\n else null\r\n end\r\n ) as closed,\r\n count(\r\n case\r\n when \"STATUS\" not in (''未处理'', ''已处理'', ''已关闭'') then 1\r\n else null\r\n end\r\n ) as processing,\r\n count(*) as total,\r\n ''year'' as cycle\r\nfrom\r\n \"XCAMPUS_WORKORDER\".\"WORK_ORDER\"\r\nwhere\r\n \"GMT_CREATE\" >= TRUNC(SYSDATE, ''yyyy'')\r\n and \"GMT_CREATE\" < ADD_MONTHS(TRUNC(SYSDATE, ''yyyy''), 12)\r\n and \"ORDER_TYPE_PATH_NAME\" = #{workOrderType}\r\n and \"TASK_TYPE\" = #{taskType}\r\n and \"TENANT\" = ''1821414781587267584''\r\n and \"CAMPUS_ID\" in (\r\n select\r\n item\r\n from\r\n (\r\n select\r\n REGEXP_SUBSTR(#{campus_id}, ''[^,]+'', 1, LEVEL) as item\r\n from\r\n dual connect by LEVEL <= LENGTH(REGEXP_REPLACE(#{campus_id}, ''[^,]'', '''')) + 1\r\n )\r\n )","aliasObj":{"lc_power_env_alert_message":"tbl_lpeam"},"typeKey":"custom"}}', 'master'); delete from "LOWCODE_FRAME"."LOWCODE_REPORT_FIELD" where "REPORT_ID" in (select "ID" from "LOWCODE_FRAME"."LOWCODE_REPORT" where "REPORT_CODE" = 'report_work_order_statistics'); insert into "LOWCODE_FRAME"."LOWCODE_REPORT_FIELD"("ID", "TENANT_ID", "CREATE_USER", "CREATE_TIME", "CREATE_DEPT", "UPDATE_USER", "UPDATE_TIME", "IS_DELETED", "REPORT_ID", "FIELD_CODE", "FIELD_NAME", "FIELD_TYPE", "SORT_NUM", "QUERY_IS_DB", "QUERY_IS_WEB", "QUERY_MODE", "DICT_CODE", "IS_EXPORT", "IS_SHOW_SORT", "LABEL_I18N") values(2000399466578931713, 1, 1, '2025-12-15 10:56:13', 100, null, null, 0, 2000399466478268417, 'pending', '未开始', 'Integer', 1, 'Y', 'Y', 'RANGE', '', 'Y', 'Y', 'return { //简体中文 @@ -36,4 +36,4 @@ insert into "LOWCODE_FRAME"."LOWCODE_REPORT_FIELD"("ID", "TENANT_ID", "CREATE_US ''zh-CN'': ''统计周期'', //English ''en'': '''', -}'); \ No newline at end of file +}');