2887b3e8 张雷

厂级驾驶舱问题修改

1 个父辈 d44b4fdf
......@@ -93,6 +93,12 @@ spring:
username: root
password: jkauto@123
driver-class-name: com.mysql.jdbc.Driver
# 恩菲数据同步
nf-db:
url: jdbc:mysql://113.249.91.27:3306/sk-zhongye?characterEncoding=UTF-8&useUnicode=true&useSSL=false&connectTimeout=60000&socketTimeout=1800
username: root
password: jkauto@123
driver-class-name: com.mysql.jdbc.Driver
# 多数据源配置
pg-db:
url: jdbc:postgresql://113.249.91.27:10086/postgres?useUnicode=true&characterEncoding=UTF8
......
......@@ -120,9 +120,11 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
" left join (select * from report_target_config where depart_id = '"+departId+"' and target_year = '"+dataTime+"') rtc on rtc.depart_id = v1.depart_id " +
" left join ( " +
" select right(left(time,7),2) month_tb, " +
" SUM(DLHJ) dlhj,(SUM( PAMRJ ) + SUM( SCLPAMZ ) + SUM( SCLPAMF ) + SUM( NACLO ) + SUM( PACGT ) + SUM( PACYT ) + SUM( PFS ) + SUM( FHTY ) + " +
" SUM( RYXNJ ) + SUM( YWL ) + SUM( GXCLJ ) + SUM( CH3COONA ) + SUM( HXT ) + SUM( FECL3 ) + SUM( SH ) + SUM( CH3COOH ) + SUM( FESO4G ) + " +
" SUM( FESO4Y ) + SUM( H2O2 )) yjhl " +
" SUM(DLHJ) dlhj,(SUM( IFNULL(PAMRJ,0) ) + SUM( IFNULL(SCLPAMZ,0) ) + SUM( IFNULL(SCLPAMF,0) ) + SUM( IFNULL(NACLO,0) ) + " +
" SUM( IFNULL(PACGT,0) ) + SUM( IFNULL(PACYT,0) ) + SUM( IFNULL(PFS,0) ) + SUM( IFNULL(FHTY,0) ) + " +
" SUM( IFNULL(RYXNJ,0) ) + SUM( IFNULL(YWL,0) ) + SUM( IFNULL(GXCLJ,0) ) + SUM( IFNULL(CH3COONA,0) ) + SUM( IFNULL(HXT,0) ) + " +
" SUM( IFNULL(FECL3,0) ) + SUM( IFNULL(SH,0) ) + SUM( IFNULL(CH3COOH,0) ) + SUM( IFNULL(FESO4G,0) ) + " +
" SUM( IFNULL(FESO4Y,0) ) + SUM( IFNULL(H2O2,0) )) yjhl " +
" from "+dataViewName3a24+" v3 " +
" where v3.depart_id = '"+departId+"' and v3.time like CONCAT('"+dataTime+"','%') GROUP BY left(time,7) " +
" ) v4 on v4.month_tb = right(left(v1.time,7),2) " +
......
......@@ -28,5 +28,6 @@ public interface FactoryCenterMapper {
List<Map<String, Object>> getYhtj(@Param("startDate") String startDate, @Param("endDate") String endDate,
@Param("startDateTb") String startDateTb, @Param("endDateTb") String endDateTb,
@Param("departId") String departId);
@Param("departId") String departId,
@Param("view3a24") String view3a24, @Param("view3a24tb") String view3a24tb);
}
......
......@@ -161,28 +161,30 @@
<select id="getYhtj" resultType="java.util.HashMap">
SELECT
LEFT ( v.time, 7 ) AS time,
round(SUM( v.PAMRJ ) + SUM( v.SCLPAMZ ) + SUM( v.SCLPAMF ) + SUM( v.NACLO ) +
SUM( v.PACGT ) + SUM( v.PACYT ) + SUM( v.PFS ) + SUM( v.FHTY ) +
SUM( v.RYXNJ ) + SUM( v.YWL ) + SUM( v.GXCLJ ) + SUM( v.CH3COONA ) +
SUM( v.HXT ) + SUM( v.FECL3 ) + SUM( v.SH ) + SUM( v.CH3COOH ) + SUM( v.FESO4G ) +
SUM( v.FESO4Y ) + SUM( v.H2O2 ),2) as yh ,
round(SUM( IFNULL(v.PAMRJ,0) ) + SUM( IFNULL(v.SCLPAMZ,0) ) + SUM( IFNULL(v.SCLPAMF,0) ) + SUM( IFNULL(v.NACLO,0) ) +
SUM( IFNULL(v.PACGT,0) ) + SUM( IFNULL(v.PACYT,0) ) + SUM( IFNULL(v.PFS,0) ) + SUM( IFNULL(v.FHTY,0) ) +
SUM( IFNULL(v.RYXNJ,0) ) + SUM( IFNULL(v.YWL,0) ) + SUM( IFNULL(v.GXCLJ,0) ) + SUM( IFNULL(v.CH3COONA,0) ) +
SUM( IFNULL(v.HXT,0) ) + SUM( IFNULL(v.FECL3,0) ) + SUM( IFNULL(v.SH,0) ) + SUM( IFNULL(v.CH3COOH,0) ) +
SUM( IFNULL(v.FESO4G,0) ) + SUM( IFNULL(v.FESO4Y,0) ) + SUM( IFNULL(v.H2O2,0) ),2) as yh ,
ifnull(v2.yjhl,0) as yh_tb
FROM
view_3a24 v
${view3a24} v
left join (
SELECT
RIGHT( LEFT ( time, 7 ), 2 ) AS time,
round(SUM( PAMRJ ) + SUM( SCLPAMZ ) + SUM( SCLPAMF ) + SUM( NACLO ) + SUM( PACGT ) + SUM( PACYT ) + SUM( PFS ) + SUM( FHTY ) +
SUM( RYXNJ ) + SUM( YWL ) + SUM( GXCLJ ) + SUM( CH3COONA ) + SUM( HXT ) + SUM( FECL3 ) + SUM( SH ) + SUM( CH3COOH ) + SUM( FESO4G ) +
SUM( FESO4Y ) + SUM( H2O2 ),2) as yjhl
RIGHT( LEFT ( v3.time, 7 ), 2 ) AS time,
round(SUM( v3.PAMRJ ) + SUM( v3.SCLPAMZ ) + SUM( v3.SCLPAMF ) + SUM( v3.NACLO ) +
SUM( v3.PACGT ) + SUM( v3.PACYT ) + SUM( v3.PFS ) + SUM( v3.FHTY ) +
SUM( v3.RYXNJ ) + SUM( v3.YWL ) + SUM( v3.GXCLJ ) + SUM( v3.CH3COONA ) + SUM( v3.HXT ) +
SUM( v3.FECL3 ) + SUM( v3.SH ) + SUM( v3.CH3COOH ) + SUM( v3.FESO4G ) +
SUM( v3.FESO4Y ) + SUM( v3.H2O2 ),2) as yjhl
FROM
view_3a24
${view3a24tb} v3
WHERE
depart_id = #{departId}
AND time &gt;= #{startDateTb}
AND time &lt;= #{endDateTb}
v3.depart_id = #{departId}
AND v3.time &gt;= #{startDateTb}
AND v3.time &lt;= #{endDateTb}
GROUP BY
LEFT ( time, 7 )
LEFT ( v3.time, 7 )
) v2 on RIGHT( LEFT ( v.time, 7 ), 2 ) = v2.time
WHERE v.depart_id = #{departId}
AND v.time &gt;= #{startDate}
......
......@@ -344,7 +344,7 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
String startDate = statisticsParam.getStartDate();
String endDate = statisticsParam.getEndDate();
String startDateTb = "2023-01-01";
String endDateTb = "2023-09-31";
String endDateTb = "2023-12-31";
String view2119 = ReportViewUtil.buildView(slReport, "CSL", statisticsParam.getDepartId(), startDate,endDate);
String view2119tb = ReportViewUtil.buildView(slReport, "CSL", statisticsParam.getDepartId(), startDateTb,endDateTb);
list = factoryCenterMapper.getWssltj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),view2119,view2119tb);
......@@ -363,12 +363,16 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
@Override
public List<Map<String, Object>> getYhtj(StatisticsParam statisticsParam) {
String yjReport = "3a243d5715b9e1a3753c180872ca0df9";
List<Map<String, Object>> list = new ArrayList<>();
String startDate = statisticsParam.getStartDate();
String endDate = statisticsParam.getEndDate();
String startDateTb = "2023-01-01";
String endDateTb = "2023-09-31";
list = factoryCenterMapper.getYhtj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId());
String endDateTb = "2023-12-31";
String yjField = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ,YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String view3a24 = ReportViewUtil.buildView(yjReport, yjField, statisticsParam.getDepartId(), startDate,endDate);
String view3a24tb = ReportViewUtil.buildView(yjReport, yjField, statisticsParam.getDepartId(), startDateTb,endDateTb);
list = factoryCenterMapper.getYhtj(startDate,endDate,startDateTb,endDateTb,statisticsParam.getDepartId(),view3a24,view3a24tb);
if(list.size() == 0){
List<String> monthList = getMonthsBetween(startDate,endDate);
for ( String month : monthList ) {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!