zx 1 місяць тому
батько
коміт
37c7b81279

+ 3 - 0
ruoyi-powerdistribution/src/main/java/com/ruoyi/powerdistribution/service/impl/PdmStopTargeServiceImpl.java

@@ -106,6 +106,9 @@ public class PdmStopTargeServiceImpl extends ServiceImpl<PdmStopTargeMapper,PdmS
         this.remove(new LambdaUpdateWrapper<PdmStopTarge>().eq(PdmStopTarge::getReportYear,reportYear));
         for(PdmStopTarge target:list){
             target.setReportYear(reportYear);
+            if("总计".equals(target.getCompanyName())){
+                target.setCompanyNo("888");
+            }
             pdmStopTargeMapper.insertPdmStopTarge(target);
         }
         return true;

+ 3 - 3
ruoyi-powerdistribution/src/main/resources/mapper/powerdistribution/PdmScoreRankWorkerMapper.xml

@@ -131,7 +131,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <insert id="saveWorker" parameterType="PdmScoreRankWorker">
         INSERT INTO pdm_score_rank_worker (report_year,report_date,company_name,team_type,team_name,work_user_name,score)
 
-        select report_year,report_date,t1.submit_org_nm,'1' team_type,t1.work_team_nm,t1.person_nm,
+        select DISTINCT report_year,report_date,t1.submit_org_nm,'1' team_type,t1.work_team_nm,t1.person_nm,
         work_level_1+work_level_2+work_level_3+work_level_4+work_level_5
         -IFNULL(province_violation_1,0)-IFNULL(province_violation_2,0)-IFNULL(city_violation_1,0)-IFNULL(city_violation_2,0)
         -IFNULL(city_problem_1,0) score
@@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         AND date_format(plan_start_wk_tm,'%Y%m%d')  &gt;= #{startDate}
         and date_format(plan_start_wk_tm,'%Y%m%d') &lt;= #{endDate}
         and work_team_nm not like '%公司'
-        GROUP BY submit_org_nm,work_team_nm,person_nm,person_nm
+        GROUP BY submit_org_nm,work_team_nm,person_nm,person_id
         )t1
         LEFT JOIN
         (
@@ -202,7 +202,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and date_format(plan_start_wk_tm,'%Y%m%d')  &gt;= #{startDate}
         and date_format(plan_start_wk_tm,'%Y%m%d') &lt;= #{endDate}
         and work_team_nm like '%公司' and work_team_nm not like '%雁能%'
-        GROUP BY work_team_nm,person_nm,person_nm
+        GROUP BY work_team_nm,person_nm,person_id
         )t1
         LEFT JOIN
         (

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

@@ -432,6 +432,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         from ads_cst_hywzqlc_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(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('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
+        from ads_cst_hywzqlc_pdmstoprecords_df
+        where SUBSTRING(data_dt,1,4) = #{reportYear}
         ) t2 on t1.company_no = t2.org_no
         where  report_year = #{reportYear}