93a61be5 张雷

Merge remote-tracking branch 'origin/master' into master

2 个父辈 aed22ddf eba3af19
...@@ -177,7 +177,7 @@ public class PowerAnalysisNewController { ...@@ -177,7 +177,7 @@ public class PowerAnalysisNewController {
177 @GetMapping(value = "/powerCutDownListByFac") 177 @GetMapping(value = "/powerCutDownListByFac")
178 public Result powerCutDownListByFac(String startTime, String endTime, String factoryId) { 178 public Result powerCutDownListByFac(String startTime, String endTime, String factoryId) {
179 Result result = new Result(); 179 Result result = new Result();
180 Map<String, Object> resultMap = operationMonthService.powerCutDownListByFac(startTime, endTime, factoryId); 180 Map<String, Object> resultMap = operationMonthService.powerCutDownListByFacNew(startTime, endTime, factoryId);
181 result.setSuccess(true); 181 result.setSuccess(true);
182 result.setResult(resultMap); 182 result.setResult(resultMap);
183 return result; 183 return result;
......
...@@ -70,4 +70,6 @@ public interface PowerAnalysisNewMapper { ...@@ -70,4 +70,6 @@ public interface PowerAnalysisNewMapper {
70 70
71 List<Map<String, Object>> queryHDLDetails(@Param("dataViewName3a24") String dataViewName3a24,@Param("dataViewName2119") String dataViewName2119, 71 List<Map<String, Object>> queryHDLDetails(@Param("dataViewName3a24") String dataViewName3a24,@Param("dataViewName2119") String dataViewName2119,
72 @Param("parentId") String parentId); 72 @Param("parentId") String parentId);
73
74 List<Map<String, Object>> powerCutDownListByFacNew(@Param("dataViewName3a24")String dataViewName3a24, @Param("dataViewName2119")String dataViewName2119,@Param("startTime") String startTime, @Param("endTime")String endTime);
73 } 75 }
......
...@@ -689,6 +689,51 @@ ...@@ -689,6 +689,51 @@
689 ORDER BY 689 ORDER BY
690 depart_id,LEFT ( ts, 7 ),index_tag 690 depart_id,LEFT ( ts, 7 ),index_tag
691 </select> 691 </select>
692
693
694 <select id="powerCutDownListByFacNew" resultType="java.util.Map">
695
696 select bbb.time ,
697 ccc.totalBYYDL , bbb.JSCOD , bbb.CSCOD,bbb.CSL,
698 round(ifnull( (ccc.totalBYYDL / (bbb.JSCOD - bbb.CSCOD) / bbb.CSL) , 0),2) 'codValue' ,
699 round(ifnull( ((bbb.JSCOD - bbb.CSCOD) * bbb.CSL) , 0),2) 'codCountValue' ,
700 round(ifnull( (ccc.totalBYYDL / (bbb.JSAD - bbb.CSAD) / bbb.CSL) , 0),2) 'nh3nValue' ,
701 round(ifnull( ((bbb.JSAD - bbb.CSAD) * bbb.CSL) , 0),2) 'nh3nCountValue' ,
702 round(ifnull( (ccc.totalBYYDL / (bbb.JSZD - bbb.CSTN) / bbb.CSL) , 0),2) 'tnValue' ,
703 round(ifnull( ((bbb.JSZD - bbb.CSTN) * bbb.CSL) , 0),2) 'tnCountValue',
704 round(ifnull( (ccc.totalBYYDL / (bbb.JSPH - bbb.CSPH) / bbb.CSL) , 0),2) 'tpValue' ,
705 round(ifnull( ((bbb.JSPH - bbb.CSPH) * bbb.CSL) , 0),2) 'tpCountValue'
706
707 from (
708 select
709 LEFT ( v.time, 7 ) time,
710 round(SUM(ifnull( v.CSL, 0 )),2) CSL ,
711 round(SUM(ifnull( v.JSZL, 0 )),2) JSZL ,
712 round(SUM(ifnull( v.CSZL, 0 )),2) CSZL ,
713 round(SUM(ifnull( v.JSCOD, 0 )),2) JSCOD ,
714 round(SUM(ifnull( v.CSCOD, 0 )),2) CSCOD ,
715 round(SUM(ifnull( v.JSAD, 0 )),2) JSAD ,
716 round(SUM(ifnull( v.CSAD, 0 )),2) CSAD ,
717 round(SUM(ifnull( v.JSZD, 0 )),2) JSZD ,
718 round(SUM(ifnull( v.CSTN, 0 )),2) CSTN ,
719 round(SUM(ifnull( v.JSPH, 0 )),2) JSPH ,
720 round(SUM(ifnull( v.CSPH, 0 )),2) CSPH
721 from
722 ${dataViewName2119}
723 v GROUP BY LEFT ( v.time, 7 )
724 )bbb
725
726 left join (
727 select
728 LEFT ( v2.time, 7 ) time_c,
729 round(SUM(ifnull( v2.DLHJ, 0 )),2) 'totalBYYDL'
730 from ${dataViewName3a24}
731 v2 GROUP BY LEFT ( v2.time, 7 )
732 )ccc on ccc.time_c = bbb.time
733 </select>
734
735
736
692 <select id="queryHDLAndSL" resultType="java.util.Map"> 737 <select id="queryHDLAndSL" resultType="java.util.Map">
693 SELECT 738 SELECT
694 sd.depart_name factoryName, 739 sd.depart_name factoryName,
...@@ -710,7 +755,7 @@ ...@@ -710,7 +755,7 @@
710 and v.depart_id=#{factoryId} 755 and v.depart_id=#{factoryId}
711 </if> 756 </if>
712 GROUP BY v.depart_id,LEFT ( v.time, 7 ) 757 GROUP BY v.depart_id,LEFT ( v.time, 7 )
713 ) p 758 ) p ON p.factoryId = sd.id
714 LEFT JOIN ( 759 LEFT JOIN (
715 SELECT 760 SELECT
716 v.depart_id factoryId, 761 v.depart_id factoryId,
......
...@@ -76,6 +76,8 @@ public interface IPowerAnalysisNewService { ...@@ -76,6 +76,8 @@ public interface IPowerAnalysisNewService {
76 **/ 76 **/
77 Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String departId); 77 Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String departId);
78 78
79 Map<String, Object> powerCutDownListByFacNew(String startTime, String endTime, String departId);
80
79 /** 81 /**
80 * <pre> 82 * <pre>
81 * 按月查询电耗情况 83 * 按月查询电耗情况
......
...@@ -14,6 +14,8 @@ import com.skua.modules.dataAnalysis.mapper.WaterCountAnalysisNewMapper; ...@@ -14,6 +14,8 @@ import com.skua.modules.dataAnalysis.mapper.WaterCountAnalysisNewMapper;
14 import com.skua.modules.dataAnalysis.service.IPowerAnalysisNewService; 14 import com.skua.modules.dataAnalysis.service.IPowerAnalysisNewService;
15 import com.skua.modules.dataAnalysis.vo.OperationMonthVO; 15 import com.skua.modules.dataAnalysis.vo.OperationMonthVO;
16 import com.skua.modules.dataAnalysis.vo.PowerCutDownVO; 16 import com.skua.modules.dataAnalysis.vo.PowerCutDownVO;
17 import com.skua.modules.system.entity.SysDepart;
18 import com.skua.modules.system.service.ISysDepartService;
17 import com.skua.tool.util.JSUtils; 19 import com.skua.tool.util.JSUtils;
18 import org.apache.commons.lang3.StringUtils; 20 import org.apache.commons.lang3.StringUtils;
19 import org.springframework.beans.factory.annotation.Autowired; 21 import org.springframework.beans.factory.annotation.Autowired;
...@@ -31,6 +33,8 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService { ...@@ -31,6 +33,8 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
31 private PowerAnalysisNewMapper powerAnalysisNewMapper; 33 private PowerAnalysisNewMapper powerAnalysisNewMapper;
32 @Autowired 34 @Autowired
33 private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper; 35 private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper;
36 @Autowired
37 private ISysDepartService departService;
34 //时间格式 38 //时间格式
35 public static final SimpleDateFormat yyyyMM = new SimpleDateFormat("yyyy-MM"); 39 public static final SimpleDateFormat yyyyMM = new SimpleDateFormat("yyyy-MM");
36 //格式化小数 40 //格式化小数
...@@ -714,12 +718,28 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService { ...@@ -714,12 +718,28 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
714 resultMap.put("data", data); 718 resultMap.put("data", data);
715 return resultMap; 719 return resultMap;
716 } 720 }
721 public Map<String, Object> powerCutDownListByFacNew(String startTime, String endTime, String departId) {
722 Map<String, Object> result = Maps.newHashMap();
723 String departIds = BaseContextHandler.getDeparts();
724 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists(departId, departIds);
717 725
726 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ", departId, startTime, endTime);
727 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL,"+ReportConstant.fieldSz, departId, startTime, endTime);
728 List<Map<String, Object>> dataList = powerAnalysisNewMapper.powerCutDownListByFacNew(dataViewName3a24,dataViewName2119,startTime, endTime);
729 if(facLists != null ){
730 for(Map<String, Object> facList : facLists){
731 facList.put("data", dataList);
732 }
733 }
734 result.put("data", facLists);
735 return result;
736 }
718 @Override 737 @Override
719 public Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String departId) { 738 public Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String departId) {
720 String departIds = BaseContextHandler.getDeparts(); 739 String departIds = BaseContextHandler.getDeparts();
721 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ", departIds, startTime, endTime); 740 String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ", departIds, startTime, endTime);
722 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime, endTime); 741 String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime, endTime);
742
723 DecimalFormat df = new DecimalFormat("#.##"); 743 DecimalFormat df = new DecimalFormat("#.##");
724 Map<String, Object> result = Maps.newHashMap(); 744 Map<String, Object> result = Maps.newHashMap();
725 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists(departId, departIds); 745 List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists(departId, departIds);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!