|
@ -91,13 +91,16 @@ async function list (ctx) { |
|
|
alarms.StructureId AS StructureId, |
|
|
alarms.StructureId AS StructureId, |
|
|
${anxinyun}.t_structure.name AS StructureName, |
|
|
${anxinyun}.t_structure.name AS StructureName, |
|
|
${anxinyun}.t_alarm_code.name AS AlarmCodeName, |
|
|
${anxinyun}.t_alarm_code.name AS AlarmCodeName, |
|
|
AlarmContent |
|
|
AlarmContent, |
|
|
|
|
|
${anxinyun}.t_alarm_type.name AS alarmType |
|
|
FROM |
|
|
FROM |
|
|
alarms |
|
|
alarms |
|
|
LEFT JOIN ${anxinyun}.t_structure |
|
|
LEFT JOIN ${anxinyun}.t_structure |
|
|
ON ${anxinyun}.t_structure.id = alarms.StructureId |
|
|
ON ${anxinyun}.t_structure.id = alarms.StructureId |
|
|
LEFT JOIN ${anxinyun}.t_alarm_code |
|
|
LEFT JOIN ${anxinyun}.t_alarm_code |
|
|
ON ${anxinyun}.t_alarm_code.code = alarms.AlarmTypeCode |
|
|
ON ${anxinyun}.t_alarm_code.code = alarms.AlarmTypeCode |
|
|
|
|
|
LEFT JOIN ${anxinyun}.t_alarm_type |
|
|
|
|
|
ON ${anxinyun}.t_alarm_type.id = alarms.AlarmTypeId |
|
|
${whereOption.length ? 'WHERE ' + whereOption.join(' AND ') : ''} |
|
|
${whereOption.length ? 'WHERE ' + whereOption.join(' AND ') : ''} |
|
|
ORDER BY alarms.StartTime DESC |
|
|
ORDER BY alarms.StartTime DESC |
|
|
${limit ? 'LIMIT ' + limit : ''} |
|
|
${limit ? 'LIMIT ' + limit : ''} |
|
|