fix: 트렌드 운전음영 500 수정 — runbands @area 타입 미지정(42P08)
- GetRunBandsAsync: @area NULL 파라미터 타입 추론 실패(42P08) → @area::text 캐스트 - from/to UTC 정규화(ToUniversalTime)로 타임존 시프트 방지 - 검증: 동일 SQL bands 정상 반환, 연속 RUN은 next 이벤트 없으면 to까지 밴드 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -212,14 +212,14 @@ public class TrendService : ITrendService
|
|||||||
FROM event_history_table
|
FROM event_history_table
|
||||||
WHERE event_time >= @from AND event_time <= @to
|
WHERE event_time >= @from AND event_time <= @to
|
||||||
AND event_type IN ('RUN', 'TRIP')
|
AND event_type IN ('RUN', 'TRIP')
|
||||||
AND (@area IS NULL OR area ILIKE '%'||@area||'%' OR sub_area ILIKE '%'||@area||'%')
|
AND (@area::text IS NULL OR area ILIKE '%'||@area::text||'%' OR sub_area ILIKE '%'||@area::text||'%')
|
||||||
ORDER BY tagname, event_time
|
ORDER BY tagname, event_time
|
||||||
""";
|
""";
|
||||||
await using var conn = NewConn();
|
await using var conn = NewConn();
|
||||||
await conn.OpenAsync(ct);
|
await conn.OpenAsync(ct);
|
||||||
await using var cmd = new NpgsqlCommand(sql, conn);
|
await using var cmd = new NpgsqlCommand(sql, conn);
|
||||||
cmd.Parameters.AddWithValue("from", from);
|
cmd.Parameters.AddWithValue("from", from.ToUniversalTime()); // 타임존 시프트 방지
|
||||||
cmd.Parameters.AddWithValue("to", to);
|
cmd.Parameters.AddWithValue("to", to.ToUniversalTime());
|
||||||
cmd.Parameters.AddWithValue("area", (object?)area ?? DBNull.Value);
|
cmd.Parameters.AddWithValue("area", (object?)area ?? DBNull.Value);
|
||||||
|
|
||||||
var bands = new List<TrendBandDto>();
|
var bands = new List<TrendBandDto>();
|
||||||
|
|||||||
Reference in New Issue
Block a user