perf(go): simplify realtime plate lookup

This commit is contained in:
lingniu
2026-07-03 07:57:04 +08:00
parent 0aa71402d1
commit 2af2ba3367
3 changed files with 24 additions and 2 deletions

View File

@@ -288,7 +288,7 @@ func (r *BindingPlateResolver) PlateByVIN(ctx context.Context, vin string) (stri
if vin == "" {
return "", sql.ErrNoRows
}
query := "SELECT plate FROM " + r.table + " WHERE vin = ? AND plate IS NOT NULL AND plate <> '' ORDER BY updated_at DESC LIMIT 1"
query := "SELECT plate FROM " + r.table + " WHERE vin = ? AND plate IS NOT NULL AND plate <> ''"
var plate string
err := r.queryer.QueryRowContext(ctx, query, vin).Scan(&plate)
if err != nil {