终端运维管理优化
This commit is contained in:
@@ -846,7 +846,7 @@
|
||||
SELECT
|
||||
device.Name name,
|
||||
sub.Name substation,
|
||||
m.Time_Id updateTime,
|
||||
device.Update_Time updateTime,
|
||||
b.run_flag runFlag,
|
||||
b.com_flag comFlag,
|
||||
ifnull(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + ifnull(d1.flow, 0) flowMeal,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
ifnull(g.name,'/') version,
|
||||
ifnull(d.flow,(select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlowMeal,
|
||||
ifnull(d1.flow,0) reamFlowMeal,
|
||||
FORMAT(ifnull(mo.statis_value,0)/1024/1024,2) as statisValue
|
||||
ROUND(ifnull(mo.Actual_Value,0)/1024/1024,2) statisValue
|
||||
FROM
|
||||
pq_line a
|
||||
INNER JOIN pq_device b ON a.id = b.id
|
||||
@@ -139,10 +139,11 @@ FROM
|
||||
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) baseFlow,
|
||||
IFNULL(d1.flow, 0) extendFlow,
|
||||
IFNULL(d.flow, (select flow from cld_flow_meal where type = 0 and flag = 1)) + IFNULL(d1.flow, 0) flowMeal
|
||||
FROM cld_dev_meal c
|
||||
FROM pq_line device
|
||||
LEFT JOIN cld_dev_meal c ON device.id = c.Line_Id
|
||||
LEFT JOIN cld_flow_meal d ON c.Base_Meal_Id = d.id
|
||||
LEFT JOIN cld_flow_meal d1 ON c.Ream_Meal_Id = d1.id
|
||||
WHERE c.Line_Id = #{devId} AND d.State =1 AND d1.State =1
|
||||
WHERE device.Id = #{devId}
|
||||
</select>
|
||||
|
||||
<select id="getMonthFlow" resultType="com.njcn.device.pq.pojo.vo.LineFlowMealDetailVO">
|
||||
|
||||
@@ -282,12 +282,12 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
||||
public List<TerminalDaliyFlowVO> getFlowManageDetail(TerminalMainQueryParam param) {
|
||||
List<TerminalDaliyFlowVO> list = new ArrayList<>();
|
||||
TerminalDaliyFlowVO flowManageDetail = terminalMaintainMapper.getFlowManageDetail(param.getDevId());
|
||||
if (flowManageDetail ==null) {
|
||||
flowManageDetail = new TerminalDaliyFlowVO();
|
||||
flowManageDetail.setBaseFlow(1024f);
|
||||
flowManageDetail.setExtendFlow(0f);
|
||||
flowManageDetail.setFlowMeal(1024f);
|
||||
}
|
||||
// if (flowManageDetail ==null) {
|
||||
// flowManageDetail = new TerminalDaliyFlowVO();
|
||||
// flowManageDetail.setBaseFlow(1024f);
|
||||
// flowManageDetail.setExtendFlow(0f);
|
||||
// flowManageDetail.setFlowMeal(1024f);
|
||||
// }
|
||||
List<DeviceDayFlow> deviceDayFlowList = getFlowManageDetailFromInfluxDB(param);
|
||||
float sum = (float) deviceDayFlowList.stream().mapToDouble(DeviceDayFlow::getDailyActualValue).sum();
|
||||
flowManageDetail.setDeviceDayFlowsList(deviceDayFlowList);
|
||||
@@ -310,7 +310,7 @@ public class TerminalMaintainServiceImpl implements TerminalMaintainService {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
stringBuilder.append("time >= '").append(DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime()))).append("' and ").append("time <= '").append(DateUtil.endOfDay(DateUtil.parse(param.getSearchEndTime()))).append("' and ");
|
||||
stringBuilder.append("dev_id ='").append(param.getDevId()).append("'");
|
||||
String sql = "select * from " + InfluxDBPublicParam.PQS_ACTUAL_FLOW + " where " + stringBuilder.toString() + InfluxDBPublicParam.TIME_ZONE;
|
||||
String sql = "select * from " + InfluxDBPublicParam.CLD_STATIS_FLOW + " where " + stringBuilder.toString() + InfluxDBPublicParam.TIME_ZONE;
|
||||
QueryResult result = influxDbUtils.query(sql);
|
||||
InfluxDBResultMapper influxDBResultMapper = new InfluxDBResultMapper();
|
||||
List<DeviceDayFlow> deviceDayFlow = influxDBResultMapper.toPOJO(result, DeviceDayFlow.class);
|
||||
|
||||
Reference in New Issue
Block a user