Jelajahi Sumber

修改完成情况统计字段

zx 1 bulan lalu
induk
melakukan
2789c5edba

+ 78 - 78
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmStopTargeMapper.xml

@@ -388,94 +388,94 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN
         (
         select substr(duty_dept_no,2,12) org_no ,
-        SUM(poweroff_duration_tm) stop_total_actual,
-        SUM(IF(poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241'),poweroff_duration_tm,0)) as plan_stop_total_actual,
-        SUM(IF(poweroff_nature_cd in('1101','1202'),poweroff_duration_tm,0)) as error_stop_total_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='01',poweroff_duration_tm,0)) as stop_month_01_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='02',poweroff_duration_tm,0)) as stop_month_02_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='03',poweroff_duration_tm,0)) as stop_month_03_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='04',poweroff_duration_tm,0)) as stop_month_04_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='05',poweroff_duration_tm,0)) as stop_month_05_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='06',poweroff_duration_tm,0)) as stop_month_06_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='07',poweroff_duration_tm,0)) as stop_month_07_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='08',poweroff_duration_tm,0)) as stop_month_08_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='09',poweroff_duration_tm,0)) as stop_month_09_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='10',poweroff_duration_tm,0)) as stop_month_10_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='11',poweroff_duration_tm,0)) as stop_month_11_actual,
-        SUM(IF(SUBSTRING(data_dt,5,2)='12',poweroff_duration_tm,0)) as stop_month_12_actual,
+        SUM(hour_num) stop_total_actual,
+        SUM(IF(poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241'),hour_num,0)) as plan_stop_total_actual,
+        SUM(IF(poweroff_nature_cd in('1101','1202'),hour_num,0)) as error_stop_total_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='01',hour_num,0)) as stop_month_01_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='02',hour_num,0)) as stop_month_02_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='03',hour_num,0)) as stop_month_03_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='04',hour_num,0)) as stop_month_04_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='05',hour_num,0)) as stop_month_05_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='06',hour_num,0)) as stop_month_06_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='07',hour_num,0)) as stop_month_07_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='08',hour_num,0)) as stop_month_08_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='09',hour_num,0)) as stop_month_09_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='10',hour_num,0)) as stop_month_10_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='11',hour_num,0)) as stop_month_11_actual,
+        SUM(IF(SUBSTRING(data_dt,5,2)='12',hour_num,0)) as stop_month_12_actual,
 
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='01'),poweroff_duration_tm,0)) as plan_stop_month_01_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='02'),poweroff_duration_tm,0)) as plan_stop_month_02_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='03'),poweroff_duration_tm,0)) as plan_stop_month_03_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='04'),poweroff_duration_tm,0)) as plan_stop_month_04_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='05'),poweroff_duration_tm,0)) as plan_stop_month_05_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='06'),poweroff_duration_tm,0)) as plan_stop_month_06_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='07'),poweroff_duration_tm,0)) as plan_stop_month_07_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='08'),poweroff_duration_tm,0)) as plan_stop_month_08_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='09'),poweroff_duration_tm,0)) as plan_stop_month_09_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='10'),poweroff_duration_tm,0)) as plan_stop_month_10_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='11'),poweroff_duration_tm,0)) as plan_stop_month_11_actual,
-        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='12'),poweroff_duration_tm,0)) as plan_stop_month_12_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='01'),hour_num,0)) as plan_stop_month_01_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='02'),hour_num,0)) as plan_stop_month_02_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='03'),hour_num,0)) as plan_stop_month_03_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='04'),hour_num,0)) as plan_stop_month_04_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='05'),hour_num,0)) as plan_stop_month_05_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='06'),hour_num,0)) as plan_stop_month_06_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='07'),hour_num,0)) as plan_stop_month_07_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='08'),hour_num,0)) as plan_stop_month_08_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='09'),hour_num,0)) as plan_stop_month_09_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='10'),hour_num,0)) as plan_stop_month_10_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='11'),hour_num,0)) as plan_stop_month_11_actual,
+        SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='12'),hour_num,0)) as plan_stop_month_12_actual,
 
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='01'),poweroff_duration_tm,0)) as error_stop_month_01_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='02'),poweroff_duration_tm,0)) as error_stop_month_02_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='03'),poweroff_duration_tm,0)) as error_stop_month_03_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='04'),poweroff_duration_tm,0)) as error_stop_month_04_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='05'),poweroff_duration_tm,0)) as error_stop_month_05_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='06'),poweroff_duration_tm,0)) as error_stop_month_06_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='07'),poweroff_duration_tm,0)) as error_stop_month_07_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='08'),poweroff_duration_tm,0)) as error_stop_month_08_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='09'),poweroff_duration_tm,0)) as error_stop_month_09_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='10'),poweroff_duration_tm,0)) as error_stop_month_10_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='11'),poweroff_duration_tm,0)) as error_stop_month_11_actual,
-        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='12'),poweroff_duration_tm,0)) as error_stop_month_12_actual
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='01'),hour_num,0)) as error_stop_month_01_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='02'),hour_num,0)) as error_stop_month_02_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='03'),hour_num,0)) as error_stop_month_03_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='04'),hour_num,0)) as error_stop_month_04_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='05'),hour_num,0)) as error_stop_month_05_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='06'),hour_num,0)) as error_stop_month_06_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='07'),hour_num,0)) as error_stop_month_07_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='08'),hour_num,0)) as error_stop_month_08_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='09'),hour_num,0)) as error_stop_month_09_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='10'),hour_num,0)) as error_stop_month_10_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='11'),hour_num,0)) as error_stop_month_11_actual,
+        SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='12'),hour_num,0)) as error_stop_month_12_actual
         from ads_cst_hygszdbb_pdmstoprecords_df
         where SUBSTRING(data_dt,1,4) = #{reportYear}
         GROUP BY substr(duty_dept_no,2,12)
 
         UNION ALL
         select '888' org_no ,
-       SUM(poweroff_duration_tm) stop_total_actual,
-       SUM(IF(poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241'),poweroff_duration_tm,0)) as plan_stop_total_actual,
-       SUM(IF(poweroff_nature_cd in('1101','1202'),poweroff_duration_tm,0)) as error_stop_total_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='01',poweroff_duration_tm,0)) as stop_month_01_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='02',poweroff_duration_tm,0)) as stop_month_02_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='03',poweroff_duration_tm,0)) as stop_month_03_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='04',poweroff_duration_tm,0)) as stop_month_04_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='05',poweroff_duration_tm,0)) as stop_month_05_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='06',poweroff_duration_tm,0)) as stop_month_06_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='07',poweroff_duration_tm,0)) as stop_month_07_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='08',poweroff_duration_tm,0)) as stop_month_08_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='09',poweroff_duration_tm,0)) as stop_month_09_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='10',poweroff_duration_tm,0)) as stop_month_10_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='11',poweroff_duration_tm,0)) as stop_month_11_actual,
-       SUM(IF(SUBSTRING(data_dt,5,2)='12',poweroff_duration_tm,0)) as stop_month_12_actual,
+       SUM(hour_num) stop_total_actual,
+       SUM(IF(poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241'),hour_num,0)) as plan_stop_total_actual,
+       SUM(IF(poweroff_nature_cd in('1101','1202'),hour_num,0)) as error_stop_total_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='01',hour_num,0)) as stop_month_01_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='02',hour_num,0)) as stop_month_02_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='03',hour_num,0)) as stop_month_03_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='04',hour_num,0)) as stop_month_04_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='05',hour_num,0)) as stop_month_05_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='06',hour_num,0)) as stop_month_06_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='07',hour_num,0)) as stop_month_07_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='08',hour_num,0)) as stop_month_08_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='09',hour_num,0)) as stop_month_09_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='10',hour_num,0)) as stop_month_10_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='11',hour_num,0)) as stop_month_11_actual,
+       SUM(IF(SUBSTRING(data_dt,5,2)='12',hour_num,0)) as stop_month_12_actual,
 
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='01'),poweroff_duration_tm,0)) as plan_stop_month_01_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='02'),poweroff_duration_tm,0)) as plan_stop_month_02_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='03'),poweroff_duration_tm,0)) as plan_stop_month_03_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='04'),poweroff_duration_tm,0)) as plan_stop_month_04_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='05'),poweroff_duration_tm,0)) as plan_stop_month_05_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='06'),poweroff_duration_tm,0)) as plan_stop_month_06_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='07'),poweroff_duration_tm,0)) as plan_stop_month_07_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='08'),poweroff_duration_tm,0)) as plan_stop_month_08_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='09'),poweroff_duration_tm,0)) as plan_stop_month_09_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='10'),poweroff_duration_tm,0)) as plan_stop_month_10_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='11'),poweroff_duration_tm,0)) as plan_stop_month_11_actual,
-       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='12'),poweroff_duration_tm,0)) as plan_stop_month_12_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='01'),hour_num,0)) as plan_stop_month_01_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='02'),hour_num,0)) as plan_stop_month_02_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='03'),hour_num,0)) as plan_stop_month_03_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='04'),hour_num,0)) as plan_stop_month_04_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='05'),hour_num,0)) as plan_stop_month_05_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='06'),hour_num,0)) as plan_stop_month_06_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='07'),hour_num,0)) as plan_stop_month_07_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='08'),hour_num,0)) as plan_stop_month_08_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='09'),hour_num,0)) as plan_stop_month_09_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='10'),hour_num,0)) as plan_stop_month_10_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='11'),hour_num,0)) as plan_stop_month_11_actual,
+       SUM(IF((poweroff_nature_cd in('2111','2112','2121','2122','2141','2211','2212','2221','2231','2241') and SUBSTRING(data_dt,5,2)='12'),hour_num,0)) as plan_stop_month_12_actual,
 
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='01'),poweroff_duration_tm,0)) as error_stop_month_01_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='02'),poweroff_duration_tm,0)) as error_stop_month_02_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='03'),poweroff_duration_tm,0)) as error_stop_month_03_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='04'),poweroff_duration_tm,0)) as error_stop_month_04_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='05'),poweroff_duration_tm,0)) as error_stop_month_05_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='06'),poweroff_duration_tm,0)) as error_stop_month_06_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='07'),poweroff_duration_tm,0)) as error_stop_month_07_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='08'),poweroff_duration_tm,0)) as error_stop_month_08_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='09'),poweroff_duration_tm,0)) as error_stop_month_09_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='10'),poweroff_duration_tm,0)) as error_stop_month_10_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='11'),poweroff_duration_tm,0)) as error_stop_month_11_actual,
-       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='12'),poweroff_duration_tm,0)) as error_stop_month_12_actual
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='01'),hour_num,0)) as error_stop_month_01_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='02'),hour_num,0)) as error_stop_month_02_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='03'),hour_num,0)) as error_stop_month_03_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='04'),hour_num,0)) as error_stop_month_04_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='05'),hour_num,0)) as error_stop_month_05_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='06'),hour_num,0)) as error_stop_month_06_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='07'),hour_num,0)) as error_stop_month_07_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='08'),hour_num,0)) as error_stop_month_08_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='09'),hour_num,0)) as error_stop_month_09_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='10'),hour_num,0)) as error_stop_month_10_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='11'),hour_num,0)) as error_stop_month_11_actual,
+       SUM(IF((poweroff_nature_cd in('1101','1202') and SUBSTRING(data_dt,5,2)='12'),hour_num,0)) as error_stop_month_12_actual
         from ads_cst_hygszdbb_pdmstoprecords_df
         where SUBSTRING(data_dt,1,4) = #{reportYear}
         ) t2 on t1.company_no = t2.org_no