From 2a8376fda49a68544bedb8222dc935e59bd37e73 Mon Sep 17 00:00:00 2001 From: CODE <1650192445@qq.com> Date: Wed, 18 Oct 2023 17:32:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=8E=A8=E9=80=81++?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/schedule/alarms_push.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index 7d32954..d4a18d6 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -1211,11 +1211,13 @@ module.exports = function (app, opts) { ).toPromise() || [] : [] //查询结构物的监测因素(本地化项目) let factorDataLocal = await clickHouse.dataAlarm.query( - ` SELECT - StructId AS structureId,SafetyFactorTypeName AS name,SafetyFactorTypeId AS id + `SELECT + PlatformStructureId AS structureId, + SafetyFactorTypeName AS name, + SafetyFactorTypeId AS id FROM sensors - WHERE sensors.StructId in (${[...dataAlarmStructureId, -1].join(',')})` + WHERE sensors.PlatformStructureId IN (${[...dataAlarmStructureId, -1, -2].join(',')})` ).toPromise() || [] pLog('安心云项目监测因素', factorData.length) pLog('本地化项目监测因素', factorDataLocal) @@ -1250,11 +1252,12 @@ module.exports = function (app, opts) { let equipmentLocal = await clickHouse.dataAlarm.query( ` SELECT SensorLocationDescription AS name, - StructId AS structureId, + PlatformStructureId AS structureId, SafetyFactorTypeId AS factorId, - SensorId AS iotaDeviceId + SensorId AS iotaDeviceId, + ProductName AS deviceName FROM sensors - WHERE sensors.StructId IN (${[...dataAlarmStructureId, -1].join(',')}) + WHERE sensors.PlatformStructureId IN (${[...dataAlarmStructureId, -1].join(',')}) AND sensors.SafetyFactorTypeId IN (${[...factorIdLocal, -1].join(',')}) ` ).toPromise() || []