fixing api history event alarm
This commit is contained in:
@@ -93,16 +93,9 @@ const getHistoryEventDb = async (searchParams = {}) => {
|
||||
const queryText = `
|
||||
SELECT
|
||||
COUNT(*) OVER() AS total_data,
|
||||
a.*,
|
||||
b.tag_name,
|
||||
b.tag_number,
|
||||
b.lim_low_crash,
|
||||
b.lim_low,
|
||||
b.lim_high,
|
||||
b.lim_high_crash,
|
||||
a.*,
|
||||
c.status_color
|
||||
FROM alarm_history a
|
||||
LEFT JOIN m_tags b ON a.tagnum = b.tag_number AND b.deleted_at IS NULL
|
||||
FROM event_alarm a
|
||||
LEFT JOIN m_status c ON a.status = c.status_number AND c.deleted_at IS NULL
|
||||
WHERE a.datetime IS NOT NULL
|
||||
${whereConditions.length > 0 ? ` AND ${whereConditions.join(" AND ")}` : ""}
|
||||
|
||||
Reference in New Issue
Block a user