|
|
@ -41,7 +41,7 @@ async function list (ctx) { |
|
|
|
ctx, pepProjectId, projectOrStructKeyword, |
|
|
|
}) |
|
|
|
let whereOption = [] |
|
|
|
if (anxinStrucIds.length) { |
|
|
|
if (anxinStrucIds.length ||1) { |
|
|
|
whereOption.push(`alarms.StructureId IN (${anxinStrucIds.join(",")})`) |
|
|
|
|
|
|
|
if (groupId) { |
|
|
@ -87,10 +87,7 @@ async function list (ctx) { |
|
|
|
LEFT JOIN ${anxinyun}.t_alarm_code |
|
|
|
ON ${anxinyun}.t_alarm_code.code = alarms.AlarmTypeCode |
|
|
|
|
|
|
|
${whereOption.length ? 'WHERE ' + whereOption.join(' AND ') : ''} |
|
|
|
ORDER BY alarms.StartTime DESC |
|
|
|
${limit ? 'LIMIT ' + limit : ''} |
|
|
|
${limit && page ? 'OFFSET ' + parseInt(limit) * parseInt(page) : ''} |
|
|
|
|
|
|
|
`).toPromise();
|
|
|
|
|
|
|
|
// alarm_details.Time, alarm_details.Content
|
|
|
|