Здравствуйте!
Пытаюсь получить архив ошибок устройства за период:
curl -X GET --location "http://lers-api.someserver.ru:10000/api/v1/Data/MeasurePoints/277/DeviceErrors/2025-09-01T00:00:00/2025-09-30T00:00:00?dataTypes=128" -H "Authorization: bearer <token>"
Сервер возвращает пустой массив:
{
"monthArchive": null,
"dayArchive": null,
"hourArchive": []
}
При этом в базе ЛЭРС события на приборе абсолютно точно есть:
| EquipId | Title | SerialNumber | MeasurePoint_ID | EventCode | StartDateTime | EndDateTime | Description | HeatLeadIn | ArchiveType | ChannelNumber | Importance |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 279 | SA-94/2 | 17006 | 277 | 22 | 2025-09-15 10:44:00.000 | null | Q2 < Q2min | 0 | 0 | 0 | null |
| 279 | SA-94/2 | 17006 | 277 | 16 | 2025-09-15 10:44:00.000 | null | dT < dTmin | 0 | 0 | 0 | null |
| 279 | SA-94/2 | 17006 | 277 | 1 | 2025-09-15 10:41:36.000 | 2025-09-15 10:41:37.000 | Выключение питания | 0 | 0 | 0 | null |
| 279 | SA-94/2 | 17006 | 277 | 22 | 2025-09-06 08:54:00.000 | null | Q2 < Q2min | 0 | 0 | 0 | null |
| 279 | SA-94/2 | 17006 | 277 | 16 | 2025-09-06 08:54:00.000 | null | dT < dTmin | 0 | 0 | 0 | null |
| 279 | SA-94/2 | 17006 | 277 | 1 | 2025-09-06 08:51:18.000 | 2025-09-06 08:51:19.000 | Выключение питания | 0 | 0 | 0 | null |
Код SQL запроса
select e.Id as EquipId, em.Title, e.SerialNumber, mp.MeasurePoint_ID, de.EventCode, de.StartDateTime, de.EndDateTime,
de.Description, de.HeatLeadIn, de.ArchiveType, de.ChannelNumber, de.Importance
from dbo.DeviceEvent as de
inner join dbo.Equipment as e on (de.EquipmentId = e.Id)
inner join dbo.DeviceMeasurePoint as dmp on (e.Id = dmp.EquipmentId)
inner join dbo.MeasurePoint as mp on (dmp.MeasurePointID = mp.MeasurePoint_ID) and
(mp.MeasurePoint_ID = @id)
left join dbo.EquipmentModel as em on (e.EquipmentModelId = em.Id)
where (de.StartDateTime between @start and @end)
order by e.Id, de.StartDateTime desc, mp.MeasurePoint_ID
Где мной может быть допущена ошибка?
Версия ЛЭРС: 3.61, сборка 36113