b452ab00 张雷

节能环保问题修改

1 个父辈 16189507
......@@ -108,7 +108,8 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData
@Param(value="dataViewName2119") String dataViewName2119);
List<JnhbReportData> getJnhbReport(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3,
@Param(value="start") String start, @Param(value="end") String end, @Param(value="departIds") String departIds);
@Param(value="start") String start, @Param(value="end") String end,
@Param(value="departIds") String departIds, @Param(value="dayCount") int dayCount);
String getChildDepartId(@Param(value="departId") String departId);
......
......@@ -261,7 +261,7 @@
SELECT
d.id AS depart_id,
d.depart_name AS depart_name,
f.pro_scale * v2.day_num AS wsclgm,
ROUND(f.pro_scale * v2.day_num,2) AS wsclgm,
v2.clsl AS wssjcll,
round( 100 * ( v2.clsl / ( f.pro_scale * v2.day_num ) ), 2 ) AS wsfhl,
v3.dh,
......@@ -282,7 +282,7 @@
SELECT
v.depart_id,
ROUND( SUM( v.CSL ) / 10000, 2 ) AS clsl,
count( v.id ) AS day_num
#{dayCount} AS day_num
FROM
${dataViewName2} v
WHERE
......
......@@ -15,6 +15,7 @@ import java.time.temporal.WeekFields;
import java.util.*;
import com.skua.modules.report.vo.*;
import com.skua.modules.report.vo.largeScreen.*;
import com.skua.tool.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
......@@ -214,10 +215,11 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
public List<JnhbReportData> jnhbReportShow(String departId, String month) {
String start = month.substring(0,4)+"-01-31";
String end = month + "-31";
int dayCount = (int)DateUtils.differenceDay(start,end);
String departIds = mapper.getChildDepartId(departId);
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, start, end);
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end);
List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds);
List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds, dayCount);
return list;
}
......@@ -243,23 +245,27 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
public JnhbLargeScreenVO jnhbLargeScreenShow(DataVO dataVO){
long startTime = System.nanoTime();
JnhbLargeScreenVO largeScreenVO = new JnhbLargeScreenVO();
int dayCount = (int)DateUtils.differenceDay(dataVO.getNowStartTime(),dataVO.getNowEndTime());
//当月数据
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getNowStartTime(), dataVO.getNowEndTime());
List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(), dataVO.getNowEndTime(), null);
List<JnhbReportData> jnhbReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getNowStartTime(),
dataVO.getNowEndTime(),null, dayCount);
//System.out.println("1111---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
// 上月数据 同比
dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime());
List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(), dataVO.getLastMonthEndTime(), null);
List<JnhbReportData> lastMonthReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastMonthStartTime(),
dataVO.getLastMonthEndTime(), null, dayCount);
//System.out.println("2222---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
Map<String,JnhbReportData> lastMonthMapData= convertJnhbReportDataMap(lastMonthReportDataList);
// 去年数据 环比
dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", null, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime());
List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(), dataVO.getLastYearEndTime(), null);
List<JnhbReportData> lastYearReportDataList = mapper.getJnhbReport(dataViewName2, dataViewName3, dataVO.getLastYearStartTime(),
dataVO.getLastYearEndTime(), null, dayCount);
Map<String,JnhbReportData> lastYearMapData= convertJnhbReportDataMap(lastYearReportDataList);
//System.out.println("333333---**************执行时间:"+ (System.nanoTime() - startTime) / 1_000_000.0 + " milliseconds");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!