|
|
@ -1179,7 +1179,7 @@ module.exports = function (app, opts) { |
|
|
|
LEFT JOIN t_factor |
|
|
|
ON t_factor.id = t_structure_factor.factor |
|
|
|
WHERE |
|
|
|
t_structure_factor.structure IN (${[...dataAlarmG1StructureId].join(',')},-1) |
|
|
|
t_structure_factor.structure IN (${[...dataAlarmG1StructureId,-1].join(',')}) |
|
|
|
` |
|
|
|
).toPromise() || [] : [] |
|
|
|
//查询结构物的监测因素(本地化项目)
|
|
|
@ -1188,7 +1188,7 @@ module.exports = function (app, opts) { |
|
|
|
StructId AS structureId,SafetyFactorTypeName AS name,SafetyFactorTypeId AS id |
|
|
|
FROM |
|
|
|
sensors |
|
|
|
WHERE sensors.StructId in (${[...dataAlarmStructureId].join(',')},-1)` |
|
|
|
WHERE sensors.StructId in (${[...dataAlarmStructureId,-1].join(',')})` |
|
|
|
).toPromise() || [] |
|
|
|
pLog('安心云项目监测因素', factorData.length) |
|
|
|
pLog('本地化项目监测因素', factorDataLocal) |
|
|
@ -1210,9 +1210,9 @@ module.exports = function (app, opts) { |
|
|
|
LEFT JOIN t_device_sensor |
|
|
|
ON t_device_sensor.sensor = t_sensor.id |
|
|
|
WHERE |
|
|
|
t_sensor.structure IN (${[...dataAlarmG1StructureId].join(',')},-1) |
|
|
|
t_sensor.structure IN (${[...dataAlarmG1StructureId,-1].join(',')}) |
|
|
|
AND |
|
|
|
t_sensor.factor IN (${factorId.join(',')}) |
|
|
|
t_sensor.factor IN (${[...factorId,-1].join(',')}) |
|
|
|
` |
|
|
|
).toPromise() || [] |
|
|
|
//查询结构物对应的测点(本地化)
|
|
|
@ -1223,8 +1223,8 @@ module.exports = function (app, opts) { |
|
|
|
SafetyFactorTypeId AS factorId, |
|
|
|
SensorId AS iotaDeviceId |
|
|
|
FROM sensors |
|
|
|
WHERE sensors.StructId IN (${[...dataAlarmStructureId].join(',')},-1) |
|
|
|
AND sensors.SafetyFactorTypeId IN (${factorIdLocal.join(',')},-1) |
|
|
|
WHERE sensors.StructId IN (${[...dataAlarmStructureId,-1].join(',')}) |
|
|
|
AND sensors.SafetyFactorTypeId IN (${[...factorIdLocal,-1].join(',')}) |
|
|
|
` |
|
|
|
).toPromise() || [] |
|
|
|
pLog('安心云项目测点', equipment.length) |
|
|
@ -1248,7 +1248,7 @@ module.exports = function (app, opts) { |
|
|
|
FROM |
|
|
|
alarms |
|
|
|
WHERE |
|
|
|
alarms.StructureId In (${[...dataAlarmG1StructureId, ...dataAlarmStructureId].join(',')},-1) |
|
|
|
alarms.StructureId In (${[...dataAlarmG1StructureId, ...dataAlarmStructureId,-1].join(',')}) |
|
|
|
AND |
|
|
|
alarms.AlarmGroup = 1 |
|
|
|
AND |
|
|
|