Browse Source

device4Search

dev
巴林闲侠 2 years ago
parent
commit
a5e2b83974
  1. 7
      api/app/lib/schedule/alarms_push.js

7
api/app/lib/schedule/alarms_push.js

@ -902,7 +902,12 @@ module.exports = function (app, opts) {
const device4Search = [...deviceIds]
.map(id => "'" + id + "'")
deviceSensorRes = await clickHouse.anxinyun.query(`
SELECT iota_device_id, sensor FROM t_device_sensor WHERE iota_device_id IN (${device4Search.join(',')}, '-1')
SELECT
iota_device_id, sensor
FROM t_device_sensor
WHERE iota_device_id
${device4Search.length > 1 ? `IN (${device4Search.join(',')})` : `= ${device4Search[0]}`}
`).toPromise()
}
if (proDebug) {

Loading…
Cancel
Save