93a61be5 张雷

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

2 个父辈 aed22ddf eba3af19
......@@ -177,7 +177,7 @@ public class PowerAnalysisNewController {
@GetMapping(value = "/powerCutDownListByFac")
public Result powerCutDownListByFac(String startTime, String endTime, String factoryId) {
Result result = new Result();
Map<String, Object> resultMap = operationMonthService.powerCutDownListByFac(startTime, endTime, factoryId);
Map<String, Object> resultMap = operationMonthService.powerCutDownListByFacNew(startTime, endTime, factoryId);
result.setSuccess(true);
result.setResult(resultMap);
return result;
......
......@@ -70,4 +70,6 @@ public interface PowerAnalysisNewMapper {
List<Map<String, Object>> queryHDLDetails(@Param("dataViewName3a24") String dataViewName3a24,@Param("dataViewName2119") String dataViewName2119,
@Param("parentId") String parentId);
List<Map<String, Object>> powerCutDownListByFacNew(@Param("dataViewName3a24")String dataViewName3a24, @Param("dataViewName2119")String dataViewName2119,@Param("startTime") String startTime, @Param("endTime")String endTime);
}
......
......@@ -689,6 +689,51 @@
ORDER BY
depart_id,LEFT ( ts, 7 ),index_tag
</select>
<select id="powerCutDownListByFacNew" resultType="java.util.Map">
select bbb.time ,
ccc.totalBYYDL , bbb.JSCOD , bbb.CSCOD,bbb.CSL,
round(ifnull( (ccc.totalBYYDL / (bbb.JSCOD - bbb.CSCOD) / bbb.CSL) , 0),2) 'codValue' ,
round(ifnull( ((bbb.JSCOD - bbb.CSCOD) * bbb.CSL) , 0),2) 'codCountValue' ,
round(ifnull( (ccc.totalBYYDL / (bbb.JSAD - bbb.CSAD) / bbb.CSL) , 0),2) 'nh3nValue' ,
round(ifnull( ((bbb.JSAD - bbb.CSAD) * bbb.CSL) , 0),2) 'nh3nCountValue' ,
round(ifnull( (ccc.totalBYYDL / (bbb.JSZD - bbb.CSTN) / bbb.CSL) , 0),2) 'tnValue' ,
round(ifnull( ((bbb.JSZD - bbb.CSTN) * bbb.CSL) , 0),2) 'tnCountValue',
round(ifnull( (ccc.totalBYYDL / (bbb.JSPH - bbb.CSPH) / bbb.CSL) , 0),2) 'tpValue' ,
round(ifnull( ((bbb.JSPH - bbb.CSPH) * bbb.CSL) , 0),2) 'tpCountValue'
from (
select
LEFT ( v.time, 7 ) time,
round(SUM(ifnull( v.CSL, 0 )),2) CSL ,
round(SUM(ifnull( v.JSZL, 0 )),2) JSZL ,
round(SUM(ifnull( v.CSZL, 0 )),2) CSZL ,
round(SUM(ifnull( v.JSCOD, 0 )),2) JSCOD ,
round(SUM(ifnull( v.CSCOD, 0 )),2) CSCOD ,
round(SUM(ifnull( v.JSAD, 0 )),2) JSAD ,
round(SUM(ifnull( v.CSAD, 0 )),2) CSAD ,
round(SUM(ifnull( v.JSZD, 0 )),2) JSZD ,
round(SUM(ifnull( v.CSTN, 0 )),2) CSTN ,
round(SUM(ifnull( v.JSPH, 0 )),2) JSPH ,
round(SUM(ifnull( v.CSPH, 0 )),2) CSPH
from
${dataViewName2119}
v GROUP BY LEFT ( v.time, 7 )
)bbb
left join (
select
LEFT ( v2.time, 7 ) time_c,
round(SUM(ifnull( v2.DLHJ, 0 )),2) 'totalBYYDL'
from ${dataViewName3a24}
v2 GROUP BY LEFT ( v2.time, 7 )
)ccc on ccc.time_c = bbb.time
</select>
<select id="queryHDLAndSL" resultType="java.util.Map">
SELECT
sd.depart_name factoryName,
......@@ -710,7 +755,7 @@
and v.depart_id=#{factoryId}
</if>
GROUP BY v.depart_id,LEFT ( v.time, 7 )
) p
) p ON p.factoryId = sd.id
LEFT JOIN (
SELECT
v.depart_id factoryId,
......
......@@ -76,6 +76,8 @@ public interface IPowerAnalysisNewService {
**/
Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String departId);
Map<String, Object> powerCutDownListByFacNew(String startTime, String endTime, String departId);
/**
* <pre>
* 按月查询电耗情况
......
......@@ -14,6 +14,8 @@ import com.skua.modules.dataAnalysis.mapper.WaterCountAnalysisNewMapper;
import com.skua.modules.dataAnalysis.service.IPowerAnalysisNewService;
import com.skua.modules.dataAnalysis.vo.OperationMonthVO;
import com.skua.modules.dataAnalysis.vo.PowerCutDownVO;
import com.skua.modules.system.entity.SysDepart;
import com.skua.modules.system.service.ISysDepartService;
import com.skua.tool.util.JSUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -31,6 +33,8 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
private PowerAnalysisNewMapper powerAnalysisNewMapper;
@Autowired
private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper;
@Autowired
private ISysDepartService departService;
//时间格式
public static final SimpleDateFormat yyyyMM = new SimpleDateFormat("yyyy-MM");
//格式化小数
......@@ -714,12 +718,28 @@ public class PowerAnalysisNewServiceImpl implements IPowerAnalysisNewService {
resultMap.put("data", data);
return resultMap;
}
public Map<String, Object> powerCutDownListByFacNew(String startTime, String endTime, String departId) {
Map<String, Object> result = Maps.newHashMap();
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists(departId, departIds);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ", departId, startTime, endTime);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL,"+ReportConstant.fieldSz, departId, startTime, endTime);
List<Map<String, Object>> dataList = powerAnalysisNewMapper.powerCutDownListByFacNew(dataViewName3a24,dataViewName2119,startTime, endTime);
if(facLists != null ){
for(Map<String, Object> facList : facLists){
facList.put("data", dataList);
}
}
result.put("data", facLists);
return result;
}
@Override
public Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String departId) {
String departIds = BaseContextHandler.getDeparts();
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ", departIds, startTime, endTime);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime, endTime);
DecimalFormat df = new DecimalFormat("#.##");
Map<String, Object> result = Maps.newHashMap();
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists(departId, departIds);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!