update - 能源表具看板

master
yinq 8 months ago
parent 0f107864a4
commit 556e1f9030

@ -3,6 +3,7 @@ package com.op.energy.record.mapper;
import com.op.energy.record.domain.RecordDnbInstant;
import java.util.List;
import java.util.Map;
/**
@ -75,4 +76,11 @@ public interface RecordDnbInstantMapper {
* @return
*/
List<RecordDnbInstant> selectRealTimeParentList(RecordDnbInstant baseDnbInstant);
/**
*
* @param paramMap
* @return
*/
List<RecordDnbInstant> tablewareDetailsInfo(Map paramMap);
}

@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -271,4 +272,30 @@ public class BoardController extends BaseController {
return AjaxResult.success(result);
}
/**
* new-线
* @param paramMap
* @return
*/
@ResponseBody
@GetMapping("/fixtureStatus")
public AjaxResult fixtureStatus(@RequestParam(required = false) Map paramMap){
Map<String, Object> result = boardService.fixtureStatus(paramMap);
return AjaxResult.success(result);
}
/**
*
* @param paramMap
* @return
*/
@GetMapping( "/tablewareDetailsInfo")
@ResponseBody
public AjaxResult tablewareDetailsInfo(@RequestParam(required = false) Map paramMap){
Map<String, Object> result = boardService.tablewareDetailsInfo(paramMap);
return AjaxResult.success(result);
}
}

@ -2,6 +2,7 @@ package com.op.energy.report.service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
@ -53,4 +54,19 @@ public interface IBoardService {
* @return
*/
ArrayList<HashMap<String, Object>> parkEnergyRanking(Map paramMap);
/**
* new
* @param paramMap
* @return
*/
Map<String, Object> fixtureStatus(Map paramMap);
/**
*
* @param paramMap
* @return
*/
Map<String, Object> tablewareDetailsInfo(Map paramMap);
}

@ -2,10 +2,7 @@ package com.op.energy.report.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.energy.base.domain.BaseCollectDeviceInfo;
import com.op.energy.base.domain.BaseLineMonitor;
import com.op.energy.base.domain.BaseTypeRelation;
import com.op.energy.base.domain.SysDatasource;
import com.op.energy.base.domain.*;
import com.op.energy.base.mapper.BaseCollectDeviceInfoMapper;
import com.op.energy.base.mapper.BaseLineMonitorMapper;
import com.op.energy.base.mapper.BaseTypeRelationMapper;
@ -26,10 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
import static com.op.energy.base.service.impl.BaseLineMonitorServiceImpl.getNextLevelLineMonitorList;
@ -348,4 +342,51 @@ public class BoardServiceImpl implements IBoardService {
}
return result;
}
/**
* new
* @param paramMap
* @return
*/
@Override
@DS("#header.poolName")
public Map<String, Object> fixtureStatus(Map paramMap) {
HashMap<String, Object> result = new HashMap<>();
if (String.valueOf(paramMap.get("energyType")).equals("")) {
return result;
}
BaseLineMonitor lineMonitor = new BaseLineMonitor();
lineMonitor.setMonitorType(Long.valueOf(String.valueOf(paramMap.get("energyType"))));
List<BaseLineMonitor> list = baseLineMonitorService.selectBaseLineMonitorList(lineMonitor);
List<Ztree> ztrees = new ArrayList<Ztree>();
for (BaseLineMonitor baseLineMonitor : list) {
Ztree ztree = new Ztree();
ztree.setId(baseLineMonitor.getObjid());
ztree.setpId(baseLineMonitor.getParentId());
ztree.setName(baseLineMonitor.getMonitorName());
ztree.setTitle(baseLineMonitor.getMonitorId());
ztrees.add(ztree);
}
result.put("result", ztrees);
return result;
}
/**
*
* @param paramMap
* @return
*/
@Override
@DS("#header.poolName")
public Map<String, Object> tablewareDetailsInfo(Map paramMap) {
HashMap<String, Object> result = new HashMap<>();
if (paramMap.containsKey("energyType") && String.valueOf(paramMap.get("energyType")).equals("2")){
List<RecordDnbInstant> recordDnbInstants = recordDnbInstantMapper.tablewareDetailsInfo(paramMap);
result.put("result", recordDnbInstants.get(0));
}
return result;
}
}

@ -198,4 +198,40 @@
</foreach>
</delete>
<select id="tablewareDetailsInfo" parameterType="RecordDnbInstant" resultMap="RecordDnbInstantResult">
select d.monitor_id,
m.monitor_name,
m.monitor_addr address,
d.collect_time,
d.vA,
d.vB,
d.vC,
d.iA,
d.iB,
d.iC,
d.record_time,
d.glys,
d.zxyg,
d.active_power,
d.reactive_power,
d.collect_type,
bcdi.online_state onlineState,
isnull(pd.consumption,0) consumption
from record_dnb_instant d
join (select rdi.monitor_id, max(rdi.collect_time) collect_time
from record_dnb_instant rdi
where 1=1
<if test="monitorId != null and monitorId != ''">and rdi.monitor_id = #{monitorId}</if>
group by rdi.monitor_id) md on md.collect_time = d.collect_time and md.monitor_id = d.monitor_id
left join base_monitor_info m on m.monitor_id = d.monitor_id
left join (select rpd.monitor_id, isnull(sum(rpd.expend), 0) consumption
from report_point_dnb rpd
where 1=1
<if test="beginCollectTime != null and beginCollectTime != '' and endCollectTime != null and endCollectTime != ''">
and rpd.begin_time between #{params.beginCollectTime} and #{params.endCollectTime}
</if>
group by rpd.monitor_id) pd on pd.monitor_id = m.monitor_id
left join base_collect_device_info bcdi on bcdi.collect_device_id = m.collect_device_id
</select>
</mapper>

@ -72,7 +72,7 @@
<if test="pointTime != null and pointTime != ''">and point_time = #{pointTime}</if>
<if test="monitorSubset != null and monitorSubset != ''">
and (report_point_dnb.monitor_id = #{monitorSubset} OR report_point_dnb.monitor_id IN
(SELECT t.monitor_id FROM base_monitor_info t WHERE FIND_IN_SET(#{monitorSubset}, ancestors)))
(SELECT t.monitor_id FROM base_monitor_info t WHERE dbo.FIND_IN_SET(#{monitorSubset}, ancestors) > 0))
</if>
<if test="params.beginBeginTime != null and params.beginBeginTime != '' and params.endBeginTime != null and params.endBeginTime != ''">
and begin_time between #{params.beginBeginTime} and #{params.endBeginTime}
@ -106,7 +106,7 @@
where report_point_dnb.objid = #{objid}
</select>
<select id="energyConsumptionReportByTime" resultType="java.util.Map">
select ert.pointTime, sum(if(ert.expend is null, 0, ert.expend)) expend
select ert.pointTime, sum(isnull(ert.expend,0)) expend
from (
select left(rpd.begin_time, #{timeSub}) pointTime, rpd.expend
from report_point_dnb rpd
@ -134,7 +134,7 @@
</select>
<select id="energyConsumptionAnalysisDetails" resultType="java.util.Map">
select ert.monitor_id, ert.monitor_name, ert.pointTime, sum(if(ert.expend is null, 0, ert.expend)) expend
select ert.monitor_id, ert.monitor_name, ert.pointTime, sum(isnull(ert.expend,0)) expend
from (
select rpd.monitor_id, m.monitor_name, left(rpd.begin_time, 10) pointTime, rpd.expend
from report_point_dnb rpd
@ -175,7 +175,7 @@
WHEN #{params.timeSub} = 7 THEN LAST_DAY(concat(ert.pointTime, '-01'))
WHEN #{params.timeSub} = 4 THEN LAST_DAY(concat(ert.pointTime, '-12-01'))
END AS end_time,
sum(if(ert.expend is null, 0, ert.expend)) expend,
sum(isnull(ert.expend,0)) expend,
max(ert.meter_value) meter_value,
max(ert.monitor_addr) address
from (
@ -190,7 +190,7 @@
</if>
<if test="monitorSubset != null and monitorSubset != ''">
and (rpd.monitor_id = #{monitorSubset} OR rpd.monitor_id IN
(SELECT t.monitor_id FROM base_monitor_info t WHERE FIND_IN_SET(#{monitorSubset}, ancestors)))
(SELECT t.monitor_id FROM base_monitor_info t WHERE dbo.FIND_IN_SET(#{monitorSubset}, ancestors) > 0))
</if>
<if test="publicShareType != null and publicShareType != ''">and m.public_share_type = #{publicShareType}
</if>
@ -207,7 +207,7 @@
rpd.monitor_id monitorId,
m.monitor_name monitorName,
m.monitor_addr address,
sum(if(rpd.expend is null, 0, rpd.expend)) expend,
sum(isnull(ert.expend,0)) expend,
max(rpd.meter_value) meterValue,
GROUP_CONCAT(DISTINCT bpu.user_name SEPARATOR ',') owningUser,
concat(#{beginCollectTime},' 至 ',#{endCollectTime}) timeRange,

Loading…
Cancel
Save