-- ============================================================
-- TPMS Sample Data — Run this in phpMyAdmin SQL tab
-- ============================================================
-- یوزر دیتابیس cPanel: نام واقعی دیتابیس را جایگزین کن
--
-- قبل از اجرا: دیتابیس را در ستون چپ انتخاب کن (USE)
-- ============================================================

-- Trucks
INSERT INTO `trucks` (`truck_code`, `description`) VALUES
  ('T101', 'دامپتراک ۱۰۱ - معدن ۱'),
  ('T102', 'دامپتراک ۱۰۲ - معدن ۱'),
  ('T103', 'دامپتراک ۱۰۳ - معدن ۲'),
  ('T104', 'دامپتراک ۱۰۴ - معدن ۲'),
  ('T105', 'دامپتراک ۱۰۵ - معدن ۳')
ON DUPLICATE KEY UPDATE `description` = VALUES(`description`);


-- ===== T101: batch 1 =====
-- Readings for T101 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.1,22.7,116.6,24.4,116.1,21.5,116.1,24.5,119.4,23.6,116.0,22.0,'2026-07-04 22:50:45'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,29.1,118.2,29.2,118.9,30.4,116.5,30.5,118.3,30.6,117.4,28.8,'2026-07-04 09:59:12'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,22.7,117.0,23.3,116.4,24.8,117.5,22.0,120.0,24.5,116.3,22.4,'2026-07-05 01:51:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.7,27.4,118.0,28.3,118.9,27.9,119.5,30.4,119.7,29.5,116.8,30.2,'2026-07-01 10:25:33'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,25.0,119.8,21.4,118.9,24.3,116.0,21.7,117.7,23.1,118.9,21.0,'2026-07-04 23:20:09'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,22.1,120.0,22.9,117.2,21.9,119.3,21.0,116.7,23.3,117.9,22.5,'2026-07-03 02:33:21'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,30.1,119.4,27.8,119.5,28.0,118.7,28.3,117.2,28.9,118.3,29.8,'2026-07-05 08:20:02'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.4,27.4,117.4,30.7,120.0,27.3,118.1,27.4,119.1,28.3,119.6,30.6,'2026-07-03 07:03:57'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,27.6,118.7,29.6,116.6,27.3,116.6,28.5,116.8,29.7,116.4,29.8,'2026-07-01 08:42:31'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,24.4,117.5,22.0,143.0,21.3,118.9,22.8,119.5,24.1,116.3,24.7,'2026-07-05 02:45:20'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,27.3,119.3,28.0,117.1,27.4,117.5,29.5,117.5,30.7,118.6,30.7,'2026-07-02 11:55:46'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,23.0,117.9,23.9,116.4,21.0,116.6,21.4,116.8,23.2,118.3,22.8,'2026-07-03 03:19:12'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.9,30.3,117.9,27.6,116.7,27.6,117.8,30.8,120.0,28.6,116.3,27.5,'2026-07-02 15:09:32'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.0,23.1,117.6,22.0,118.7,24.5,116.9,24.4,119.5,21.9,118.3,21.2,'2026-07-05 18:25:56'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,23.2,118.6,24.9,117.5,22.0,118.6,21.1,118.6,22.5,116.6,23.4,'2026-07-03 06:35:34'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,29.9,117.4,28.4,118.1,28.7,117.7,29.2,119.4,29.1,117.6,28.1,'2026-07-03 14:29:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,24.8,118.0,23.7,118.4,24.6,118.7,21.0,117.2,23.3,118.1,24.9,'2026-07-05 20:07:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,28.9,117.8,30.5,118.4,28.1,119.5,27.0,119.7,30.8,118.8,28.3,'2026-07-02 15:47:54'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,22.8,118.1,21.5,117.9,22.4,116.2,22.5,116.4,23.9,117.2,23.4,'2026-07-04 05:50:50'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,23.7,119.3,23.9,116.7,23.9,119.3,24.5,118.8,24.9,118.7,24.5,'2026-07-06 05:39:30'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,28.6,117.7,30.3,118.8,27.4,118.1,29.0,116.9,28.4,117.3,27.4,'2026-06-30 13:00:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,27.3,119.7,27.1,118.4,30.0,118.4,29.6,119.8,28.4,119.1,27.1,'2026-06-30 15:33:47'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,29.9,119.4,27.1,116.1,27.5,118.9,28.1,117.3,29.9,118.4,28.7,'2026-07-01 09:30:28'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,24.0,118.2,22.4,116.2,21.1,116.1,24.9,116.7,24.6,117.6,23.3,'2026-07-03 05:47:39'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,22.9,117.9,24.6,118.5,22.2,120.0,22.5,119.8,21.7,116.2,23.2,'2026-07-04 21:54:48'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,29.1,119.1,27.6,118.9,27.9,117.7,30.9,119.0,29.9,117.7,29.0,'2026-07-05 11:11:18'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.7,23.8,119.9,23.4,118.0,22.1,117.6,23.1,117.7,24.5,116.5,22.5,'2026-07-05 06:01:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),142.0,30.1,118.5,28.5,119.0,30.5,119.5,29.1,117.9,28.6,118.0,27.7,'2026-07-03 09:16:27'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,22.3,119.7,24.3,117.2,22.8,116.0,24.4,116.3,24.5,150.0,24.1,'2026-07-04 01:20:41'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,29.1,119.0,27.7,116.4,30.6,116.9,30.6,117.5,27.7,119.8,30.9,'2026-06-30 11:50:16'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,22.9,117.9,24.6,116.6,22.3,116.5,22.0,117.0,21.0,119.0,22.8,'2026-06-30 20:03:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.9,21.4,120.0,24.7,118.7,21.7,117.7,21.9,117.9,24.8,117.8,23.8,'2026-07-02 20:55:33'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.7,30.2,119.8,27.2,119.8,28.6,119.6,30.7,117.7,30.6,119.0,30.3,'2026-07-01 10:02:04'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.7,23.7,116.5,24.0,116.6,22.0,117.8,23.5,118.9,21.5,118.5,92.0,'2026-07-04 02:24:39'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,22.2,119.1,25.0,117.7,24.5,119.1,21.7,137.0,22.0,117.4,21.7,'2026-07-01 06:54:23'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.1,28.8,119.0,30.0,118.4,28.2,116.8,27.4,118.6,29.1,116.0,28.8,'2026-07-04 10:25:34'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,29.8,119.5,30.4,117.2,28.5,118.6,27.2,118.4,29.4,116.9,30.1,'2026-06-30 08:39:19'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,23.8,116.0,21.9,116.9,21.4,118.1,24.9,118.1,24.4,119.1,24.4,'2026-07-02 06:34:23'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.4,21.5,120.0,21.6,116.1,21.2,118.2,23.3,118.6,24.6,117.1,21.5,'2026-07-02 19:34:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.1,30.7,144.0,29.9,119.4,28.0,119.7,28.9,117.6,29.9,118.4,30.0,'2026-07-03 09:07:36'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.6,22.8,118.5,22.7,116.3,24.8,117.8,22.4,120.0,22.2,116.8,25.0,'2026-07-01 22:43:09'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,23.8,116.8,21.5,118.6,22.1,118.3,24.3,117.0,22.6,117.8,23.1,'2026-07-05 19:47:27'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,28.4,118.5,30.5,116.0,28.6,117.6,30.7,118.3,27.6,119.9,30.5,'2026-07-05 09:20:27'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,29.9,118.6,27.7,117.9,30.1,119.4,27.8,119.4,29.6,118.6,27.6,'2026-07-05 12:51:37'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.2,23.3,117.5,23.3,119.4,23.2,116.7,23.9,120.0,24.8,118.1,22.5,'2026-07-02 21:47:36'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.4,24.5,117.4,23.1,119.8,21.0,116.8,24.4,116.1,21.8,117.5,24.7,'2026-07-03 19:30:11'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,29.6,119.0,29.8,116.6,29.8,116.2,30.3,116.1,27.3,118.7,27.6,'2026-07-05 16:00:40'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,29.0,117.7,30.9,118.0,29.4,118.9,30.2,116.7,30.5,118.8,28.4,'2026-07-05 09:52:04'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,27.6,117.6,29.3,119.0,27.4,118.7,27.6,116.8,30.5,119.5,29.1,'2026-07-01 11:08:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,22.8,119.6,24.2,117.4,21.6,116.7,22.7,119.5,24.9,116.1,24.8,'2026-07-01 04:05:03');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T101'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T101'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T101'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T101'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T101'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا');

-- ===== T101: batch 2 =====
-- Readings for T101 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.1,22.1,118.1,23.2,119.6,23.5,116.1,21.5,118.6,23.9,118.0,24.6,'2026-07-03 01:22:25'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,30.9,118.8,29.7,117.7,28.3,118.7,27.7,119.1,30.3,118.5,30.8,'2026-07-04 09:57:27'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,28.6,119.1,29.7,117.4,30.2,118.2,27.4,118.7,27.1,118.0,30.6,'2026-07-03 17:44:50'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,21.7,117.0,24.9,118.3,21.5,118.7,24.7,117.9,23.1,116.4,24.2,'2026-07-01 05:36:41'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.2,23.2,116.9,22.5,117.1,24.8,116.4,22.1,118.9,24.6,119.6,25.0,'2026-07-03 22:47:42'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,29.8,117.9,28.7,116.4,28.9,118.3,28.8,116.5,30.9,119.7,30.5,'2026-07-02 11:11:29'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,24.6,119.0,24.2,116.6,23.1,117.1,21.2,118.8,24.3,118.3,22.8,'2026-07-05 19:19:29'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,29.1,118.4,28.8,119.8,27.9,116.9,29.2,118.5,27.8,117.9,30.5,'2026-07-05 16:01:15'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.3,21.5,118.3,21.1,117.3,23.1,117.4,21.8,116.6,24.2,119.3,21.2,'2026-07-04 18:03:03'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.8,29.4,119.9,28.0,118.3,28.5,118.8,28.4,119.0,28.2,118.8,29.9,'2026-07-04 17:06:10'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.3,23.6,119.8,21.8,119.0,23.3,119.3,21.7,117.7,23.8,118.7,21.5,'2026-06-30 04:47:29'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.2,21.1,118.3,22.5,117.4,21.1,118.1,21.9,119.0,21.8,79.0,21.0,'2026-06-30 19:52:23'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.8,30.3,117.5,28.9,120.0,30.9,119.1,30.8,119.6,28.5,116.0,30.9,'2026-06-29 15:25:22'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,24.3,119.3,24.4,119.5,21.1,120.0,23.4,116.1,23.2,120.0,21.6,'2026-07-04 00:42:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,21.2,117.1,23.9,117.1,21.8,118.9,21.2,117.2,21.2,118.5,24.4,'2026-07-02 06:25:13'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,23.2,118.1,22.7,118.5,23.8,117.1,24.1,119.3,22.7,116.5,23.7,'2026-07-03 23:36:38'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,29.0,117.8,28.9,117.0,29.8,118.2,30.9,116.3,27.4,119.2,28.0,'2026-06-29 16:23:33'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.2,21.8,118.3,23.3,119.8,21.9,118.3,23.8,119.3,23.3,117.5,21.7,'2026-06-30 23:38:47'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,24.5,118.8,22.3,119.1,22.2,118.8,22.1,116.5,23.0,119.5,24.4,'2026-06-30 00:28:09'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,28.1,116.7,28.2,119.1,27.1,118.9,30.5,116.4,28.9,119.0,30.3,'2026-07-04 09:23:48'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.4,27.8,118.8,29.9,119.5,31.0,116.8,29.7,116.7,30.3,118.0,28.4,'2026-06-29 07:49:18'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,22.6,117.7,21.8,116.5,24.2,119.7,21.9,119.8,23.1,116.1,21.5,'2026-07-02 20:32:18'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.6,28.3,120.0,27.1,117.8,28.9,118.5,28.9,117.0,29.8,118.1,30.8,'2026-06-29 07:16:36'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.2,29.5,119.5,27.6,117.7,29.8,117.8,29.4,117.0,29.0,117.2,28.0,'2026-07-02 10:15:57'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,24.1,119.2,23.9,118.2,21.3,119.0,22.8,118.7,21.8,118.5,23.3,'2026-06-30 05:59:57'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,29.3,119.2,29.8,119.9,30.9,118.5,29.3,118.3,27.9,119.2,27.2,'2026-06-29 11:37:57'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,24.3,119.2,21.8,117.0,23.5,117.9,24.7,119.4,24.1,116.1,23.3,'2026-07-02 06:16:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.7,22.9,120.0,21.1,119.7,24.6,119.0,22.0,118.4,21.9,119.6,21.7,'2026-07-01 05:56:50'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,23.6,119.9,24.0,116.3,21.8,119.0,24.3,118.9,24.4,117.6,24.9,'2026-07-01 05:17:42'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.5,22.9,117.9,22.8,119.1,23.0,117.7,22.8,118.4,23.5,116.9,22.8,'2026-07-02 22:00:25'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.2,29.8,117.3,28.2,119.5,28.7,119.7,28.5,119.3,28.4,118.6,29.1,'2026-07-05 08:15:16'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.0,30.5,119.0,30.0,117.8,29.0,116.5,30.6,116.2,28.1,116.2,29.5,'2026-07-04 15:14:00'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.2,21.0,118.1,22.8,119.3,24.1,119.2,23.9,118.1,22.0,117.1,21.0,'2026-07-02 18:57:36'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,28.1,118.5,29.7,116.6,28.1,117.5,27.0,117.7,29.1,116.0,28.6,'2026-06-29 09:53:43'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,29.9,119.2,28.9,117.8,29.3,116.8,30.0,119.8,29.3,119.0,30.4,'2026-07-05 13:10:42'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.8,27.5,118.3,27.4,119.5,30.2,117.0,29.0,117.3,30.7,118.8,27.3,'2026-07-03 07:11:38'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.6,21.3,117.9,21.1,117.3,24.7,116.4,24.4,116.4,24.0,116.8,23.6,'2026-06-30 18:13:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,23.4,119.4,21.8,117.1,24.4,117.4,21.0,118.9,24.4,117.4,22.5,'2026-06-30 20:37:39'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,21.2,116.1,22.5,116.2,23.8,116.3,22.5,117.4,24.4,116.3,21.8,'2026-07-04 00:22:28'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.0,30.6,118.0,28.5,119.3,28.4,119.5,30.7,120.0,29.7,118.2,29.4,'2026-06-29 07:28:09'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,21.9,119.4,24.0,116.9,23.9,118.6,24.5,117.6,22.3,118.8,23.3,'2026-07-01 06:00:36'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,22.7,116.2,21.4,119.5,22.3,78.0,22.9,119.0,22.5,118.5,22.5,'2026-07-03 23:47:30'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.9,30.4,118.3,30.2,119.0,29.0,118.6,27.2,116.9,27.1,119.7,29.6,'2026-07-01 16:23:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,30.6,118.1,28.6,119.1,29.9,117.0,27.8,119.4,27.3,116.4,27.3,'2026-07-03 12:16:32'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.4,27.9,118.3,27.3,119.9,95.0,118.6,27.0,119.4,28.8,118.7,28.1,'2026-07-03 11:51:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.5,28.2,118.2,28.7,118.5,29.9,117.4,28.9,116.2,27.5,119.0,27.3,'2026-07-04 11:54:14'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.1,29.7,116.6,30.3,119.6,30.0,117.7,30.4,118.0,27.1,118.5,27.4,'2026-07-05 07:11:22'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,30.4,116.8,27.5,116.3,27.6,118.1,30.8,118.5,29.0,118.8,30.1,'2026-06-29 10:12:41'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.7,28.1,116.5,30.9,116.4,27.5,120.0,27.9,116.6,27.5,118.3,28.7,'2026-07-01 17:55:21'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,24.5,116.1,21.5,147.0,23.0,116.5,24.5,119.6,24.3,116.8,22.7,'2026-07-01 01:44:30');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T101'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T101'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا');

-- ===== T101: batch 3 =====
-- Readings for T101 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,29.7,116.4,29.3,120.0,30.1,116.6,27.8,118.1,30.9,118.8,29.1,'2026-07-05 12:50:44'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,29.0,119.0,29.0,118.0,28.8,119.6,28.5,118.5,29.3,119.7,30.4,'2026-07-04 15:37:28'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.9,22.3,116.4,23.6,117.9,22.5,118.7,23.4,119.0,24.7,118.6,24.4,'2026-07-05 23:26:01'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.8,25.0,117.5,23.2,119.6,23.5,118.7,21.6,119.2,24.3,117.4,23.8,'2026-06-29 18:53:18'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,23.2,117.8,23.6,116.9,23.2,117.3,24.3,118.8,23.8,116.7,21.1,'2026-06-30 05:30:08'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.5,30.3,119.5,29.7,118.5,31.0,118.7,29.5,117.2,29.8,117.3,28.3,'2026-07-04 07:24:07'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.6,27.6,118.3,29.0,119.1,30.3,118.4,30.9,118.2,29.9,117.9,30.9,'2026-07-05 13:03:02'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,28.5,116.9,30.2,119.6,29.4,119.4,28.1,116.8,28.1,116.3,29.2,'2026-07-02 12:03:05'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,24.5,119.1,23.6,117.0,21.5,117.4,22.8,117.8,22.0,119.1,24.5,'2026-07-03 22:26:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.4,23.3,118.8,24.4,117.5,22.9,117.6,23.2,116.7,22.5,118.2,24.9,'2026-07-03 01:14:43'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,28.3,119.4,28.7,117.8,28.8,119.2,27.6,118.6,27.3,116.8,27.8,'2026-07-04 14:43:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.5,30.1,120.0,29.6,116.5,29.5,118.3,29.9,116.0,27.5,118.2,27.4,'2026-07-03 07:10:05'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,24.1,118.1,24.5,119.1,23.1,116.2,21.6,116.1,21.7,118.9,21.0,'2026-07-01 02:07:51'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,28.0,116.5,29.3,117.0,27.3,117.4,29.7,116.0,28.3,117.4,88.0,'2026-07-04 16:51:04'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.7,21.8,116.5,21.6,117.9,21.8,116.8,21.9,119.9,22.0,120.0,21.9,'2026-07-04 20:08:53'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,21.5,116.7,24.7,118.7,23.0,116.5,22.5,119.8,22.8,117.9,22.3,'2026-06-30 22:25:11'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,27.3,117.5,30.1,120.0,30.8,116.0,29.3,119.6,29.6,119.0,27.4,'2026-07-01 13:10:04'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,21.2,118.5,24.2,118.6,23.7,119.4,24.4,117.9,21.5,116.9,24.4,'2026-07-03 02:54:23'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,29.7,116.3,28.5,118.9,30.9,117.1,27.7,116.0,28.0,119.3,28.6,'2026-07-05 12:00:58'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,21.1,119.3,21.4,120.0,21.4,116.3,24.1,117.0,22.6,82.0,22.4,'2026-07-03 00:59:25'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,29.3,116.2,30.5,118.6,28.4,118.0,28.7,116.7,30.2,117.4,30.3,'2026-07-05 17:52:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.9,28.8,116.5,30.5,117.8,30.6,117.5,29.9,117.2,30.4,116.0,29.6,'2026-07-05 11:11:50'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.1,21.0,117.9,21.6,118.6,24.1,116.9,22.7,119.3,23.6,116.5,24.7,'2026-07-06 04:28:44'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.4,30.7,116.8,28.5,118.5,29.0,116.4,28.2,116.6,27.9,118.0,29.6,'2026-07-01 12:24:37'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,22.9,116.5,22.0,119.8,21.2,116.9,21.5,118.5,24.2,117.1,21.1,'2026-07-03 18:47:42'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.5,28.5,116.8,27.7,117.4,27.8,120.0,27.5,116.4,27.1,118.8,27.8,'2026-06-29 13:20:25'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,21.2,119.6,23.7,116.1,23.4,117.3,22.1,116.9,21.2,117.8,24.1,'2026-07-02 06:42:09'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,28.7,119.3,28.5,116.1,29.4,119.4,30.1,118.0,29.4,119.8,28.4,'2026-07-05 13:30:43'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,24.0,117.4,22.0,117.7,24.4,116.3,22.4,118.4,23.2,117.1,22.1,'2026-07-02 21:26:45'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.7,21.1,119.6,24.6,119.1,24.4,116.5,21.3,NULL,NULL,119.9,22.2,'2026-07-01 22:46:13'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.0,21.3,116.9,21.7,116.4,23.3,119.7,21.6,117.0,23.7,118.0,22.1,'2026-07-04 03:35:04'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.4,24.7,117.8,90.0,119.6,21.2,119.9,22.4,119.1,21.9,118.2,23.0,'2026-07-01 23:20:26'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,23.1,117.5,21.4,116.0,21.3,117.0,23.6,119.4,23.4,119.6,22.4,'2026-07-05 05:25:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,21.1,116.4,23.1,116.4,24.5,118.1,24.8,116.1,23.7,118.7,22.0,'2026-07-05 21:32:29'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,24.5,117.6,22.8,118.5,24.6,116.3,23.3,120.0,24.8,117.3,22.0,'2026-07-03 23:56:12'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,28.9,117.6,27.5,118.3,29.4,117.6,29.8,117.7,30.6,116.6,27.5,'2026-06-30 13:20:10'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.7,22.4,119.3,23.6,119.0,24.6,116.5,23.5,119.2,24.6,119.9,21.9,'2026-07-01 06:41:28'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,22.3,118.7,21.5,120.0,21.9,116.4,21.5,118.0,22.7,116.0,24.9,'2026-07-04 04:55:08'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,21.9,116.6,21.6,117.8,24.4,117.6,23.4,119.0,21.2,119.9,24.8,'2026-07-04 22:30:00'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.1,28.5,117.7,29.3,117.9,28.9,116.6,28.4,118.8,29.0,116.5,28.2,'2026-07-01 11:59:26'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.1,30.3,119.2,28.0,118.5,27.8,119.6,27.1,117.2,27.3,118.3,28.2,'2026-07-01 08:40:35'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.5,25.0,117.5,23.3,119.0,24.7,117.6,21.5,117.0,24.6,117.4,22.4,'2026-06-30 04:08:41'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,27.1,116.0,30.0,119.8,27.0,117.9,28.7,118.2,29.9,119.3,30.9,'2026-07-01 07:59:45'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.3,24.5,117.9,21.6,117.7,25.0,117.9,22.2,116.3,24.8,116.8,21.1,'2026-06-30 02:17:03'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,23.5,119.6,22.2,119.4,25.0,118.2,24.2,119.5,22.1,117.6,24.5,'2026-07-03 03:42:36'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,22.4,117.9,23.6,117.6,24.7,119.0,21.3,119.9,21.4,116.7,23.4,'2026-07-02 05:30:48'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,28.2,118.9,27.9,116.5,30.1,118.0,31.0,117.3,28.0,116.5,27.8,'2026-07-04 11:21:22'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.7,30.0,117.2,29.3,119.3,85.0,117.4,29.2,119.2,30.7,116.2,28.9,'2026-07-01 09:46:36'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.8,24.3,116.8,23.1,117.2,22.0,118.5,21.1,116.8,22.3,117.0,21.7,'2026-06-29 23:43:43'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,25.0,116.3,24.8,116.1,21.3,118.4,21.7,116.9,22.3,117.9,23.6,'2026-07-05 20:23:26');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T101'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T101'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T101'), 5, 'SENSOR_FAULT', 'WARNING', 'لاستیک 5 — قطع سنسور'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T101'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا');

-- ===== T101: batch 4 =====
-- Readings for T101 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.9,24.8,116.6,24.2,116.7,21.6,117.6,24.3,118.6,22.8,117.3,80.0,'2026-07-03 00:38:13'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.6,24.1,119.2,21.4,117.6,22.4,117.6,23.9,116.2,22.8,118.7,21.7,'2026-07-04 23:06:29'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.0,27.8,118.2,29.8,116.5,29.3,118.5,29.5,118.4,30.0,117.0,27.7,'2026-07-05 17:54:26'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,29.6,119.6,29.8,118.2,30.9,116.8,30.0,118.6,29.8,118.0,27.0,'2026-07-04 08:50:46'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.6,28.4,118.1,30.3,116.6,29.7,118.2,29.4,119.9,27.3,119.2,30.0,'2026-06-29 07:18:44'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.1,29.0,116.3,30.2,118.5,28.5,119.6,29.8,118.0,27.7,116.1,27.6,'2026-07-05 09:28:03'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.0,27.5,120.0,28.9,118.9,29.1,117.4,29.9,119.8,30.0,118.8,27.7,'2026-06-29 15:20:13'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.1,23.2,117.8,24.5,116.2,22.0,118.6,21.6,116.7,23.5,117.2,23.1,'2026-07-06 06:38:01'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,23.9,116.8,24.1,119.5,23.7,119.2,22.1,116.8,21.6,118.0,24.2,'2026-07-04 19:23:00'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.7,23.5,118.8,21.8,119.2,22.9,118.0,24.5,119.9,22.8,116.8,22.1,'2026-07-03 06:58:07'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,29.2,118.6,30.4,116.0,30.3,116.3,27.3,117.0,28.8,116.3,28.8,'2026-07-02 09:22:23'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,21.6,119.5,22.4,117.5,24.2,117.8,21.3,118.0,24.5,117.2,24.9,'2026-07-01 22:47:59'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.4,25.0,119.7,24.4,117.2,22.8,116.4,22.1,116.7,23.4,117.6,21.8,'2026-06-30 22:13:18'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.1,23.9,116.9,23.0,120.0,24.9,119.6,24.5,118.0,24.3,116.4,24.2,'2026-07-06 05:37:45'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,29.2,118.1,29.1,119.9,30.3,116.0,27.7,119.9,30.9,118.0,29.4,'2026-07-01 09:46:11'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.6,30.4,119.3,29.3,119.1,27.2,118.0,30.2,119.4,30.4,120.0,28.3,'2026-07-01 14:52:44'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,24.4,118.7,21.4,118.9,23.1,117.1,22.6,117.4,22.6,118.5,23.7,'2026-07-05 01:00:09'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.4,21.0,119.7,21.2,119.2,21.6,119.8,21.5,118.4,23.5,117.0,24.4,'2026-07-04 20:48:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,31.0,118.3,27.0,116.7,27.2,119.4,30.5,118.2,28.3,119.2,27.9,'2026-06-29 16:19:11'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,21.7,116.3,24.5,117.8,21.4,119.7,24.1,117.5,21.6,117.2,23.0,'2026-07-03 05:39:26'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.7,27.9,118.0,29.7,117.4,29.7,118.1,30.0,117.9,30.1,119.8,27.5,'2026-07-02 14:14:21'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.4,28.2,116.4,27.4,120.0,27.1,119.7,28.3,119.4,30.4,118.3,29.5,'2026-07-04 14:29:42'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,23.9,118.3,24.2,119.9,22.0,117.0,22.1,116.9,24.0,119.1,22.4,'2026-07-02 18:30:50'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,24.3,119.0,23.9,118.0,21.6,117.7,22.6,118.4,23.4,116.4,24.3,'2026-07-05 18:48:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.3,29.5,89.0,30.0,117.0,28.4,117.3,27.9,116.7,28.4,116.7,30.0,'2026-07-03 14:20:58'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,27.1,119.7,28.0,119.6,27.9,117.1,30.3,119.6,31.0,117.8,27.5,'2026-07-04 08:18:26'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,28.0,116.9,30.7,119.2,28.6,118.9,30.8,118.4,27.8,119.2,29.6,'2026-06-30 13:57:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,24.9,119.4,24.2,116.8,91.0,119.3,23.6,119.3,23.7,118.4,23.2,'2026-07-04 03:35:44'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,29.7,117.4,27.5,118.6,28.6,116.0,30.6,118.4,28.3,118.3,27.6,'2026-06-29 07:27:58'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.6,24.4,117.7,23.5,119.5,24.0,119.0,22.6,118.5,21.8,117.4,23.8,'2026-07-03 05:23:51'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,24.2,119.5,24.9,79.0,23.4,119.0,24.8,117.4,23.3,118.4,23.5,'2026-07-05 02:03:55'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.1,94.0,117.8,28.2,119.3,28.4,118.3,28.5,116.5,28.7,118.5,29.5,'2026-07-05 14:32:10'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,30.5,119.7,29.2,117.4,30.8,118.5,30.6,119.2,27.6,118.1,27.7,'2026-07-05 11:17:14'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.6,22.6,119.6,24.0,118.9,23.9,119.0,21.7,117.4,22.4,118.2,24.3,'2026-06-29 18:35:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.5,22.8,118.1,21.4,118.0,23.2,117.1,22.2,117.5,22.6,117.5,24.9,'2026-07-03 02:34:02'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,24.1,119.4,21.2,118.0,24.1,119.6,22.7,119.2,22.7,116.8,21.3,'2026-07-04 20:21:23'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.2,30.2,117.1,29.9,87.0,29.0,119.7,27.6,117.6,28.1,119.0,30.9,'2026-06-29 17:45:48'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,23.6,118.5,22.7,119.6,22.4,117.5,24.5,150.0,21.9,116.8,25.0,'2026-07-01 03:47:28'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,28.6,118.5,27.6,117.6,30.0,118.1,28.6,117.6,29.2,119.8,28.2,'2026-06-30 09:32:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.1,22.8,119.1,23.8,117.8,23.9,117.0,25.0,120.0,24.9,116.4,21.5,'2026-06-29 18:26:31'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,28.7,118.8,29.3,118.8,29.6,116.8,28.5,116.5,28.3,116.4,30.0,'2026-07-02 10:58:34'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.3,27.5,116.5,29.4,117.8,29.8,117.0,27.1,118.0,30.0,117.7,30.5,'2026-07-01 11:38:07'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.1,24.7,120.0,24.6,119.4,22.9,117.4,21.5,86.0,21.9,117.8,24.0,'2026-06-29 18:11:40'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,28.9,141.0,30.8,118.6,30.5,118.4,29.4,120.0,28.5,119.9,28.7,'2026-06-30 07:59:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,22.2,117.8,21.7,117.7,24.9,116.9,21.3,116.6,22.8,85.0,22.4,'2026-07-03 00:58:24'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,24.1,116.2,23.1,116.9,21.3,119.4,24.0,117.6,23.4,117.5,23.4,'2026-07-01 04:52:08'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,23.9,117.3,24.0,118.0,22.0,119.5,24.3,117.9,22.2,117.3,21.7,'2026-07-05 21:30:46'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,22.7,117.5,21.0,119.0,24.8,117.5,22.0,118.1,25.0,116.9,24.4,'2026-07-06 02:53:05'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.0,30.5,118.8,28.2,116.8,28.6,118.8,30.5,117.2,30.6,118.9,28.7,'2026-07-03 11:30:07'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,27.4,117.6,94.0,118.4,28.1,118.3,30.9,119.4,29.4,119.5,27.9,'2026-06-29 13:45:28');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T101'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T101'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T101'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T101'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T101'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T101'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T101'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T101'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا');

-- ===== T101: batch 5 =====
-- Readings for T101 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.7,27.6,116.8,28.1,119.1,28.2,118.4,30.1,117.6,27.3,116.4,27.0,'2026-07-02 09:28:38'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,29.9,119.5,29.6,116.3,30.9,116.4,28.9,119.3,27.6,118.4,28.2,'2026-06-30 08:08:28'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,28.1,116.6,31.0,118.7,27.6,118.5,30.2,119.8,29.8,119.5,29.0,'2026-06-29 09:14:27'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.0,24.8,118.4,24.5,84.0,23.8,119.8,21.1,117.9,21.0,118.0,21.1,'2026-07-01 01:51:20'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.5,24.2,116.9,21.6,116.8,22.6,117.4,22.6,118.5,24.6,118.0,24.0,'2026-07-02 22:53:42'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,30.8,119.6,29.4,118.1,29.2,116.7,28.4,116.0,31.0,117.9,30.3,'2026-06-29 07:26:01'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.0,30.2,118.5,29.8,116.5,28.4,116.9,27.8,116.3,30.5,119.2,29.7,'2026-07-04 11:42:18'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,30.5,119.6,28.2,119.3,28.5,118.7,29.0,116.7,29.6,118.0,29.2,'2026-07-04 15:59:22'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,29.2,118.8,30.9,117.4,28.2,116.5,27.7,119.9,27.9,116.0,29.1,'2026-07-02 14:29:19'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,21.1,117.3,22.3,119.5,24.0,116.1,23.4,116.2,22.6,119.9,22.7,'2026-06-30 20:11:01'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.4,23.4,118.3,21.6,118.4,22.4,116.6,23.0,116.5,22.1,119.5,21.1,'2026-07-06 04:50:45'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.1,30.1,118.2,29.2,119.2,28.7,118.4,27.1,117.4,27.9,116.8,27.5,'2026-07-02 14:27:25'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,28.5,117.9,30.8,117.3,27.8,117.2,27.8,119.3,27.8,116.9,30.6,'2026-07-03 13:01:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.4,27.7,116.9,27.1,118.6,29.6,120.0,28.7,116.8,28.1,119.9,28.7,'2026-06-29 12:56:11'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.4,27.1,119.0,27.8,118.3,28.1,116.8,28.0,116.0,28.7,117.2,28.3,'2026-07-03 11:38:43'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.9,24.1,117.5,23.7,118.4,23.0,119.6,24.8,116.2,24.3,116.2,22.5,'2026-06-30 23:19:21'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.5,23.4,116.3,22.2,117.9,22.8,119.9,21.3,118.9,23.8,117.1,24.7,'2026-07-05 19:50:26'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.5,29.6,118.9,30.7,118.9,27.5,117.0,27.7,120.0,29.3,119.2,30.9,'2026-07-04 15:51:45'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.2,28.0,116.9,28.0,116.3,29.6,118.8,28.8,116.8,28.2,116.0,29.9,'2026-07-01 16:24:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.8,24.1,119.0,23.9,119.8,21.0,119.9,25.0,116.3,22.1,116.2,21.9,'2026-07-06 05:35:55'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.1,27.5,117.1,28.0,119.8,30.6,118.9,30.7,117.9,29.0,116.4,29.7,'2026-07-02 16:20:46'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,27.7,119.3,29.6,119.9,27.3,120.0,30.3,119.8,28.8,117.6,30.3,'2026-06-30 14:08:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.9,30.6,119.1,30.1,89.0,28.8,120.0,27.7,119.9,29.6,119.5,31.0,'2026-07-04 17:29:30'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.6,21.4,118.0,21.0,118.5,24.6,117.1,22.2,119.0,24.0,119.0,21.9,'2026-07-02 21:14:37'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.1,23.9,116.3,24.3,118.0,24.5,118.1,23.2,116.1,23.1,117.0,24.6,'2026-06-29 18:52:13'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,23.0,116.5,24.1,117.9,22.3,118.3,21.2,118.8,24.2,119.2,21.9,'2026-07-04 21:14:24'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,23.0,119.3,21.8,118.4,24.3,116.2,24.8,116.2,21.6,117.9,21.1,'2026-06-29 22:45:21'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.0,22.2,118.0,23.8,117.0,22.7,119.5,24.2,119.5,23.0,117.8,24.6,'2026-07-03 18:09:05'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.4,23.8,116.3,21.6,118.5,22.1,120.0,23.8,117.2,24.4,118.9,24.6,'2026-07-02 04:36:31'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,29.9,118.9,30.0,119.9,28.6,118.1,29.0,119.0,27.7,117.0,28.8,'2026-06-30 14:52:42'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,21.6,116.6,23.0,117.9,24.4,117.5,24.9,119.0,23.4,119.7,23.7,'2026-07-04 18:10:02'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.4,22.5,119.6,24.1,118.0,24.5,117.9,23.5,119.8,23.4,116.3,21.5,'2026-07-02 03:36:01'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,27.9,119.9,30.6,118.0,28.9,117.9,29.7,116.5,30.7,118.5,27.8,'2026-07-06 07:13:11'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,27.0,118.2,27.7,117.5,29.7,118.0,29.4,117.3,28.1,118.4,29.3,'2026-06-29 15:23:57'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,93.0,118.7,21.8,118.6,23.9,118.7,24.9,119.5,23.8,118.7,24.8,'2026-07-04 18:42:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,28.7,118.3,27.2,118.3,27.7,116.5,27.9,117.7,29.9,119.9,27.5,'2026-07-03 10:18:54'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,30.4,151.0,29.1,119.0,30.6,117.8,28.8,119.8,28.9,116.3,31.0,'2026-07-05 08:31:50'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,30.9,116.8,30.2,117.6,27.8,117.6,27.0,119.7,27.9,117.1,28.6,'2026-07-05 16:14:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.3,21.2,116.9,24.8,119.1,23.6,118.8,25.0,118.2,21.3,116.7,21.3,'2026-07-04 02:36:32'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.0,30.4,118.4,30.0,118.7,27.0,118.4,29.0,116.2,27.6,118.7,30.9,'2026-07-02 15:29:38');
SET @first = LAST_INSERT_ID();
SET @last = @first + 40 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T101'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T101'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T101'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا');


-- ===== T102: batch 1 =====
-- Readings for T102 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.4,24.4,120.4,26.0,114.0,28.5,115.3,25.0,111.8,21.1,118.7,25.4,'2026-07-02 05:42:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.4,84.0,120.6,22.5,118.7,22.6,120.2,23.3,114.2,24.7,118.8,24.5,'2026-07-03 23:02:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.2,29.0,113.7,31.8,114.3,30.3,115.5,34.8,112.3,28.8,120.8,28.3,'2026-07-02 09:04:31'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.4,21.9,118.7,21.2,111.0,21.4,117.2,26.0,117.2,27.1,113.8,27.9,'2026-07-05 01:11:20'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.5,34.2,117.2,30.8,112.1,31.6,114.0,32.8,113.5,29.2,115.4,30.8,'2026-06-30 10:51:41'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.2,22.0,115.4,85.0,117.2,25.9,116.9,27.3,116.7,79.0,118.1,22.5,'2026-07-01 22:37:52'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.8,27.8,113.9,21.4,111.2,27.0,116.1,22.6,114.9,22.2,120.5,21.8,'2026-06-29 22:54:14'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.6,28.8,118.4,25.3,116.1,25.1,119.9,22.7,113.7,21.5,114.5,24.5,'2026-06-30 06:28:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.0,23.1,113.5,22.7,137.0,25.8,113.0,21.0,118.5,24.6,119.0,22.6,'2026-07-01 19:31:28'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.7,26.2,113.4,28.6,112.1,29.0,118.3,21.0,117.7,22.2,119.9,27.4,'2026-06-29 22:54:48'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.5,21.6,119.0,27.3,111.5,21.6,118.5,24.2,116.8,83.0,115.0,21.3,'2026-07-03 18:39:27'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.6,34.5,117.1,29.9,112.2,30.0,117.8,29.8,111.6,32.5,118.8,29.2,'2026-07-03 10:44:15'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),119.0,25.5,78.0,21.4,116.9,26.8,115.8,24.7,118.8,23.1,115.9,22.1,'2026-07-03 22:43:18'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.5,33.0,118.4,30.1,113.8,34.5,151.0,32.3,111.4,32.4,114.2,32.7,'2026-07-03 16:13:48'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.2,23.7,114.1,21.2,149.0,28.3,114.7,26.1,119.0,80.0,117.9,25.2,'2026-07-06 03:39:18'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.8,27.9,114.0,28.9,111.7,27.5,113.6,22.4,111.5,25.6,113.8,28.1,'2026-07-03 00:41:30'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.0,27.9,120.4,23.6,115.1,25.5,118.4,24.5,116.7,27.2,119.0,27.8,'2026-07-02 05:43:05'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.7,28.9,113.8,23.4,112.0,26.0,113.9,22.3,112.8,27.3,121.0,21.2,'2026-07-02 18:08:43'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.6,33.0,91.0,30.7,115.2,32.2,117.1,33.2,118.0,32.6,116.9,29.1,'2026-06-29 17:34:09'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,21.6,115.1,28.9,114.6,23.3,153.0,23.0,112.6,26.6,120.1,21.4,'2026-07-01 18:56:57'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.7,32.7,116.8,28.5,117.3,28.8,114.9,27.0,117.4,31.2,116.7,34.3,'2026-07-04 12:10:54'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.3,22.4,114.7,85.0,116.7,84.0,120.4,27.7,114.5,23.5,118.7,22.1,'2026-06-30 22:30:03'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.0,34.7,117.6,32.0,115.7,31.9,117.4,30.9,112.1,29.7,118.3,32.6,'2026-06-30 08:24:54'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.3,22.7,114.8,23.6,117.7,25.2,117.8,22.1,114.4,26.3,120.2,22.7,'2026-07-01 03:49:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.0,27.2,120.4,24.8,113.8,21.3,116.8,27.0,114.6,26.3,116.1,21.3,'2026-07-02 18:57:40'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.6,31.6,116.3,35.0,112.5,31.7,116.3,29.0,148.0,28.7,117.5,27.6,'2026-07-05 11:50:18'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.5,29.4,114.2,34.6,115.0,30.8,117.6,28.2,112.8,27.1,119.2,32.2,'2026-07-05 08:53:46'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.7,22.9,120.1,28.8,117.8,28.0,118.3,26.8,112.6,21.2,117.6,22.7,'2026-07-05 01:26:32'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),82.0,23.2,114.6,22.8,113.6,22.6,114.4,21.9,116.5,94.0,120.5,21.7,'2026-06-29 22:54:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.8,24.8,114.5,28.7,113.3,25.4,116.5,28.4,117.4,28.8,114.2,28.4,'2026-07-05 18:40:01'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,23.1,114.2,23.7,117.0,25.6,114.3,23.3,116.4,23.7,117.0,22.5,'2026-07-03 23:28:52'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),150.0,24.6,114.4,25.9,114.9,26.6,118.4,23.4,117.0,25.7,119.2,22.3,'2026-06-30 06:51:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.5,22.8,114.3,23.1,115.3,23.5,114.5,23.9,114.5,28.4,118.1,25.5,'2026-07-05 06:30:49'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.2,33.5,114.3,28.5,119.0,28.7,113.8,33.3,115.8,34.7,120.9,34.9,'2026-07-01 09:28:15'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.3,26.9,119.2,27.4,117.9,27.9,118.5,22.5,115.8,87.0,115.1,27.2,'2026-06-29 23:49:39'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.2,28.4,120.0,33.9,113.0,33.4,120.5,31.8,114.6,31.1,114.6,31.6,'2026-07-01 13:56:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),119.0,25.3,117.5,26.2,114.1,24.0,113.8,24.9,117.8,25.1,118.4,28.2,'2026-07-05 23:26:18'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.0,28.5,120.3,25.9,117.2,22.2,119.3,27.4,113.1,28.8,115.5,27.3,'2026-07-06 01:19:51'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.8,90.0,115.8,34.9,118.4,28.2,120.2,33.7,111.9,30.8,119.9,31.0,'2026-07-05 09:20:05'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.8,94.0,115.3,28.3,116.9,24.4,120.8,26.5,111.7,27.6,116.0,22.9,'2026-06-30 01:09:41'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.2,25.0,115.6,26.2,113.0,24.2,149.0,22.4,117.2,28.1,113.4,23.5,'2026-07-01 00:27:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.5,28.0,119.2,21.2,115.0,28.7,118.2,25.6,116.0,22.7,119.4,22.5,'2026-07-03 04:00:36'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.2,27.3,114.5,25.0,115.9,24.0,114.3,23.2,116.2,89.0,114.4,25.0,'2026-06-29 22:16:49'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.5,28.8,116.9,27.2,111.4,27.6,116.0,30.2,115.6,28.5,118.6,31.9,'2026-07-03 07:31:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.8,22.1,116.8,23.6,116.6,29.0,118.2,21.4,117.2,27.0,117.2,26.4,'2026-07-03 04:50:38'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.3,33.4,80.0,31.1,119.0,32.6,118.1,29.5,112.0,28.4,114.6,34.6,'2026-07-04 08:34:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.7,33.1,115.2,34.5,113.5,28.0,117.8,34.3,118.1,34.8,118.9,29.5,'2026-07-02 10:14:30'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.1,34.9,114.1,31.7,111.1,33.7,118.8,33.3,113.4,30.4,114.6,32.5,'2026-07-05 16:46:23'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.4,26.3,113.3,24.7,116.7,24.1,118.8,22.0,115.1,26.0,118.4,28.6,'2026-07-02 20:51:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.6,31.2,117.5,34.7,118.6,27.5,117.8,30.8,112.6,34.1,115.1,33.4,'2026-07-05 14:09:38');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد');

-- ===== T102: batch 2 =====
-- Readings for T102 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.6,28.1,90.0,30.3,114.5,31.6,116.3,34.8,117.6,31.0,119.2,28.9,'2026-06-30 14:56:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.6,23.4,113.4,27.0,116.5,22.4,113.5,26.6,117.2,26.8,114.8,22.5,'2026-06-30 23:07:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.3,23.1,120.2,28.4,111.0,27.7,113.9,24.1,115.2,21.3,114.5,26.0,'2026-07-02 20:31:07'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.1,22.9,119.1,26.8,111.0,25.2,118.7,25.1,118.2,87.0,117.1,21.7,'2026-07-05 00:22:42'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.1,32.1,118.1,28.1,115.9,32.1,114.9,28.5,114.9,34.7,117.7,33.5,'2026-07-01 16:11:07'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.0,30.4,118.4,31.7,116.4,28.1,118.9,29.8,117.3,33.7,116.7,32.9,'2026-07-01 14:14:03'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.8,28.9,116.8,30.1,91.0,34.0,118.4,32.2,118.2,30.2,119.4,27.2,'2026-06-30 12:09:33'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.3,26.0,116.8,25.0,116.7,28.9,115.3,23.7,118.7,24.3,119.8,21.2,'2026-07-04 02:58:30'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.1,26.8,120.7,27.2,118.8,25.6,118.0,24.8,113.4,22.4,115.4,21.3,'2026-07-04 05:15:07'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.5,35.0,114.1,30.8,116.4,27.2,118.6,33.2,118.4,30.1,118.0,27.6,'2026-07-03 08:51:00'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.3,27.3,120.0,24.7,117.5,28.5,119.2,23.9,116.4,28.3,118.3,27.0,'2026-07-01 01:30:22'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.7,26.5,115.4,27.0,113.8,28.5,120.7,26.9,115.9,26.3,117.6,27.0,'2026-07-02 02:16:16'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,22.1,115.5,23.0,116.3,27.3,113.6,21.2,113.0,23.2,113.4,21.8,'2026-07-03 18:55:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.5,34.1,117.3,31.5,118.1,30.4,119.5,34.7,116.6,32.8,114.3,34.8,'2026-07-03 13:14:43'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.1,21.5,114.5,23.6,114.7,26.6,114.2,22.9,112.7,22.5,118.3,21.0,'2026-07-05 01:36:08'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,27.4,118.3,25.6,117.7,26.3,118.4,26.2,117.6,25.6,113.1,27.6,'2026-07-02 03:51:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.1,29.1,113.4,94.0,114.7,32.3,120.0,30.8,115.4,27.1,120.8,28.8,'2026-07-02 11:34:48'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.9,28.9,117.4,26.1,112.0,21.4,114.6,27.6,112.1,27.5,115.0,21.2,'2026-07-03 19:31:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.0,24.8,114.4,21.7,117.4,25.5,114.5,26.7,116.8,25.3,120.4,28.2,'2026-07-03 03:55:28'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.6,23.9,120.3,22.7,114.1,22.3,117.6,26.8,116.2,22.0,114.6,27.0,'2026-06-29 19:56:31'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.1,28.5,116.3,28.4,116.6,27.2,115.0,22.8,116.8,22.6,119.7,22.5,'2026-06-29 21:59:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.0,28.1,120.7,26.2,114.7,21.5,116.9,25.7,112.8,22.8,116.9,24.6,'2026-07-05 21:46:33'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.0,28.5,113.5,32.3,116.7,31.3,120.7,28.6,116.8,32.7,117.1,28.1,'2026-06-30 08:54:07'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.9,29.9,113.5,32.6,113.1,27.3,116.9,34.1,112.0,29.4,113.6,34.2,'2026-07-01 07:57:38'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.2,22.5,113.2,24.5,118.4,26.6,117.1,26.1,111.2,25.3,119.7,25.0,'2026-06-30 04:52:10'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.9,23.1,114.1,22.9,113.1,21.7,113.3,21.7,112.8,26.2,114.5,21.6,'2026-07-05 02:20:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.3,33.5,114.4,30.4,116.2,27.8,115.9,27.2,112.2,30.1,114.6,30.8,'2026-07-03 10:23:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.6,22.8,116.1,27.8,118.1,26.7,120.9,24.7,111.7,27.1,117.8,25.4,'2026-06-30 05:30:43'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,21.5,113.8,24.8,112.7,28.1,115.6,28.8,115.3,24.3,116.4,24.1,'2026-06-30 02:37:46'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.8,34.6,80.0,27.0,116.2,34.1,118.0,33.8,111.9,33.8,118.6,28.5,'2026-07-03 17:55:29'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.9,23.2,113.1,22.5,146.0,21.1,115.4,22.1,113.8,23.9,113.4,24.5,'2026-07-01 23:00:30'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.0,23.5,114.4,24.5,118.0,23.4,120.7,28.2,111.8,22.6,115.9,27.6,'2026-07-03 18:22:22'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.8,28.8,118.8,21.0,111.6,25.1,116.5,22.5,115.6,27.6,115.8,21.6,'2026-07-06 00:32:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.0,21.0,120.3,21.3,116.4,21.9,117.2,24.9,111.3,88.0,116.2,24.1,'2026-06-30 20:31:59'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.6,25.2,113.9,28.6,119.0,26.7,113.7,21.4,111.8,22.6,113.7,24.8,'2026-07-02 04:00:28'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.7,28.1,118.1,22.2,118.6,28.9,118.4,28.9,111.3,26.8,114.3,22.3,'2026-07-05 01:36:51'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.3,22.6,118.3,27.1,114.1,22.7,116.9,28.4,115.5,24.9,114.8,22.8,'2026-07-03 22:52:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.7,21.1,114.8,21.7,118.1,21.6,115.5,23.5,117.0,26.9,120.4,28.2,'2026-07-02 18:29:42'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.2,23.0,82.0,27.3,116.9,28.9,117.2,25.8,111.0,25.6,120.1,22.4,'2026-07-01 05:19:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.5,21.3,115.8,24.3,138.0,24.1,113.2,22.7,112.4,25.3,116.0,25.7,'2026-07-01 22:26:32'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.9,26.5,114.8,22.6,115.8,25.7,116.1,21.5,117.8,24.7,113.6,29.0,'2026-06-29 21:47:42'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.4,27.2,119.0,28.8,117.5,25.7,117.1,25.7,117.3,27.0,120.4,21.4,'2026-06-30 03:13:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.0,26.0,117.8,28.3,114.2,28.0,116.7,26.6,111.5,26.9,118.7,26.9,'2026-06-30 19:35:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.0,24.4,115.9,24.3,112.0,24.7,114.0,24.5,111.9,25.6,115.5,25.2,'2026-06-30 06:21:13'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.4,28.7,119.9,24.3,115.4,26.1,113.1,27.0,112.9,26.0,115.6,27.0,'2026-07-02 23:19:48'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.9,32.9,115.4,32.4,113.6,32.6,117.7,28.7,111.1,33.3,117.3,29.8,'2026-06-29 14:18:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),79.0,30.8,114.9,31.2,118.7,34.3,115.6,32.0,117.0,28.3,116.8,28.1,'2026-07-01 09:47:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.4,28.7,113.8,25.9,117.7,21.8,113.1,23.1,116.0,23.0,118.3,27.1,'2026-07-04 03:32:00'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.6,23.6,119.0,23.0,118.5,23.5,116.5,23.5,111.8,26.1,117.2,28.2,'2026-07-03 19:07:55'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.5,28.1,118.8,31.4,114.8,32.0,115.2,32.3,116.5,32.8,120.2,28.2,'2026-06-29 07:27:46');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد');

-- ===== T102: batch 3 =====
-- Readings for T102 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.0,30.5,113.8,29.7,118.0,28.5,114.3,33.4,116.7,29.1,118.9,27.3,'2026-07-03 09:27:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.8,31.3,118.0,27.4,112.7,31.1,118.9,27.8,116.6,28.7,115.0,29.1,'2026-06-30 16:44:03'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.7,22.5,113.9,21.1,115.5,95.0,115.7,26.6,117.6,22.3,113.6,28.6,'2026-07-04 03:38:58'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.1,25.7,77.0,26.3,113.8,22.2,115.1,23.1,115.1,25.1,115.6,27.9,'2026-07-03 20:30:47'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.7,28.3,118.1,31.0,113.8,27.8,120.9,31.7,116.2,30.8,114.3,33.8,'2026-07-03 11:34:47'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.1,30.2,121.0,31.9,112.7,31.2,117.0,92.0,115.8,33.5,120.5,27.1,'2026-06-29 09:28:50'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.9,24.0,120.9,22.0,114.7,23.5,113.4,24.0,116.6,25.2,113.5,27.6,'2026-07-04 19:08:22'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.3,23.9,116.1,23.6,114.1,23.8,137.0,23.3,113.4,21.6,115.6,22.6,'2026-07-02 19:15:17'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.0,27.4,116.9,23.1,113.2,28.7,118.7,23.5,112.0,25.6,118.6,26.4,'2026-07-03 19:44:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.1,27.2,114.0,30.8,113.2,30.2,116.6,31.8,115.2,28.7,115.4,27.0,'2026-07-04 09:52:14'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.2,26.1,117.7,25.9,87.0,21.9,120.2,23.0,114.2,25.4,117.7,21.7,'2026-07-01 18:15:47'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.1,33.1,121.0,27.3,114.3,34.7,116.2,30.1,113.0,27.1,117.9,32.0,'2026-07-03 07:23:25'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.6,29.4,118.4,30.2,117.8,31.8,114.1,28.3,115.4,28.8,118.0,30.9,'2026-07-05 07:52:13'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.0,28.2,119.7,32.3,113.1,29.2,115.5,33.2,116.7,34.2,113.7,29.3,'2026-06-30 08:02:55'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.6,35.0,115.1,28.0,114.5,27.8,119.1,33.2,111.7,79.0,114.2,94.0,'2026-07-01 08:12:15'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.2,27.0,117.3,25.7,115.0,24.0,117.8,28.8,115.2,22.2,118.1,22.7,'2026-07-03 01:50:35'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.5,24.1,119.0,27.5,115.1,21.2,117.1,26.6,118.8,22.0,119.0,22.2,'2026-06-29 20:42:59'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.8,27.6,119.4,21.4,114.8,28.0,118.7,22.4,114.1,23.7,114.1,22.3,'2026-07-03 22:27:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.1,31.9,116.2,33.0,112.7,33.8,117.2,29.8,118.6,27.8,117.8,34.1,'2026-07-04 08:36:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.8,30.3,114.1,31.3,112.4,34.3,117.8,34.3,118.5,33.8,118.4,31.0,'2026-07-03 11:18:01'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.6,28.7,113.1,27.8,114.7,23.8,120.6,24.6,111.4,28.6,114.5,24.5,'2026-07-04 18:29:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),119.0,29.7,117.8,27.7,90.0,29.8,118.0,30.8,113.0,27.2,119.0,31.4,'2026-06-30 11:57:49'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,24.6,120.0,26.0,118.4,21.6,118.8,23.0,117.1,24.7,115.5,21.1,'2026-06-29 21:31:39'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.8,25.8,115.1,21.7,113.2,21.6,117.3,28.5,116.1,24.1,119.2,24.8,'2026-07-05 01:34:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.1,32.9,116.5,35.0,112.5,28.4,119.5,29.8,118.3,33.1,120.5,29.3,'2026-07-01 17:56:19'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.8,28.3,119.8,23.3,116.0,28.1,119.7,27.2,117.8,22.5,114.5,23.3,'2026-07-01 00:57:43'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.1,26.7,114.6,28.3,91.0,24.2,116.8,25.6,111.0,24.1,119.6,24.7,'2026-07-06 05:43:22'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.0,33.6,120.7,33.8,111.5,30.0,115.7,28.7,115.5,30.5,113.9,34.0,'2026-06-30 08:25:18'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.1,32.8,118.4,28.8,114.4,29.4,119.5,34.7,115.0,32.5,116.1,27.9,'2026-07-04 07:42:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.2,27.8,117.2,30.4,114.5,27.1,115.8,31.8,112.5,29.2,120.5,33.2,'2026-06-29 15:32:58'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,34.0,113.6,29.1,113.3,31.4,119.8,34.0,117.1,82.0,114.6,28.8,'2026-06-29 08:37:13'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.7,30.1,118.8,29.3,116.9,33.4,119.6,29.9,114.9,32.2,114.0,27.9,'2026-07-05 15:52:32'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.3,27.7,119.3,27.1,117.5,28.7,119.8,28.5,111.0,32.4,140.0,33.7,'2026-07-04 07:10:51'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.8,23.2,119.5,25.5,115.8,23.1,116.1,27.9,114.7,24.8,113.0,29.0,'2026-06-29 22:47:18'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.5,27.4,119.2,27.7,115.2,83.0,118.1,31.5,113.5,28.0,118.2,86.0,'2026-07-02 14:29:18'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.0,32.0,115.3,33.8,116.6,32.6,118.5,27.0,148.0,28.4,117.2,27.4,'2026-07-03 13:25:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.4,28.5,114.6,31.1,116.1,33.4,117.9,28.6,111.2,28.6,116.0,27.6,'2026-06-30 11:40:07'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.5,27.1,118.4,24.1,113.3,24.1,116.3,24.1,117.0,22.3,115.3,23.4,'2026-07-06 04:56:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),79.0,28.5,118.4,27.2,111.6,31.8,115.9,29.8,117.5,32.4,116.4,31.6,'2026-07-04 11:57:14'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.1,25.0,113.0,21.6,114.6,27.0,118.5,23.3,115.2,24.8,120.0,22.6,'2026-07-01 05:30:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.5,27.7,116.5,23.6,112.3,22.6,113.5,28.5,113.4,23.4,113.9,27.9,'2026-07-01 22:00:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),88.0,33.8,120.0,30.2,118.1,31.4,114.5,32.5,117.4,27.2,114.6,30.7,'2026-06-30 13:09:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.0,27.3,113.9,23.1,118.1,25.9,115.3,21.0,111.1,27.5,119.7,24.3,'2026-07-03 23:52:35'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),84.0,22.5,113.5,22.8,81.0,24.4,NULL,NULL,115.4,29.0,114.0,28.0,'2026-07-03 01:03:46'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),142.0,27.7,116.5,81.0,115.8,30.2,120.0,29.6,114.4,29.6,118.0,28.9,'2026-07-02 17:22:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.7,22.8,115.3,26.8,113.4,28.2,116.6,21.2,116.0,28.7,118.4,24.1,'2026-07-01 00:53:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.2,33.7,113.1,34.7,112.4,27.1,113.5,28.6,112.8,35.0,113.1,28.3,'2026-07-01 10:02:08'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.5,22.7,118.6,23.0,114.1,21.7,119.9,87.0,112.3,27.5,113.0,23.8,'2026-07-05 06:31:32'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.5,30.6,117.9,28.4,113.8,28.3,113.9,34.8,112.0,27.5,119.7,31.2,'2026-07-04 12:20:49'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.8,34.9,114.3,30.4,114.3,27.9,114.9,28.8,117.1,27.8,116.5,28.8,'2026-07-04 11:31:07');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا');

-- ===== T102: batch 4 =====
-- Readings for T102 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.9,25.5,118.2,28.7,114.1,25.9,119.8,27.3,115.9,22.0,120.3,23.8,'2026-07-04 02:17:58'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.6,21.2,114.7,22.4,112.7,24.7,120.0,26.3,111.7,22.7,114.8,25.8,'2026-07-06 06:26:19'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.7,21.6,113.9,27.1,111.3,22.8,113.9,21.1,112.9,23.3,119.7,24.8,'2026-07-01 03:34:05'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.1,24.6,113.4,28.7,111.1,26.0,118.8,28.0,118.3,27.4,115.0,24.4,'2026-06-30 21:57:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.7,26.1,115.3,28.1,116.9,27.1,117.8,23.1,116.4,23.4,117.6,28.7,'2026-07-04 18:49:33'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.6,29.0,120.6,27.1,137.0,29.5,120.2,34.2,117.1,27.5,116.9,27.1,'2026-07-03 09:30:19'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.4,29.4,117.5,28.6,116.2,33.4,114.9,27.3,118.5,27.4,118.9,28.0,'2026-07-01 11:18:28'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.7,28.8,119.4,33.6,117.6,31.3,116.7,31.6,111.5,31.9,120.7,27.9,'2026-07-03 11:49:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.2,21.1,120.0,22.1,113.1,24.7,117.6,25.5,116.8,24.3,118.6,22.7,'2026-06-30 06:21:34'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.5,31.6,120.9,28.6,118.9,31.0,119.4,32.7,92.0,34.9,113.1,28.9,'2026-06-30 09:03:28'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.2,32.1,118.9,28.1,117.8,32.9,114.3,32.0,115.2,27.8,119.2,29.7,'2026-07-04 09:11:34'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.8,21.4,114.8,90.0,111.7,25.6,115.7,91.0,114.4,24.2,113.8,24.5,'2026-07-02 22:11:27'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.3,27.7,115.3,21.6,115.3,24.8,118.3,27.1,113.0,26.5,117.9,21.1,'2026-06-30 19:47:15'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.9,28.4,117.0,21.1,112.8,27.3,139.0,24.3,116.7,28.4,115.4,26.3,'2026-07-03 21:26:19'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.7,31.4,120.3,27.1,114.8,30.9,119.3,32.8,117.9,32.4,114.4,29.2,'2026-07-01 17:18:08'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.6,29.0,118.5,30.6,112.2,28.1,113.2,34.8,118.9,33.9,120.4,27.4,'2026-06-29 14:16:20'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.8,32.8,119.0,28.5,116.9,32.2,118.0,27.0,117.4,30.6,136.0,32.3,'2026-07-03 17:33:42'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.3,22.9,119.6,28.6,118.3,26.5,115.4,28.8,118.3,26.4,115.2,26.1,'2026-07-06 02:45:00'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.9,22.2,114.5,29.0,119.0,24.3,93.0,23.6,112.9,21.3,114.0,28.3,'2026-06-30 23:52:16'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.8,35.0,115.8,30.8,115.8,30.3,114.8,35.0,112.3,28.4,114.3,28.8,'2026-07-04 17:14:55'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.9,27.3,115.6,26.0,116.2,21.9,115.6,26.3,93.0,23.0,121.0,28.7,'2026-07-05 04:15:01'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.4,27.1,113.0,23.0,112.5,23.4,119.6,27.5,82.0,22.4,114.0,22.6,'2026-07-02 03:25:22'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.4,28.0,119.3,26.5,113.4,24.2,116.5,26.0,118.5,24.9,119.2,26.5,'2026-07-05 04:29:07'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.0,28.9,115.5,28.2,111.8,86.0,120.5,26.2,117.7,25.5,117.1,26.4,'2026-07-03 00:08:34'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.7,31.7,141.0,27.1,116.9,34.2,120.1,27.8,117.7,29.7,120.7,27.9,'2026-07-05 10:06:56'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),150.0,25.0,113.5,24.5,113.1,28.6,120.3,21.2,118.3,21.0,118.1,21.4,'2026-07-01 00:30:38'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.3,21.2,118.3,24.8,116.1,22.0,120.8,21.6,116.8,27.3,114.5,25.7,'2026-07-05 19:52:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.6,27.1,118.5,29.8,115.7,33.8,84.0,30.3,111.9,30.3,117.8,30.4,'2026-07-03 14:01:28'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.5,28.6,120.4,32.2,117.6,33.7,119.2,30.5,113.8,28.1,114.0,31.5,'2026-06-30 17:05:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.9,21.9,113.1,23.7,117.2,22.3,119.7,27.5,114.9,26.8,114.3,22.6,'2026-07-03 19:18:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.9,27.5,113.8,24.5,118.3,22.3,114.4,24.0,114.4,21.3,117.5,24.3,'2026-06-30 19:29:35'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.5,23.7,119.5,25.2,112.2,21.6,118.4,23.4,118.6,24.5,118.5,22.3,'2026-07-02 00:02:21'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),142.0,22.4,113.8,27.8,118.9,26.1,116.4,27.3,115.4,24.6,113.0,22.2,'2026-07-04 22:55:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.9,30.0,115.1,29.3,137.0,33.0,115.1,27.1,118.4,27.0,114.4,27.5,'2026-06-30 12:24:27'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.9,27.7,114.2,22.2,116.7,27.2,116.2,27.2,115.5,24.8,120.6,27.1,'2026-07-02 18:36:47'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.8,26.2,114.8,25.5,116.5,25.6,117.8,22.3,117.9,26.7,115.2,24.3,'2026-07-06 01:14:10'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.0,28.5,116.9,23.4,115.3,28.8,120.2,25.4,117.3,22.8,116.7,28.9,'2026-07-02 06:48:21'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),81.0,27.8,116.6,34.5,111.0,32.5,113.6,30.2,117.4,34.1,116.4,28.8,'2026-06-30 09:28:32'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.7,29.8,116.1,31.9,112.2,30.3,115.2,34.2,118.4,28.7,114.7,32.3,'2026-07-05 07:45:46'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.8,28.2,115.3,25.8,112.2,22.7,119.4,25.5,116.3,26.2,113.3,26.3,'2026-07-05 06:20:29'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.1,34.4,139.0,34.2,116.1,27.0,119.6,32.8,114.4,28.3,116.7,34.2,'2026-07-02 15:11:46'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.5,34.4,113.6,29.6,117.3,28.7,114.9,30.8,111.0,33.2,113.8,27.0,'2026-07-05 13:32:43'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.2,24.1,119.4,26.6,114.8,26.1,116.0,27.9,116.6,28.8,113.2,23.3,'2026-06-29 23:51:51'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.1,33.5,119.0,33.1,118.5,33.3,117.9,28.3,112.8,27.3,117.9,92.0,'2026-07-03 09:10:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.5,22.7,116.5,21.1,117.4,23.6,117.9,27.5,115.5,28.2,114.7,24.5,'2026-07-05 18:51:22'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.8,33.1,115.3,34.3,117.7,30.3,120.4,31.4,111.8,27.5,115.9,28.2,'2026-07-01 12:32:00'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.1,29.9,116.0,28.3,115.9,32.3,116.2,28.4,116.6,31.7,115.2,31.1,'2026-06-30 12:30:29'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.3,34.1,118.6,30.6,116.5,33.7,120.4,27.3,113.6,27.4,117.6,32.2,'2026-07-04 16:28:17'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.3,27.7,120.3,27.0,118.1,22.7,121.0,25.8,112.6,27.6,115.9,21.6,'2026-07-02 04:02:03'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.7,30.2,115.0,30.6,117.6,34.8,113.7,33.9,143.0,30.3,92.0,31.2,'2026-07-03 14:01:21');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T102'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد');

-- ===== T102: batch 5 =====
-- Readings for T102 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.7,30.0,120.2,34.8,111.4,31.4,120.6,34.8,90.0,28.6,119.4,29.8,'2026-07-02 07:16:04'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),92.0,27.2,120.7,31.8,118.0,33.1,114.6,32.5,112.4,32.6,117.7,31.5,'2026-07-02 14:53:47'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),152.0,29.9,120.2,85.0,111.7,27.9,116.6,27.5,114.1,30.7,114.5,27.9,'2026-07-05 14:24:08'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.3,25.5,118.6,24.8,114.7,24.1,119.9,27.4,116.2,28.9,114.7,27.6,'2026-07-03 19:18:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.5,31.7,113.4,30.0,116.8,28.4,116.4,30.5,112.0,27.7,119.3,27.2,'2026-07-03 17:52:57'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.8,23.6,135.0,21.6,118.7,25.3,120.5,23.7,118.9,26.5,113.7,22.3,'2026-07-05 18:20:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.8,26.9,119.6,24.3,114.0,22.6,116.5,22.0,146.0,25.3,116.4,24.2,'2026-07-02 19:33:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.5,24.9,89.0,23.2,111.4,25.5,115.7,26.2,114.5,28.8,118.6,23.3,'2026-07-06 03:40:46'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.3,22.6,120.9,21.6,113.3,27.4,113.5,28.0,114.3,24.2,117.5,27.9,'2026-07-03 03:40:36'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.3,21.9,113.9,24.0,116.3,21.9,114.8,21.3,115.2,26.2,116.7,28.9,'2026-07-02 01:24:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.9,28.5,117.0,27.5,118.4,25.4,120.4,21.4,112.0,21.9,120.2,27.4,'2026-07-02 18:33:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.8,22.5,113.6,28.7,116.6,25.0,116.7,24.1,115.6,23.9,114.4,24.0,'2026-07-01 05:29:56'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.6,28.0,117.6,33.1,116.3,29.9,114.6,33.8,118.4,28.7,117.3,31.0,'2026-07-01 07:52:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.8,28.3,88.0,23.3,114.3,28.0,114.2,22.6,111.3,23.1,119.7,25.9,'2026-06-30 04:10:26'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.1,30.0,117.3,34.5,111.5,27.9,118.7,32.2,116.5,30.7,115.3,34.5,'2026-07-01 10:05:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.9,21.0,118.8,25.8,118.5,24.5,116.8,27.3,117.7,28.4,116.6,25.1,'2026-07-05 06:52:05'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.5,29.6,120.8,31.0,112.5,30.6,115.1,30.6,118.7,28.3,114.8,28.2,'2026-07-04 13:33:52'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.3,28.6,86.0,27.8,113.6,24.6,118.6,27.6,112.4,22.5,116.3,22.1,'2026-07-04 06:05:30'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.5,22.0,113.9,25.1,116.8,29.0,91.0,25.0,115.0,23.4,121.0,21.4,'2026-07-04 21:21:05'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.7,34.5,115.5,30.3,113.3,33.3,114.1,33.6,111.0,32.5,115.6,29.2,'2026-07-03 07:38:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),119.0,34.4,119.7,29.3,114.7,33.2,120.6,31.5,113.8,28.4,116.6,32.3,'2026-07-01 16:30:21'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.4,23.2,114.4,25.4,117.1,27.2,113.3,24.7,116.2,21.7,117.0,26.2,'2026-07-01 03:31:21'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.3,27.6,117.3,27.5,118.3,29.1,114.4,34.8,137.0,27.2,117.2,31.5,'2026-07-01 11:08:59'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.6,29.6,115.0,33.8,114.7,29.0,115.7,34.0,111.4,27.2,144.0,32.0,'2026-07-05 16:56:19'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.9,29.0,116.4,22.5,116.1,22.6,114.0,21.9,116.3,21.2,120.7,22.9,'2026-07-06 00:12:42'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.4,34.7,118.4,33.5,116.8,29.5,120.3,33.0,113.8,32.2,147.0,33.4,'2026-07-01 13:21:01'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.9,22.3,113.3,26.0,117.1,28.2,114.8,29.0,113.1,23.6,116.1,22.0,'2026-07-01 18:42:21'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),143.0,34.2,118.2,30.9,111.4,31.1,113.0,30.4,117.2,33.9,116.0,31.1,'2026-06-30 13:21:08'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.0,28.3,114.6,27.1,113.1,29.5,113.4,32.4,117.7,33.2,118.3,32.1,'2026-06-29 13:40:27'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.4,33.6,120.2,29.1,113.6,34.8,120.7,30.2,115.2,28.7,119.0,27.1,'2026-07-02 17:34:29'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.8,27.0,114.2,33.8,118.9,32.9,83.0,29.8,114.6,32.4,120.9,32.1,'2026-06-30 14:13:56'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.9,28.5,116.5,23.2,117.6,28.5,120.3,28.5,81.0,27.0,114.1,28.8,'2026-07-03 20:15:55'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.1,92.0,118.4,33.0,112.5,30.0,117.9,33.0,115.0,33.7,115.7,29.1,'2026-07-06 07:12:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.5,34.1,116.2,28.5,115.4,29.2,118.9,31.4,118.1,29.4,113.1,29.5,'2026-07-04 13:39:20'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.5,24.9,116.2,27.4,111.4,24.5,116.2,24.5,111.3,27.0,119.2,23.2,'2026-07-06 05:38:17'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.3,27.4,114.9,29.2,116.3,28.5,113.7,31.0,113.4,34.8,117.0,29.1,'2026-06-29 16:21:35'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.6,21.1,113.7,21.8,112.8,24.4,116.5,28.7,113.2,21.0,114.5,25.3,'2026-07-01 20:35:37'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.2,26.9,115.3,22.1,111.2,23.1,117.7,26.8,114.1,24.9,115.4,22.6,'2026-07-05 06:11:47'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.2,24.5,115.8,23.4,114.7,24.3,119.2,25.5,117.6,26.7,115.1,21.4,'2026-07-02 19:39:23'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.8,34.2,117.4,30.6,117.4,34.0,114.1,33.5,116.9,30.3,121.0,29.3,'2026-07-04 09:55:17');
SET @first = LAST_INSERT_ID();
SET @last = @first + 40 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا');


-- ===== T103: batch 1 =====
-- Readings for T103 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,31.6,117.2,30.0,92.5,30.7,119.1,30.1,111.8,30.2,107.1,32.8,'2026-07-02 09:11:44'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.7,25.6,120.0,27.3,90.8,21.1,117.2,27.9,111.7,27.9,110.9,23.7,'2026-06-30 18:19:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.0,25.2,120.8,26.4,90.6,23.8,122.0,22.3,110.9,22.9,NULL,NULL,'2026-07-05 22:57:22'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.2,33.6,118.1,29.5,91.6,26.5,121.9,30.3,106.6,31.0,107.3,33.8,'2026-07-04 12:18:49'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),85.0,29.5,121.8,33.9,92.7,26.8,153.0,31.8,106.1,29.4,107.5,30.3,'2026-06-30 16:16:26'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.9,25.8,121.1,23.4,88.3,20.9,121.1,23.1,140.0,26.3,107.0,24.5,'2026-07-06 06:48:36'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.1,28.5,121.1,33.5,88.0,27.0,121.3,30.9,143.0,30.5,110.7,32.0,'2026-06-30 15:51:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.2,24.3,122.4,25.4,88.1,21.7,121.3,22.5,111.9,26.5,111.2,25.9,'2026-06-30 20:07:22'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.9,29.8,119.9,30.3,89.3,26.6,121.9,33.2,107.8,30.2,107.9,32.0,'2026-07-05 17:08:03'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.4,26.7,120.4,22.6,90.1,21.7,119.9,26.4,111.7,27.3,109.6,24.9,'2026-07-05 20:36:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.9,25.8,122.6,22.6,87.5,21.1,119.7,24.5,107.6,26.6,111.3,27.8,'2026-07-05 20:07:17'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.6,23.6,120.4,27.4,87.3,21.3,122.9,24.7,140.0,23.7,110.3,23.8,'2026-07-03 23:27:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.0,24.6,119.9,25.8,87.6,20.4,118.4,22.4,109.8,27.2,109.8,24.1,'2026-07-06 01:49:16'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.0,30.1,119.8,28.9,88.3,28.4,118.6,30.5,106.5,32.0,106.5,29.3,'2026-06-29 12:50:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.8,32.8,117.1,28.9,89.2,28.6,117.1,32.8,109.1,29.5,108.4,31.8,'2026-07-02 14:43:03'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,29.3,118.1,33.5,91.7,27.5,118.3,30.6,110.9,30.3,110.3,32.0,'2026-07-01 12:00:11'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.4,24.5,121.8,24.9,88.0,24.9,117.0,25.4,110.1,91.0,79.0,24.6,'2026-06-29 19:15:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.5,25.8,117.1,24.0,91.0,22.0,117.1,26.7,108.4,25.5,111.8,23.0,'2026-06-30 04:39:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.1,31.0,119.0,28.8,88.3,28.6,120.8,30.8,108.9,31.2,111.3,30.1,'2026-07-03 09:34:04'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),88.0,32.6,122.5,31.3,87.4,30.0,121.5,31.4,110.1,31.4,111.2,32.6,'2026-07-03 07:57:07'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,24.5,121.1,24.8,87.9,24.4,121.8,27.0,108.6,26.2,111.0,80.0,'2026-07-05 19:39:00'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.7,32.5,118.6,30.1,92.0,27.8,120.8,28.2,107.8,28.1,108.3,32.5,'2026-06-30 17:48:03'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.6,32.0,121.3,29.8,87.8,25.9,118.6,32.0,151.0,29.9,110.7,33.5,'2026-07-04 09:09:52'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.2,26.1,119.0,25.3,90.1,23.1,85.0,25.0,107.4,23.9,109.8,26.9,'2026-07-04 05:38:17'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.2,25.1,122.8,22.0,92.0,24.0,118.2,24.3,106.6,95.0,89.0,26.7,'2026-07-03 21:54:36'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.3,29.5,118.1,32.4,88.4,29.4,77.0,29.7,111.7,33.7,107.3,29.4,'2026-06-29 10:12:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.9,28.6,119.0,33.0,87.7,27.8,120.4,31.7,109.6,28.0,106.7,32.6,'2026-06-30 12:15:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.7,27.1,117.0,23.6,90.1,23.0,120.2,23.8,111.5,25.4,109.5,25.2,'2026-07-03 22:32:03'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.1,22.0,144.0,25.1,87.6,24.9,121.3,25.4,106.6,26.8,107.9,24.0,'2026-07-04 02:12:35'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.9,31.9,119.0,29.0,88.0,30.4,119.0,31.3,111.0,30.6,111.9,29.6,'2026-07-02 15:52:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,28.9,122.3,32.7,136.0,27.5,119.6,30.2,108.9,32.9,107.2,29.3,'2026-07-02 14:50:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.1,24.0,120.5,25.5,90.9,22.2,117.4,23.5,112.0,26.6,112.0,22.2,'2026-07-01 18:29:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.5,29.7,117.3,28.6,90.4,27.3,120.0,91.0,111.2,28.9,109.6,29.2,'2026-06-30 09:24:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.6,31.4,85.0,33.2,92.4,27.3,122.6,29.3,108.9,30.3,110.5,29.6,'2026-07-02 07:46:57'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.8,22.7,122.1,25.1,87.3,24.8,120.6,24.7,111.5,27.1,93.0,25.6,'2026-07-06 00:32:02'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.5,26.9,120.2,27.4,89.9,22.9,117.4,26.9,108.9,24.8,106.9,26.1,'2026-07-05 04:26:05'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.1,30.9,122.2,87.0,85.0,28.9,119.7,28.9,110.3,32.9,110.2,29.2,'2026-06-29 07:43:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.7,27.6,118.2,26.9,87.6,19.1,117.2,26.9,106.4,24.0,110.2,23.3,'2026-07-01 23:58:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.4,27.9,117.1,22.8,87.7,84.0,119.4,22.3,107.3,26.9,106.5,23.1,'2026-07-03 00:18:59'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.7,23.0,120.1,26.7,89.0,21.6,122.1,25.2,147.0,28.0,111.4,22.6,'2026-06-30 00:49:59'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.7,34.0,121.4,28.5,92.6,28.0,80.0,32.1,109.6,28.0,84.0,31.0,'2026-07-05 12:15:07'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.9,24.6,118.1,27.9,92.1,24.1,84.0,22.7,108.5,26.0,90.0,24.0,'2026-07-01 19:00:25'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.7,27.5,120.4,24.4,88.0,20.0,149.0,22.5,108.6,27.4,150.0,25.8,'2026-07-05 21:18:19'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.8,24.0,120.9,26.2,91.7,24.3,118.4,25.2,144.0,26.2,111.6,25.9,'2026-07-03 04:27:26'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.6,26.2,119.9,26.2,92.6,20.7,119.7,24.3,111.9,27.4,108.4,26.0,'2026-07-04 01:29:49'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.0,22.9,150.0,23.0,92.4,21.2,120.6,24.5,109.9,23.6,107.7,26.1,'2026-07-04 02:12:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.7,23.1,120.1,26.9,91.2,24.4,117.4,27.0,109.4,22.8,111.3,22.7,'2026-07-02 05:02:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.5,24.2,123.0,22.5,88.1,21.5,120.2,23.2,110.9,22.1,109.3,25.8,'2026-07-04 18:29:10'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.3,22.3,118.4,26.4,89.3,20.0,121.0,27.4,110.8,26.5,109.9,24.7,'2026-06-29 20:44:10'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.8,30.4,122.7,31.0,NULL,NULL,118.6,32.5,111.9,32.6,106.3,32.8,'2026-07-01 10:30:39');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور');

-- ===== T103: batch 2 =====
-- Readings for T103 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.8,33.1,119.5,33.0,90.7,26.2,118.4,34.0,106.7,32.6,106.9,29.3,'2026-07-04 08:35:47'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.0,32.0,117.6,32.9,91.2,27.8,121.7,88.0,138.0,29.7,110.0,30.9,'2026-07-02 07:53:28'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.8,29.8,121.6,31.8,88.5,30.5,121.4,30.7,111.5,32.9,107.7,33.7,'2026-06-30 09:20:09'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.2,27.3,117.0,22.6,90.7,22.1,118.7,22.6,109.1,25.5,109.8,25.3,'2026-07-01 05:02:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.8,22.6,117.6,25.6,88.5,21.3,120.8,24.6,106.2,24.2,155.0,25.6,'2026-07-05 19:00:38'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.2,27.8,135.0,26.0,91.6,21.9,122.2,26.3,155.0,23.7,107.6,26.9,'2026-07-01 01:30:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.1,30.0,121.9,33.2,87.5,27.1,122.1,33.3,145.0,28.6,109.9,31.1,'2026-06-29 15:52:02'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.6,27.4,122.1,24.8,88.0,21.0,118.9,27.8,107.8,26.8,109.9,90.0,'2026-07-03 20:23:36'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.9,26.5,117.8,27.8,91.7,24.2,120.9,25.6,107.4,24.8,82.0,26.2,'2026-07-03 02:33:41'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.6,29.4,117.9,28.0,92.4,28.9,120.5,31.5,107.1,33.4,109.6,33.6,'2026-07-03 07:48:35'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.5,27.0,118.6,24.7,92.9,20.5,121.4,22.8,110.4,23.5,106.6,27.8,'2026-07-03 03:06:30'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.4,30.0,118.4,32.6,90.5,30.2,120.6,33.3,109.1,31.7,107.0,28.1,'2026-06-30 12:42:17'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.7,30.2,117.4,32.3,88.7,28.6,117.1,32.5,110.8,34.0,110.2,30.8,'2026-07-05 14:30:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.1,29.4,123.0,30.6,91.3,79.0,121.5,32.8,106.4,31.9,107.0,32.6,'2026-07-02 14:32:04'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.3,23.1,153.0,22.7,91.4,25.0,119.4,26.4,107.1,22.6,147.0,27.6,'2026-07-04 03:02:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.4,24.2,119.1,24.8,87.1,24.6,117.3,26.3,109.3,22.0,106.1,27.1,'2026-07-03 20:50:33'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.1,29.2,120.4,82.0,90.8,27.3,121.5,33.4,92.0,33.2,111.6,33.0,'2026-07-05 11:03:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.9,29.8,94.0,31.3,87.9,28.9,122.9,32.2,108.8,34.0,108.1,29.5,'2026-07-02 12:29:40'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.2,33.0,122.8,33.8,91.2,29.5,122.4,31.3,111.8,31.3,109.3,30.5,'2026-06-30 08:19:37'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.0,22.8,123.0,26.0,87.5,22.1,120.5,25.0,111.0,26.9,106.3,25.3,'2026-07-02 20:58:17'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.9,27.7,120.4,23.1,90.4,19.1,118.2,91.0,110.7,25.2,108.3,26.3,'2026-07-05 05:17:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.9,28.0,119.0,22.4,141.0,23.0,122.7,26.4,111.7,23.5,108.1,23.1,'2026-07-05 02:32:22'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.8,27.3,120.8,23.5,92.9,21.7,122.7,26.0,110.1,26.7,106.0,24.6,'2026-07-01 18:59:01'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.2,26.9,121.0,26.4,89.8,19.8,121.0,22.7,109.1,22.4,112.0,26.7,'2026-07-04 00:04:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.8,31.4,118.6,28.6,141.0,30.6,117.8,31.3,106.6,28.7,107.1,28.5,'2026-07-01 11:17:17'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.7,31.9,119.8,31.8,90.2,29.9,85.0,30.0,111.5,34.0,139.0,29.2,'2026-07-03 08:51:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.2,22.4,137.0,26.2,92.3,20.5,118.0,22.9,106.7,26.3,106.1,25.9,'2026-07-02 18:16:44'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,28.2,118.4,28.0,92.2,27.4,118.4,32.8,106.4,28.1,111.9,31.6,'2026-07-02 09:35:03'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.8,33.8,120.9,29.6,89.9,28.0,120.4,33.6,110.0,32.6,107.6,33.6,'2026-07-01 14:37:10'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.1,23.9,121.5,27.6,89.5,19.8,123.0,24.5,110.6,24.8,108.3,24.1,'2026-07-01 01:31:16'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,23.5,118.2,28.0,90.9,21.3,121.8,27.0,107.3,24.5,110.1,24.8,'2026-06-29 20:55:06'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.3,29.2,118.0,32.2,88.1,31.0,119.4,31.6,110.7,32.3,108.5,31.6,'2026-07-01 07:14:08'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.0,30.9,121.8,33.9,91.8,28.9,75.0,32.3,111.8,33.5,106.5,30.0,'2026-07-01 07:28:36'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,29.9,122.8,30.0,90.0,27.1,117.6,33.1,106.9,29.0,109.9,30.6,'2026-07-04 11:24:26'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.4,29.7,117.7,32.2,87.6,29.8,120.0,30.4,109.7,32.4,108.8,31.7,'2026-06-30 14:30:07'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.1,28.0,94.0,22.5,88.9,23.3,122.9,27.0,110.0,24.0,111.0,22.5,'2026-07-06 01:29:23'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.1,31.9,118.0,30.3,140.0,28.3,117.3,32.1,108.8,30.7,110.8,79.0,'2026-06-30 07:10:02'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.5,33.9,117.1,29.9,89.4,27.4,121.4,30.4,111.4,33.0,106.8,34.0,'2026-07-04 17:13:08'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.1,23.8,122.8,26.2,89.0,24.5,122.1,22.8,106.4,23.1,111.1,23.5,'2026-07-03 23:05:11'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.6,22.0,122.8,25.9,92.5,21.9,81.0,22.6,111.8,26.7,110.5,28.0,'2026-07-06 04:27:51'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,28.3,121.0,31.3,91.5,28.1,118.8,32.6,81.0,30.8,107.6,28.9,'2026-07-03 11:23:07'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),85.0,22.7,121.8,23.4,90.7,20.8,118.8,23.3,110.7,23.5,110.3,23.6,'2026-07-04 00:07:21'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.4,31.1,120.9,92.0,87.0,29.7,121.9,33.8,109.8,32.3,110.6,33.3,'2026-07-05 13:19:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,31.1,120.4,32.7,87.2,29.4,119.9,30.0,108.5,30.9,106.9,28.9,'2026-06-30 11:19:57'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.5,22.8,122.5,26.0,89.7,24.0,117.9,25.7,106.1,24.5,107.2,22.1,'2026-07-06 00:08:36'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.7,29.4,120.1,30.7,90.1,29.2,117.4,34.0,107.8,28.9,155.0,29.3,'2026-06-29 15:16:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.1,32.0,120.9,28.7,89.1,29.6,117.8,30.3,106.1,30.8,112.0,30.0,'2026-07-04 09:04:38'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.0,33.8,118.7,31.5,91.4,26.2,122.0,32.0,110.5,31.7,107.5,31.1,'2026-07-02 12:14:26'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.2,33.6,120.9,30.0,90.8,30.7,118.7,28.4,111.0,32.9,111.4,32.9,'2026-07-02 11:58:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.0,24.2,117.9,27.0,89.0,22.8,122.1,26.1,91.0,22.7,111.1,25.2,'2026-07-06 06:23:03');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد');

-- ===== T103: batch 3 =====
-- Readings for T103 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.4,27.2,118.3,91.0,87.5,21.3,117.9,24.8,109.8,24.8,107.7,24.9,'2026-07-01 04:04:06'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.8,23.0,117.1,22.7,90.0,21.3,119.4,25.5,108.0,24.5,110.8,22.2,'2026-06-30 19:13:50'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.2,33.6,121.5,28.8,87.8,25.9,121.5,29.5,108.2,30.1,155.0,31.1,'2026-06-29 09:40:38'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),89.0,28.9,118.0,28.7,88.4,26.5,117.1,28.3,109.0,28.2,112.0,28.9,'2026-07-01 11:55:59'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.0,30.4,117.1,31.2,91.2,29.5,117.2,29.2,109.7,31.1,109.7,33.6,'2026-07-02 10:13:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.5,87.0,118.7,31.5,92.3,26.2,118.2,30.0,110.1,29.8,110.1,32.2,'2026-07-04 07:27:10'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.7,22.2,122.9,27.5,91.7,23.7,118.3,27.6,108.9,22.3,111.6,27.6,'2026-07-04 01:26:14'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.9,22.0,119.1,23.3,91.6,21.0,121.8,23.0,109.8,23.8,112.0,23.5,'2026-07-06 00:20:15'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.4,28.1,123.0,29.7,89.4,29.6,117.3,30.3,155.0,32.7,106.1,29.9,'2026-07-06 07:11:41'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.9,29.6,122.1,33.8,140.0,31.0,117.0,28.7,111.5,33.6,107.7,28.1,'2026-07-02 15:17:42'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,28.4,117.2,31.1,83.0,25.0,121.5,29.8,107.7,28.1,107.2,29.5,'2026-07-04 10:37:23'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.5,25.6,123.0,26.4,92.4,23.7,120.8,24.3,107.0,24.3,109.5,25.4,'2026-07-05 18:25:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.6,23.1,119.2,26.9,91.8,24.6,119.3,24.7,106.8,24.1,108.8,26.8,'2026-07-02 02:15:51'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.1,25.2,117.9,25.8,91.7,20.0,122.2,27.0,106.5,27.2,109.2,25.4,'2026-07-05 18:49:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.6,27.9,121.7,23.4,90.1,19.7,119.3,25.5,111.2,24.5,108.6,26.4,'2026-07-06 06:05:48'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.9,27.3,121.5,22.0,92.1,19.6,121.4,28.0,107.9,27.2,138.0,27.2,'2026-06-30 19:08:14'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),149.0,27.2,123.0,22.7,89.5,19.0,119.4,24.3,109.7,27.8,146.0,26.3,'2026-07-03 18:57:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.6,26.4,121.8,25.4,90.7,22.9,121.3,25.1,109.1,26.8,109.4,22.5,'2026-07-05 22:13:56'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.9,24.4,120.0,22.2,91.5,24.4,117.6,22.0,110.3,26.9,106.4,25.2,'2026-07-05 03:53:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.4,33.1,117.3,29.6,90.1,26.1,118.0,28.2,106.7,32.3,107.2,83.0,'2026-06-29 10:41:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.2,29.9,121.3,31.7,89.8,30.1,117.6,29.0,112.0,31.8,108.3,89.0,'2026-07-01 17:32:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.6,30.6,146.0,32.4,90.0,27.5,93.0,33.6,107.1,32.2,109.4,30.3,'2026-06-29 16:58:20'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),79.0,24.6,118.9,22.8,89.3,86.0,120.7,25.3,106.8,24.0,111.1,23.3,'2026-07-04 01:14:23'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,28.6,121.0,82.0,92.4,28.2,82.0,31.2,110.0,32.8,112.0,29.4,'2026-06-30 11:49:55'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.2,27.5,118.2,26.2,89.8,22.8,122.8,22.8,109.2,27.6,110.0,23.0,'2026-07-01 01:28:55'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),92.0,22.4,117.5,26.5,91.1,19.2,119.9,26.1,107.9,27.3,107.9,27.4,'2026-06-30 06:28:22'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.8,33.5,120.5,33.9,92.0,28.6,121.4,31.1,109.9,32.0,111.9,29.7,'2026-07-01 14:48:56'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.0,33.9,120.6,29.2,92.2,27.1,118.6,31.8,110.9,31.9,110.9,32.4,'2026-07-03 12:54:35'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.5,25.4,119.9,25.7,91.6,24.6,120.8,27.0,111.6,26.1,108.5,25.0,'2026-07-01 21:58:58'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.4,30.1,118.6,28.7,89.5,25.0,118.6,33.9,109.5,31.7,108.6,29.2,'2026-06-30 17:33:25'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.8,28.6,117.7,28.8,92.0,25.3,120.4,91.0,107.3,28.2,106.0,28.7,'2026-06-30 08:40:44'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.8,24.7,120.8,25.6,89.2,88.0,121.8,23.4,77.0,23.3,109.6,26.7,'2026-07-02 22:32:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.7,28.6,118.5,30.9,92.8,87.0,119.7,31.7,108.8,29.3,108.6,32.5,'2026-06-30 09:38:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),141.0,31.9,122.6,32.3,90.3,27.1,120.9,30.4,108.3,28.9,110.4,32.3,'2026-07-01 15:17:13'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,24.0,121.5,23.8,92.6,22.0,120.6,78.0,108.4,25.6,109.1,24.7,'2026-07-03 18:56:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.7,23.6,122.8,23.6,92.4,22.7,122.1,23.2,77.0,22.3,109.9,26.4,'2026-07-05 05:12:58'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.9,23.6,122.4,24.7,88.4,21.6,118.4,83.0,107.8,25.5,107.0,23.5,'2026-06-29 22:16:56'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.4,32.9,118.1,31.4,91.8,27.3,83.0,29.1,109.2,33.2,79.0,30.5,'2026-07-05 08:49:54'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.5,31.8,118.7,30.9,87.7,29.5,121.8,28.2,106.0,29.8,110.3,32.8,'2026-07-03 08:48:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.6,31.3,120.3,30.2,92.3,29.7,122.9,30.6,144.0,33.1,106.7,31.8,'2026-07-01 09:37:46'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,28.1,117.1,29.3,87.9,27.8,121.7,28.8,107.5,28.9,108.8,29.6,'2026-07-02 16:01:57'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,33.6,117.3,29.5,147.0,25.6,146.0,32.1,137.0,31.2,108.2,30.1,'2026-06-30 15:46:22'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.0,22.6,118.7,22.3,90.3,21.3,122.1,25.9,107.8,24.3,106.7,27.6,'2026-07-04 06:56:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.2,26.2,120.6,25.2,92.9,24.2,119.8,26.6,143.0,26.8,108.5,23.4,'2026-06-30 01:34:06'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.2,30.6,122.2,33.6,88.6,30.8,118.0,33.4,111.0,28.4,107.0,33.9,'2026-07-04 16:33:05'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.1,33.7,119.3,33.4,90.6,28.5,121.7,30.1,106.9,32.2,109.3,32.3,'2026-06-30 17:24:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.4,33.2,119.1,34.0,91.6,27.5,122.1,33.5,109.5,29.4,107.5,30.9,'2026-07-03 07:49:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.2,30.3,120.6,30.1,90.9,28.0,148.0,30.0,138.0,30.6,107.9,29.5,'2026-06-29 17:20:37'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.7,29.3,118.8,29.5,88.0,28.8,117.5,28.6,106.0,28.9,106.5,33.9,'2026-07-01 11:49:47'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),146.0,28.0,121.3,32.3,91.2,28.6,118.9,30.1,106.5,28.2,107.2,33.0,'2026-07-04 11:01:59');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد');

-- ===== T103: batch 4 =====
-- Readings for T103 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.6,29.7,120.3,28.4,87.4,27.9,121.1,85.0,110.4,29.8,110.2,29.0,'2026-06-30 08:26:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),123.0,25.2,122.2,24.5,92.0,24.4,118.5,24.9,106.5,22.3,106.6,24.8,'2026-07-01 22:46:46'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.9,24.1,121.5,25.0,91.1,23.2,120.7,23.9,109.0,26.1,147.0,24.2,'2026-07-02 20:59:48'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.2,25.1,122.0,26.5,92.2,21.0,121.2,24.0,111.5,26.4,107.0,23.6,'2026-07-04 00:56:00'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.9,22.2,120.8,25.1,91.6,20.1,121.0,24.3,108.3,24.1,111.2,25.2,'2026-07-02 05:49:37'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.7,25.3,120.7,25.9,91.9,95.0,118.8,25.4,107.8,24.1,111.0,22.4,'2026-06-30 04:11:13'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.8,33.6,119.0,33.3,93.0,30.7,118.6,30.5,106.2,29.4,108.5,28.0,'2026-06-30 16:15:24'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.4,27.2,117.1,25.2,91.9,23.0,121.2,22.3,109.4,26.2,111.4,23.5,'2026-07-02 23:34:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),137.0,31.4,119.1,32.1,87.6,25.8,118.0,32.2,107.0,33.7,108.3,28.6,'2026-07-02 07:33:56'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),78.0,31.5,122.4,33.9,91.9,29.9,118.1,28.7,109.2,32.9,109.2,28.7,'2026-06-29 17:18:41'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.2,33.0,122.1,29.2,87.1,30.8,85.0,32.9,107.0,31.3,109.0,33.9,'2026-07-05 07:01:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.4,24.4,122.1,25.2,88.0,20.2,120.7,26.7,110.7,23.4,110.9,25.1,'2026-07-02 04:11:19'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),141.0,30.3,117.0,31.6,92.9,27.3,122.3,28.0,106.5,28.8,109.5,32.9,'2026-07-02 09:25:19'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.5,31.5,120.9,33.1,89.0,26.5,139.0,28.2,110.4,29.6,107.7,30.1,'2026-06-30 07:17:06'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,22.4,119.6,22.1,88.1,23.5,120.3,25.8,106.7,22.6,108.0,27.6,'2026-06-29 20:37:10'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.4,28.3,120.5,32.8,92.1,29.5,121.4,31.4,107.9,28.6,106.2,29.9,'2026-07-05 08:18:36'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.7,78.0,117.6,27.7,89.3,21.5,120.7,28.0,106.5,24.1,109.6,26.4,'2026-07-02 06:12:09'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.0,23.3,121.7,27.2,89.6,19.0,120.6,27.0,109.1,25.5,109.9,26.2,'2026-07-06 02:22:01'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.2,22.8,122.8,25.7,92.4,24.6,121.1,25.8,108.5,25.7,106.8,25.6,'2026-07-02 18:01:00'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),76.0,23.5,121.6,22.4,88.3,20.7,121.1,23.3,106.0,24.6,106.9,22.9,'2026-07-04 20:19:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.0,24.6,118.7,24.8,87.9,20.3,121.2,27.4,88.0,28.0,108.9,23.0,'2026-07-01 19:51:55'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.7,30.9,117.7,33.6,88.1,27.7,121.8,31.3,107.9,32.1,111.5,29.7,'2026-07-05 13:54:57'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.0,25.0,117.1,26.9,88.4,25.0,117.9,22.7,107.6,26.4,109.3,27.1,'2026-07-03 00:44:07'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.6,33.6,118.6,33.1,92.9,28.5,122.9,31.3,109.3,95.0,108.6,31.6,'2026-07-05 12:55:58'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.6,26.6,118.6,26.4,91.0,21.5,120.6,25.6,109.9,23.2,111.4,24.1,'2026-07-04 00:41:51'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.1,25.1,117.1,26.4,148.0,20.4,120.4,26.7,109.5,24.8,93.0,23.3,'2026-06-29 20:10:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.7,29.7,122.7,29.3,90.9,25.7,120.8,31.4,107.5,28.2,107.0,32.2,'2026-07-01 08:06:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.2,29.3,117.6,28.5,NULL,NULL,121.4,30.2,109.5,32.4,110.0,31.6,'2026-06-30 08:40:55'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),81.0,23.0,122.2,23.3,87.3,23.2,117.2,22.7,108.3,26.0,111.3,26.3,'2026-07-04 05:09:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.0,30.4,120.4,29.1,87.6,25.5,117.9,30.6,111.2,29.0,109.5,33.6,'2026-07-04 08:56:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.6,30.8,120.4,32.2,89.7,26.1,118.7,30.0,144.0,33.1,108.4,32.9,'2026-07-02 07:08:23'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.0,95.0,123.0,27.4,92.8,23.1,117.8,22.3,107.4,27.1,109.2,27.4,'2026-07-04 21:40:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.4,31.5,117.5,29.6,92.2,26.1,122.3,29.3,110.4,32.0,108.8,28.4,'2026-07-03 08:55:59'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.7,32.8,75.0,33.4,91.9,29.2,121.6,28.1,110.7,84.0,109.0,34.0,'2026-07-05 07:55:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.1,24.3,120.8,22.1,89.0,21.4,120.2,26.1,107.0,22.5,110.2,25.6,'2026-06-29 18:16:09'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.8,26.9,121.8,23.8,89.0,21.4,119.9,86.0,111.6,23.5,106.5,24.3,'2026-06-29 23:09:55'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.5,30.4,117.9,33.1,89.0,27.3,122.2,29.0,106.2,31.5,106.3,30.6,'2026-07-04 11:35:42'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.9,31.9,121.9,31.9,92.4,30.9,117.3,29.7,111.5,30.5,111.6,31.5,'2026-06-29 12:40:04'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.0,26.6,118.1,25.5,92.9,20.5,142.0,23.2,106.9,26.3,109.9,26.3,'2026-07-03 03:04:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.1,32.2,118.9,29.0,91.8,29.5,122.4,31.3,110.9,29.6,111.2,30.4,'2026-06-29 08:50:07'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.0,30.2,118.8,33.5,92.0,26.4,120.4,32.3,111.5,33.8,109.0,30.4,'2026-07-01 13:42:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.2,25.6,122.8,27.8,87.6,21.3,120.3,23.1,110.6,22.8,106.3,79.0,'2026-07-02 18:37:48'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.5,23.3,121.8,27.2,88.6,22.7,119.5,26.6,106.6,22.5,109.3,24.9,'2026-07-02 18:24:14'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.3,31.8,117.5,32.0,87.8,27.5,77.0,33.6,111.8,32.8,110.8,91.0,'2026-06-29 16:42:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),81.0,33.5,85.0,28.1,91.9,27.6,120.8,31.3,108.4,30.1,107.6,32.6,'2026-06-29 14:19:54'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.6,84.0,119.5,24.3,92.6,19.3,122.1,22.7,109.6,23.8,107.4,24.5,'2026-07-04 20:24:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.7,22.8,118.0,27.2,143.0,22.8,84.0,24.1,106.8,25.3,142.0,27.3,'2026-07-05 23:35:27'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.9,30.5,121.7,82.0,89.7,29.9,86.0,29.2,87.0,30.5,106.9,32.3,'2026-06-30 07:51:31'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.6,34.0,122.7,30.1,90.2,28.5,120.1,32.0,109.5,32.1,109.3,33.3,'2026-07-03 17:16:31'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.7,23.5,122.0,25.3,89.1,20.9,122.8,25.5,108.6,22.2,109.9,26.6,'2026-07-05 19:31:23');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد');

-- ===== T103: batch 5 =====
-- Readings for T103 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.8,26.4,117.3,25.2,91.5,19.4,118.1,27.9,107.6,25.7,109.8,26.5,'2026-07-01 19:20:21'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.9,25.9,121.9,26.2,90.8,23.8,121.3,26.8,111.6,25.3,108.3,25.7,'2026-07-01 04:43:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.9,24.1,121.9,25.2,92.0,24.4,118.2,22.6,111.2,23.4,108.7,24.5,'2026-07-03 06:58:47'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.6,31.9,120.0,28.9,140.0,27.6,121.7,29.3,110.6,29.4,110.2,32.2,'2026-07-05 15:19:11'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.7,34.0,120.5,32.8,88.8,30.2,119.6,33.6,111.7,32.4,106.1,31.5,'2026-07-03 08:12:52'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.7,32.8,119.7,32.2,89.4,28.6,148.0,33.9,106.6,32.3,110.9,29.2,'2026-07-01 08:57:00'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.9,26.8,121.9,23.7,90.7,24.0,118.7,26.0,111.3,23.0,106.0,26.2,'2026-07-02 05:09:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.8,33.6,117.7,33.3,88.2,25.4,120.9,30.1,106.1,28.3,106.3,80.0,'2026-07-01 13:28:54'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.3,30.9,121.0,31.3,89.8,29.1,121.6,30.3,106.1,33.7,107.8,30.5,'2026-07-02 09:39:40'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.6,22.8,119.6,26.2,87.1,22.5,120.1,26.6,108.4,27.9,110.4,27.9,'2026-06-30 20:29:08'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.1,24.5,118.6,22.4,89.9,20.4,122.9,24.0,107.2,24.2,108.9,25.4,'2026-07-03 02:30:37'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.4,27.7,117.5,25.8,88.4,23.8,121.2,24.0,109.6,24.2,108.8,22.4,'2026-07-03 19:35:13'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.6,31.7,122.5,31.7,89.5,26.8,117.6,30.7,107.5,30.8,106.6,30.5,'2026-07-02 13:49:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.7,30.9,77.0,29.0,92.6,28.1,122.2,29.1,109.3,33.9,109.4,30.1,'2026-07-04 13:58:44'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.4,26.8,122.5,27.2,92.4,22.2,119.0,24.6,110.8,95.0,110.6,26.0,'2026-06-30 23:43:01'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.9,25.0,123.0,25.1,91.9,24.1,119.3,26.8,106.5,26.2,110.0,24.2,'2026-07-04 20:36:49'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),152.0,33.5,119.8,33.9,90.6,25.9,121.9,33.9,106.8,30.0,110.8,31.8,'2026-07-01 12:42:00'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.9,26.3,120.8,25.4,87.1,25.0,117.2,85.0,110.2,27.3,109.8,26.5,'2026-06-29 19:39:33'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.1,22.8,122.4,26.7,87.4,23.1,121.0,25.4,110.8,27.8,106.5,24.2,'2026-07-02 18:15:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.5,30.8,121.9,32.2,89.8,80.0,121.6,32.0,109.9,31.4,111.4,31.9,'2026-06-29 16:49:52'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.5,27.4,119.0,25.3,91.7,19.2,NULL,NULL,110.1,23.1,108.3,22.3,'2026-06-30 06:26:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.8,24.4,80.0,24.9,88.7,24.7,119.1,27.4,111.9,25.3,107.2,22.8,'2026-07-01 22:18:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.1,32.0,121.3,31.4,92.0,27.5,123.0,29.2,109.6,33.9,107.6,28.5,'2026-07-02 17:35:31'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.4,26.8,120.0,23.1,88.0,22.6,118.4,27.5,109.8,27.0,111.5,28.0,'2026-07-04 00:55:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,30.3,120.3,29.6,90.5,27.0,120.1,32.9,107.4,28.0,106.7,33.6,'2026-07-01 13:19:21'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.9,33.3,120.0,29.0,91.5,27.1,117.2,28.5,107.9,28.5,108.0,33.2,'2026-07-05 09:34:15'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.3,25.9,120.0,26.6,88.5,24.1,117.2,22.1,111.4,22.9,106.6,23.8,'2026-07-04 04:44:06'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.9,24.2,120.3,28.0,90.3,22.0,139.0,22.8,107.5,27.4,110.9,24.2,'2026-07-05 21:01:23'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.5,27.1,119.6,22.3,90.7,22.2,120.4,24.8,106.8,25.1,110.7,27.7,'2026-07-02 06:53:38'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.6,25.7,122.5,24.0,88.8,20.1,120.9,91.0,108.1,22.1,111.6,22.2,'2026-07-02 04:22:35'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.0,23.4,117.4,23.5,92.6,24.2,119.0,22.4,109.0,22.2,108.7,25.5,'2026-07-01 18:46:26'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.9,23.8,119.4,24.4,90.1,19.9,122.9,23.4,111.0,24.8,108.6,22.9,'2026-07-02 20:34:44'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.7,26.5,118.3,28.0,92.1,24.2,122.2,22.6,106.4,22.8,111.3,26.1,'2026-06-30 01:10:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.3,24.4,120.3,23.5,88.3,23.5,120.4,23.0,110.5,22.5,107.1,27.7,'2026-07-05 04:18:02'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.7,24.3,117.8,24.4,87.2,92.0,119.4,27.7,106.6,24.5,110.5,24.8,'2026-07-03 03:26:38'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.4,24.9,122.0,26.5,91.1,22.7,122.9,22.1,109.6,25.6,108.6,27.6,'2026-07-04 04:08:28'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.1,24.0,121.0,23.9,88.5,24.7,121.4,23.5,109.4,23.3,107.7,24.6,'2026-07-01 02:52:18'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.7,32.7,122.1,30.5,90.6,27.1,122.1,34.0,110.6,28.7,111.2,33.4,'2026-06-30 16:24:25'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.6,23.1,119.1,23.5,91.8,22.3,118.3,25.1,106.8,25.7,109.3,81.0,'2026-07-04 00:51:56'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.0,30.3,122.5,28.3,92.6,25.2,120.8,33.1,109.3,31.2,108.2,32.3,'2026-07-04 16:02:04');
SET @first = LAST_INSERT_ID();
SET @last = @first + 40 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T103'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد');


-- ===== T104: batch 1 =====
-- Readings for T104 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.5,57.1,121.8,54.0,124.6,45.0,118.8,50.0,122.3,58.6,119.4,48.1,'2026-07-01 18:51:52'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.1,50.5,117.1,65.0,116.1,57.7,124.4,63.0,117.5,50.1,116.0,55.3,'2026-06-29 09:05:55'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),78.0,54.1,117.6,48.0,123.9,55.7,116.7,45.3,123.6,46.2,116.3,79.0,'2026-07-04 21:43:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.7,52.7,124.7,55.2,122.9,49.4,120.5,53.7,123.4,48.5,118.8,57.3,'2026-06-30 21:13:25'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.2,90.0,123.0,57.4,115.1,58.7,116.9,84.0,123.9,53.3,119.8,45.6,'2026-07-02 21:07:19'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.7,93.0,115.2,46.4,116.8,51.0,122.0,52.3,79.0,47.3,115.3,47.6,'2026-07-06 06:54:48'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.5,53.2,122.1,79.0,120.6,46.1,151.0,54.5,123.3,46.7,117.0,44.1,'2026-07-01 04:13:23'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),147.0,50.3,121.3,58.4,119.7,54.8,115.8,53.4,119.4,53.5,149.0,50.4,'2026-07-02 20:07:42'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),91.0,46.8,116.5,44.9,143.0,54.5,124.7,46.3,115.5,89.0,120.7,81.0,'2026-07-01 00:48:29'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.0,45.5,115.5,54.4,120.9,49.8,118.6,53.2,121.2,51.6,116.4,49.0,'2026-07-02 03:26:58'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.4,57.6,120.7,54.9,121.3,44.7,119.2,49.0,143.0,49.1,153.0,54.0,'2026-07-04 02:20:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.7,56.1,121.0,50.4,120.1,60.6,119.2,66.0,116.4,51.2,120.9,86.0,'2026-07-05 12:36:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.9,64.1,124.6,56.9,154.0,51.6,122.7,62.8,123.2,65.3,120.0,65.5,'2026-07-03 10:32:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.2,51.6,123.7,53.0,122.1,57.4,116.2,53.8,115.6,62.4,117.9,54.4,'2026-07-03 14:07:18'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.4,63.1,122.4,64.5,120.7,50.3,118.3,54.2,123.4,53.5,121.5,61.7,'2026-07-03 17:50:03'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.3,46.2,123.4,44.7,118.3,46.4,121.9,46.1,124.6,59.7,77.0,58.9,'2026-07-04 05:18:44'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.2,57.7,118.7,57.0,115.9,57.9,118.8,57.6,120.7,53.1,117.9,58.6,'2026-06-30 21:48:58'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),83.0,44.2,121.9,45.1,87.0,46.3,122.2,46.1,124.7,46.1,121.3,91.0,'2026-07-01 18:23:48'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.4,53.8,93.0,62.2,119.5,55.8,116.1,64.8,115.5,62.6,117.2,62.4,'2026-06-29 12:15:08'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.1,55.7,116.3,61.7,123.4,60.1,122.7,60.7,122.8,59.6,118.3,65.6,'2026-06-29 14:08:20'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.9,88.0,116.3,53.8,119.5,58.8,120.2,85.0,118.4,57.6,117.9,59.7,'2026-06-30 02:13:48'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.0,56.2,94.0,55.3,115.8,46.2,116.4,59.0,118.1,53.1,123.1,48.1,'2026-07-03 03:58:14'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.3,55.9,115.0,58.7,135.0,58.2,117.1,59.2,88.0,62.6,119.0,50.8,'2026-07-01 08:36:56'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.3,58.5,121.0,56.3,115.8,57.2,121.8,58.6,121.9,57.8,137.0,55.8,'2026-07-02 23:34:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.4,54.5,125.0,49.7,120.0,60.0,120.4,59.7,118.1,58.8,120.6,51.9,'2026-06-30 22:17:02'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.8,52.3,119.0,51.2,124.2,93.0,119.6,56.3,88.0,51.1,123.7,51.5,'2026-07-02 12:17:41'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.0,55.3,124.0,53.2,119.1,59.5,115.0,51.2,122.3,57.7,122.4,56.4,'2026-06-29 13:32:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.8,57.0,122.1,65.7,115.6,58.3,115.1,57.9,121.2,61.3,122.3,61.5,'2026-07-01 17:39:28'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.8,54.9,115.3,60.8,119.7,56.6,125.0,53.3,155.0,58.6,119.2,65.4,'2026-07-02 10:22:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.1,60.8,117.2,53.8,120.7,60.9,154.0,62.1,138.0,59.9,116.1,59.5,'2026-07-05 15:37:57'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.8,57.2,115.0,57.7,121.6,54.1,122.1,89.0,120.6,44.3,116.7,54.4,'2026-07-03 06:06:21'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.9,47.7,115.6,49.2,124.7,56.2,123.9,59.0,121.8,45.2,123.1,48.3,'2026-07-01 03:29:12'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.2,51.9,123.8,49.9,119.6,50.8,120.4,50.5,77.0,55.9,116.4,92.0,'2026-06-30 01:32:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.8,57.7,121.2,59.8,120.7,55.2,117.6,50.2,123.6,95.0,119.8,48.3,'2026-07-02 20:07:32'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),94.0,44.3,125.0,53.9,118.2,52.4,119.9,59.5,119.1,85.0,119.2,81.0,'2026-07-02 00:16:16'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.8,54.1,121.5,45.7,117.2,51.1,119.6,84.0,121.8,53.2,122.9,49.5,'2026-06-30 01:21:20'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.1,52.2,116.8,57.7,123.4,50.5,122.9,58.5,121.7,57.1,124.7,59.3,'2026-07-05 00:03:46'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.1,64.8,116.3,57.0,118.2,59.6,124.3,65.3,92.0,56.4,82.0,55.7,'2026-07-02 11:40:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.3,53.8,123.4,64.0,117.0,79.0,124.1,64.7,82.0,53.1,117.2,50.0,'2026-06-29 09:49:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),91.0,61.1,123.0,65.2,123.6,80.0,118.7,54.8,118.6,51.5,122.0,57.4,'2026-07-01 14:51:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.5,57.0,118.5,54.7,122.0,47.5,122.5,52.0,115.4,44.0,115.2,55.7,'2026-07-05 06:30:01'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.0,53.4,119.2,59.0,147.0,44.5,120.4,90.0,119.7,51.6,152.0,49.7,'2026-07-04 02:09:06'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.2,60.2,122.5,56.8,121.6,65.7,124.7,54.9,118.7,64.1,122.2,92.0,'2026-07-02 08:55:18'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.7,49.9,121.6,58.4,86.0,56.4,122.5,54.9,115.9,58.5,79.0,59.2,'2026-07-06 02:46:49'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.9,53.1,121.6,58.7,93.0,44.3,119.7,47.5,119.6,52.5,116.5,55.7,'2026-07-01 01:33:26'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.5,47.5,117.3,45.9,123.2,90.0,116.7,93.0,119.2,57.1,124.0,50.7,'2026-07-05 04:59:50'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.3,64.1,121.2,51.1,150.0,50.0,115.0,64.7,115.8,60.2,81.0,60.4,'2026-07-04 16:51:27'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.5,62.0,122.1,65.6,125.0,94.0,117.3,54.1,118.0,52.3,119.9,63.8,'2026-07-04 15:39:25'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.0,56.3,122.1,45.5,115.0,59.6,116.3,46.2,124.5,45.1,76.0,45.3,'2026-07-01 18:35:17'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.9,61.0,115.0,62.3,123.3,52.2,118.9,64.3,117.9,53.6,120.2,65.1,'2026-06-30 16:35:49');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'WARNING', 'لاستیک 3 — دمای بالا'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا');

-- ===== T104: batch 2 =====
-- Readings for T104 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.4,53.3,121.0,52.9,122.9,63.1,117.5,80.0,115.4,90.0,117.8,54.6,'2026-07-01 07:14:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),125.0,59.2,118.0,79.0,120.1,56.9,124.5,60.9,117.8,56.4,121.4,54.9,'2026-07-03 17:08:06'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.9,59.7,85.0,57.6,119.2,51.3,118.5,51.2,119.2,59.0,117.0,55.2,'2026-07-02 10:40:22'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.6,44.8,124.8,52.3,123.9,51.9,78.0,46.6,120.9,78.0,116.8,52.4,'2026-07-06 04:26:19'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.7,53.9,117.1,44.6,117.9,52.0,123.9,46.1,116.0,47.4,125.0,58.4,'2026-06-30 21:36:14'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.0,54.6,115.6,46.0,124.2,48.6,123.3,59.0,122.9,52.6,121.3,46.5,'2026-07-06 04:11:35'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.9,65.2,124.0,65.1,117.9,51.6,118.6,65.9,124.2,50.3,81.0,50.0,'2026-07-04 17:39:36'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.5,56.9,118.6,45.6,122.8,46.4,119.3,89.0,119.4,50.2,119.3,47.7,'2026-07-01 02:29:26'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.7,54.4,122.3,44.3,120.4,58.0,124.1,85.0,121.1,56.8,124.1,49.5,'2026-07-05 21:35:11'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.9,58.8,NULL,NULL,121.2,55.7,117.0,52.5,87.0,52.9,119.0,50.5,'2026-07-02 19:06:11'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.3,55.7,115.7,60.0,123.9,47.8,119.2,46.4,115.4,58.6,120.3,95.0,'2026-07-02 20:00:29'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),77.0,50.4,119.9,54.0,122.8,44.1,120.8,52.5,122.1,57.9,117.3,46.2,'2026-07-01 06:41:09'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.9,48.2,118.0,54.7,115.1,47.6,117.3,45.9,115.3,59.2,116.4,46.3,'2026-07-01 03:55:15'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.1,64.0,123.9,54.3,124.2,54.3,121.7,53.1,124.2,50.1,120.5,52.7,'2026-07-03 13:32:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.8,59.5,124.3,65.0,120.9,62.0,119.8,64.2,124.6,58.6,154.0,65.4,'2026-07-03 17:41:18'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.5,86.0,119.2,57.9,121.5,53.5,117.0,50.0,122.8,57.5,137.0,53.4,'2026-07-04 10:15:03'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.5,56.4,124.3,47.3,124.5,46.8,119.6,58.7,115.1,47.2,116.6,44.9,'2026-07-02 22:28:04'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.1,92.0,82.0,53.1,119.7,48.9,116.6,56.8,115.6,54.4,123.7,45.4,'2026-07-02 22:35:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.6,61.6,122.4,52.4,124.8,51.8,122.6,52.2,123.7,51.8,122.7,94.0,'2026-07-03 12:02:44'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.5,50.7,147.0,63.8,117.0,53.8,86.0,53.0,120.1,64.2,120.3,60.0,'2026-07-03 15:43:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.9,49.9,116.0,58.6,119.6,45.5,147.0,50.5,117.5,51.8,117.8,90.0,'2026-07-05 19:27:14'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),88.0,48.8,88.0,46.2,123.5,47.5,123.3,58.2,116.9,46.5,123.1,45.0,'2026-07-04 06:33:04'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),84.0,59.9,124.1,46.1,119.8,50.7,118.0,47.4,118.6,55.7,119.6,45.4,'2026-07-05 02:42:14'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.3,85.0,115.9,52.0,123.5,86.0,119.7,61.9,123.8,64.4,120.8,60.2,'2026-07-03 07:45:35'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.2,52.5,118.0,55.1,118.4,54.0,124.9,56.8,85.0,49.3,118.6,53.4,'2026-07-03 01:08:23'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.3,52.5,118.9,57.0,124.7,54.2,119.7,58.7,120.7,48.6,115.1,55.6,'2026-07-06 04:58:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.7,65.0,119.9,53.1,123.5,56.7,118.1,54.0,118.8,58.1,115.7,61.5,'2026-07-03 09:29:08'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.8,52.6,115.2,50.7,116.5,62.6,117.1,95.0,120.7,52.3,119.0,54.0,'2026-06-30 17:54:04'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.4,48.5,120.8,50.6,123.6,56.7,123.2,48.1,123.6,44.6,119.3,47.7,'2026-07-02 21:54:14'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.6,58.7,136.0,48.8,123.2,45.1,119.5,47.9,115.8,44.6,79.0,57.2,'2026-06-30 19:20:15'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),85.0,54.5,142.0,54.9,122.3,53.1,120.0,63.5,121.3,54.2,117.5,59.6,'2026-06-30 10:20:36'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.6,60.0,122.6,54.7,121.2,56.3,122.8,59.0,89.0,55.4,117.9,65.7,'2026-07-04 10:22:01'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.0,51.3,123.8,49.6,117.9,54.8,115.4,56.0,122.0,55.7,122.7,83.0,'2026-07-04 04:30:11'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.8,44.9,116.9,54.1,122.0,49.6,122.1,48.6,121.3,55.1,121.8,50.6,'2026-07-03 21:02:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.6,56.7,117.7,94.0,115.2,52.7,116.9,58.8,124.4,64.4,123.7,54.7,'2026-07-02 08:48:39'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.7,59.6,142.0,55.4,123.1,62.2,123.2,52.9,123.7,62.5,115.0,62.4,'2026-07-01 09:18:03'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.9,53.1,115.1,51.8,120.1,51.4,120.1,55.8,123.4,59.3,118.5,62.1,'2026-06-29 12:29:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.9,54.4,119.7,52.2,115.9,51.9,119.3,80.0,122.3,59.6,119.1,61.5,'2026-06-29 09:38:03'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.7,56.2,115.2,50.4,123.5,44.3,121.3,46.4,116.9,51.8,118.1,55.0,'2026-07-04 01:25:42'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.8,64.5,150.0,63.3,121.1,55.9,124.8,54.7,123.6,50.7,122.3,63.5,'2026-06-30 16:29:08'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.3,59.0,117.6,64.6,145.0,55.1,118.9,54.8,124.2,64.8,86.0,53.7,'2026-06-29 16:37:09'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.9,52.9,118.6,58.4,88.0,56.2,122.1,55.8,123.5,55.1,120.7,59.1,'2026-07-06 00:25:23'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.3,49.1,123.8,44.8,115.2,54.4,117.8,56.0,119.9,50.9,120.9,55.2,'2026-07-05 05:20:33'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.3,59.1,117.8,58.2,138.0,61.9,117.0,63.5,117.6,60.9,119.0,65.7,'2026-06-29 10:34:45'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.2,58.5,118.6,60.5,119.2,56.7,118.7,55.6,115.9,57.8,122.7,65.0,'2026-06-29 12:16:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.5,58.8,118.4,54.4,123.6,58.3,122.5,93.0,124.2,49.5,121.8,57.3,'2026-07-03 03:59:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.1,92.0,136.0,45.5,121.1,52.3,119.4,48.9,120.2,53.4,143.0,47.2,'2026-07-05 02:13:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.5,85.0,122.2,89.0,116.3,53.4,120.9,58.5,121.7,65.2,119.3,66.0,'2026-06-29 10:12:52'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.1,84.0,115.8,50.6,117.4,50.6,117.8,46.1,122.0,53.4,117.3,82.0,'2026-07-06 06:35:55'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.1,48.9,142.0,54.4,123.4,55.5,124.4,54.1,115.3,44.8,123.3,52.0,'2026-07-05 21:31:12');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'WARNING', 'لاستیک 6 — دمای بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا');

-- ===== T104: batch 3 =====
-- Readings for T104 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.5,59.7,116.9,52.2,120.6,57.3,115.4,57.7,116.9,55.8,119.6,51.2,'2026-06-29 09:31:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.4,54.0,94.0,48.0,153.0,44.2,82.0,49.5,117.5,50.4,124.3,47.1,'2026-07-02 21:37:16'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.6,44.2,124.9,56.2,155.0,50.3,119.7,49.3,117.2,49.9,139.0,56.4,'2026-06-30 18:22:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.6,78.0,116.1,61.6,123.4,53.3,115.7,61.2,118.3,63.9,116.3,62.1,'2026-07-05 17:40:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.3,60.5,155.0,54.6,121.9,55.8,116.9,62.0,115.8,54.6,122.4,58.7,'2026-07-02 09:44:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.1,50.5,116.8,50.3,78.0,58.6,116.6,92.0,121.5,45.0,123.8,58.1,'2026-07-02 21:12:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),144.0,51.8,123.8,50.9,122.6,53.8,122.9,65.8,122.6,58.1,147.0,62.6,'2026-07-05 16:42:39'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.1,49.6,87.0,53.2,117.2,53.6,118.3,59.1,117.4,84.0,117.5,51.4,'2026-07-03 05:08:13'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.9,56.8,135.0,58.8,117.1,44.2,141.0,56.9,125.0,55.4,117.3,54.1,'2026-07-06 01:52:43'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.6,58.1,120.7,62.7,87.0,59.1,119.4,63.8,116.7,50.7,148.0,53.8,'2026-07-04 08:40:56'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.5,53.8,123.5,64.8,120.9,87.0,123.5,54.6,119.2,95.0,119.3,52.4,'2026-07-03 15:40:11'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),153.0,63.7,121.8,80.0,117.2,53.8,125.0,51.9,123.4,52.8,120.5,63.9,'2026-07-03 14:18:35'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.8,50.2,121.7,58.3,119.9,57.9,123.6,50.0,122.2,62.8,123.1,63.4,'2026-07-01 10:20:20'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.1,53.9,139.0,51.9,88.0,51.5,116.8,48.5,152.0,45.6,117.7,46.8,'2026-06-29 23:35:06'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.2,46.8,120.7,47.9,122.8,59.2,123.8,84.0,116.4,58.0,120.5,54.8,'2026-06-30 02:24:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.0,44.0,117.5,48.1,120.0,79.0,119.1,48.5,118.0,58.0,122.0,48.1,'2026-07-04 06:18:48'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),147.0,58.4,121.8,55.0,120.5,84.0,121.4,59.6,117.6,49.4,124.5,46.1,'2026-07-04 05:29:26'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.6,60.3,118.1,61.1,116.3,50.0,123.4,62.9,117.8,65.5,121.5,55.7,'2026-06-29 17:18:29'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.7,62.2,124.4,50.5,121.3,89.0,122.4,54.2,121.8,63.3,118.4,56.3,'2026-07-05 12:50:09'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.7,81.0,119.5,65.1,123.2,56.3,123.4,62.7,124.1,53.8,123.9,60.2,'2026-06-30 15:13:26'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.3,46.4,118.9,59.7,117.0,52.7,144.0,55.1,155.0,58.8,121.0,47.6,'2026-07-02 00:11:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.8,61.2,115.2,64.3,120.8,57.8,122.1,59.0,118.6,60.3,117.4,65.5,'2026-07-02 14:34:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.2,55.8,121.6,52.7,121.8,57.6,124.9,58.9,119.0,94.0,80.0,44.2,'2026-07-04 22:29:33'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.7,61.7,122.0,83.0,118.4,63.6,NULL,NULL,121.9,64.6,115.5,58.4,'2026-07-01 11:12:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.0,56.0,118.3,52.7,118.0,50.3,76.0,59.4,123.6,58.8,120.1,52.6,'2026-06-29 17:44:15'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.2,49.2,119.5,53.9,124.8,58.4,121.9,51.5,121.4,56.2,123.3,79.0,'2026-07-01 23:36:46'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.4,49.2,116.5,45.2,118.8,50.4,115.5,54.0,120.4,58.3,79.0,48.2,'2026-07-05 22:10:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.1,52.8,121.1,47.5,117.2,48.7,122.7,44.2,144.0,51.5,121.1,53.9,'2026-07-04 21:14:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.7,65.2,117.1,52.4,121.8,55.7,116.0,53.5,117.7,52.6,122.6,51.4,'2026-07-02 08:24:44'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.4,48.7,115.8,56.0,116.8,55.8,118.4,57.7,122.9,52.8,119.1,58.1,'2026-07-04 18:04:14'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.1,58.8,116.2,60.3,121.2,59.4,115.7,58.6,123.1,51.2,118.3,61.4,'2026-07-02 14:21:22'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.7,59.3,116.8,57.6,124.5,57.5,120.9,53.0,122.3,61.7,122.7,55.2,'2026-07-03 12:11:15'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),88.0,44.7,116.0,45.7,123.2,57.3,120.4,44.9,117.2,58.2,121.1,91.0,'2026-06-30 02:33:59'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.0,87.0,120.2,52.3,119.1,49.7,121.5,45.2,116.3,53.1,118.7,51.1,'2026-07-04 01:41:34'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.6,59.6,120.0,65.0,117.8,86.0,119.8,61.0,115.6,65.6,115.3,50.9,'2026-06-30 11:41:57'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),85.0,62.2,117.0,52.4,120.2,63.3,123.3,57.5,121.5,63.2,123.5,65.7,'2026-06-29 13:52:45'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.1,58.3,124.9,56.5,119.4,57.3,153.0,59.1,120.9,57.7,123.0,45.8,'2026-06-30 23:41:06'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.4,65.5,116.0,61.8,122.4,63.5,119.2,52.5,117.6,60.8,81.0,60.0,'2026-06-29 17:51:24'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.6,57.5,121.8,46.9,153.0,56.5,115.1,44.5,89.0,58.6,120.9,58.7,'2026-07-05 22:37:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.4,60.8,119.7,52.2,124.5,92.0,124.5,50.3,117.4,81.0,116.5,64.7,'2026-06-29 12:04:55'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.1,57.6,121.0,51.8,119.4,47.1,122.3,45.5,121.8,46.5,115.5,51.2,'2026-07-06 04:14:02'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),151.0,61.8,121.3,55.2,120.6,52.0,124.2,65.3,85.0,56.1,121.9,58.2,'2026-07-02 16:05:07'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.1,53.3,123.5,50.3,119.9,53.6,117.3,53.1,116.2,53.7,123.6,85.0,'2026-07-01 01:58:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.2,54.6,121.9,65.2,119.8,60.4,118.7,54.5,118.2,56.5,120.2,92.0,'2026-06-30 13:55:42'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.1,55.2,123.1,57.6,119.7,53.1,121.9,50.0,115.1,56.7,120.4,53.4,'2026-07-02 09:05:49'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.3,50.6,121.7,58.8,117.7,44.5,115.5,54.7,124.6,59.5,115.0,58.5,'2026-07-05 01:25:59'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.8,57.0,119.0,52.9,124.8,52.4,116.7,56.5,117.5,44.5,122.0,58.3,'2026-07-02 22:14:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.4,50.8,122.5,62.8,121.4,62.6,123.3,59.1,117.9,55.4,120.7,78.0,'2026-07-01 15:29:56'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.9,46.8,121.5,54.7,116.6,54.1,82.0,45.0,116.0,59.6,120.7,55.8,'2026-07-06 03:38:43'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.8,44.5,123.8,59.1,122.2,49.5,124.9,50.1,115.7,59.9,116.2,47.6,'2026-07-02 21:51:49');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد');

-- ===== T104: batch 4 =====
-- Readings for T104 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.3,65.0,116.9,59.9,90.0,60.4,118.8,84.0,117.2,60.7,122.9,51.3,'2026-06-30 15:39:11'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.5,46.5,121.0,44.3,123.8,48.3,124.9,44.8,118.0,54.0,116.7,45.7,'2026-06-29 22:06:41'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.4,50.7,79.0,58.0,141.0,64.4,122.8,61.8,92.0,61.5,119.8,64.4,'2026-06-29 16:54:32'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.3,59.9,115.3,56.4,124.9,57.1,121.3,52.8,115.8,62.1,118.9,56.2,'2026-07-05 09:15:43'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.8,57.7,135.0,54.7,116.8,58.7,118.4,52.1,123.5,50.4,120.7,62.1,'2026-07-04 13:07:36'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.6,48.6,137.0,46.4,123.3,55.9,122.1,44.6,118.4,52.8,78.0,52.9,'2026-07-06 00:41:23'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.5,52.8,122.4,52.3,120.1,57.3,120.2,56.5,121.5,60.7,115.7,50.2,'2026-06-29 07:48:02'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.3,44.6,123.4,58.2,116.4,58.6,122.2,47.3,115.6,54.3,121.7,49.1,'2026-06-30 18:23:58'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.5,52.3,118.4,57.0,115.5,56.9,121.7,54.5,116.8,44.2,117.5,56.5,'2026-07-04 18:01:56'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),NULL,NULL,NULL,NULL,115.2,44.4,118.7,54.3,122.8,44.1,87.0,58.5,'2026-07-06 03:02:13'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.2,58.8,119.9,58.5,118.0,47.5,120.8,58.8,122.3,55.7,119.9,44.2,'2026-07-06 06:30:06'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.9,52.1,122.0,60.8,118.1,51.0,122.5,63.1,120.5,53.0,85.0,61.4,'2026-07-02 15:50:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.4,59.4,118.3,52.4,118.9,47.8,118.3,44.3,124.7,50.1,120.7,52.2,'2026-07-05 04:20:26'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.6,58.8,120.1,55.0,116.2,45.4,123.2,44.4,82.0,46.3,121.5,55.4,'2026-07-03 06:20:39'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.9,54.0,121.4,45.7,116.7,55.9,86.0,48.9,120.8,81.0,124.8,58.3,'2026-07-06 06:56:41'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.3,58.0,115.8,60.0,119.1,52.8,120.0,83.0,117.8,45.4,115.6,46.1,'2026-07-02 06:34:01'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.8,52.2,124.5,54.4,122.2,66.0,116.6,50.7,121.8,59.5,120.5,58.3,'2026-07-04 13:31:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.9,53.7,118.9,48.5,120.3,49.6,115.3,46.7,115.0,53.3,123.0,49.2,'2026-07-03 03:57:56'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.3,56.0,116.0,62.5,117.0,58.1,116.6,61.7,120.7,50.0,124.0,59.9,'2026-07-04 11:54:11'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.9,92.0,120.2,63.9,118.4,65.9,116.0,54.0,119.6,50.3,116.3,63.0,'2026-07-01 10:42:36'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.8,53.2,117.6,57.8,124.4,59.6,116.9,52.2,118.2,65.4,143.0,56.5,'2026-07-02 15:30:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.2,93.0,89.0,49.0,118.1,44.0,118.9,49.7,118.6,56.8,117.2,45.6,'2026-07-02 20:49:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.8,44.5,76.0,44.4,117.3,46.3,118.9,49.0,124.2,90.0,115.6,51.9,'2026-07-01 05:00:18'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.0,94.0,119.9,45.3,115.7,49.1,122.5,59.9,81.0,46.2,118.8,56.1,'2026-07-01 03:48:30'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.5,46.5,123.3,58.2,154.0,53.9,124.6,45.3,122.4,51.2,121.7,52.4,'2026-06-30 06:41:30'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.9,49.2,140.0,57.5,122.1,57.5,121.6,44.0,122.6,45.4,120.3,46.7,'2026-07-04 20:10:52'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.4,59.7,116.6,49.1,122.5,53.8,116.5,57.7,117.9,45.0,116.3,44.1,'2026-06-30 02:08:49'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.6,58.0,121.4,44.8,123.5,51.5,87.0,54.1,122.4,44.9,123.5,53.7,'2026-07-06 02:55:35'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.0,56.0,123.7,53.1,116.5,50.2,88.0,47.6,81.0,47.7,117.5,53.3,'2026-07-03 03:39:53'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),78.0,50.6,122.9,57.7,118.6,57.8,117.8,44.6,124.4,54.8,86.0,52.0,'2026-06-29 23:01:53'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.8,62.1,124.1,64.0,120.1,56.2,122.8,58.4,116.1,50.0,124.7,57.0,'2026-07-05 10:30:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.2,62.9,120.4,53.1,119.3,58.2,150.0,53.5,119.2,52.5,143.0,64.4,'2026-07-04 09:59:24'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.8,51.1,120.9,54.1,116.9,57.5,124.4,59.4,120.9,61.9,120.6,52.6,'2026-07-04 10:11:42'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.9,47.1,124.6,56.3,90.0,56.3,119.0,51.8,124.9,48.7,115.9,51.7,'2026-06-30 05:37:34'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),85.0,54.6,118.3,60.0,116.8,61.5,118.8,51.1,116.7,50.2,123.7,55.2,'2026-06-30 17:34:28'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.3,49.3,120.1,82.0,117.7,57.5,121.0,59.5,123.8,44.7,121.6,54.0,'2026-07-03 19:07:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.8,58.5,118.3,82.0,121.0,55.1,119.1,65.2,118.2,50.2,151.0,58.2,'2026-07-05 14:30:55'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),93.0,58.6,124.0,50.7,118.3,53.7,120.1,53.3,115.7,54.5,146.0,52.6,'2026-06-30 16:18:22'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.4,65.5,120.4,54.2,122.8,63.9,122.0,60.3,119.7,54.4,122.4,50.2,'2026-06-30 08:31:22'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.3,44.7,122.2,58.0,118.4,48.7,89.0,45.5,120.9,44.4,116.0,54.2,'2026-07-04 03:05:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.3,44.2,117.5,49.3,117.3,50.4,117.8,46.8,122.2,51.1,118.0,58.2,'2026-07-05 19:48:56'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.4,60.1,115.7,54.0,122.8,64.0,117.8,65.4,117.0,62.6,117.0,64.6,'2026-06-29 11:20:23'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.3,45.2,120.4,45.5,120.3,55.5,117.1,55.6,118.8,53.1,118.3,59.9,'2026-07-02 01:53:35'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.7,44.0,118.8,44.0,92.0,54.5,115.1,46.6,117.1,59.2,115.9,53.5,'2026-07-06 00:27:33'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.9,50.8,115.4,64.9,82.0,54.9,119.5,51.7,123.3,58.4,116.4,65.8,'2026-07-03 09:53:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.6,52.4,115.4,49.7,122.0,58.3,122.9,48.9,117.0,51.5,117.0,78.0,'2026-07-02 04:55:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.2,57.7,116.6,79.0,120.6,52.5,122.8,59.3,116.5,47.6,117.5,45.9,'2026-07-02 02:15:18'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),94.0,48.0,124.9,50.8,120.7,52.7,122.5,47.3,123.9,49.8,124.2,54.2,'2026-07-01 19:00:34'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.0,52.1,75.0,54.2,122.9,54.8,117.9,44.6,123.4,57.6,77.0,50.9,'2026-07-02 23:26:42'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.8,49.8,119.0,46.4,76.0,46.5,121.6,55.3,123.1,47.5,116.6,53.5,'2026-07-02 00:12:44');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'WARNING', 'لاستیک 3 — دمای بالا'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد');

-- ===== T104: batch 5 =====
-- Readings for T104 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.9,52.3,118.2,66.0,121.9,52.8,115.0,57.7,115.5,61.0,122.3,55.0,'2026-07-04 17:01:55'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.5,59.0,116.2,53.1,117.1,52.7,118.7,55.0,119.2,56.8,121.7,57.5,'2026-07-04 05:42:43'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.9,52.2,121.1,94.0,118.4,54.1,124.9,48.3,124.9,90.0,117.1,58.2,'2026-07-04 05:14:03'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.1,46.7,123.4,54.3,118.8,55.4,122.5,50.4,116.1,48.3,118.5,46.2,'2026-07-02 01:13:22'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),125.0,44.3,120.0,48.3,116.7,54.4,119.3,45.3,117.4,48.7,123.2,45.0,'2026-07-06 03:56:24'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.6,52.1,84.0,55.1,120.9,52.3,119.8,50.1,115.2,63.5,115.4,58.2,'2026-07-05 09:27:56'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.7,56.1,120.0,51.2,119.5,44.2,120.9,48.4,120.6,54.8,123.6,46.8,'2026-07-01 05:31:35'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),125.0,54.5,144.0,50.6,116.7,49.1,118.5,51.3,120.8,48.5,119.9,57.3,'2026-07-03 21:32:08'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.4,49.3,117.3,59.9,120.4,45.7,90.0,57.0,122.9,83.0,115.5,48.3,'2026-07-05 22:03:21'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.4,56.8,117.8,56.8,117.5,62.8,144.0,64.5,124.8,63.7,124.7,53.5,'2026-07-02 13:39:48'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.8,55.9,94.0,50.8,119.3,49.8,119.0,56.3,116.1,54.0,124.9,59.1,'2026-07-02 21:27:47'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.4,91.0,115.6,51.8,120.2,46.4,121.6,50.7,120.0,53.6,123.3,52.9,'2026-07-05 21:48:24'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.9,47.3,117.9,54.3,125.0,45.7,123.8,46.2,124.5,59.5,116.9,55.5,'2026-07-01 06:39:36'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),155.0,57.2,122.1,53.8,119.6,54.5,119.3,44.9,118.4,54.8,115.3,54.1,'2026-07-04 23:14:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.2,60.3,116.5,64.0,117.3,60.7,122.3,57.1,124.8,63.1,120.5,58.4,'2026-07-03 17:49:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.9,62.0,117.6,94.0,155.0,62.3,119.1,50.5,136.0,53.5,118.3,64.3,'2026-07-05 17:40:26'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.9,60.2,120.2,60.0,124.7,78.0,121.0,54.9,117.2,95.0,117.0,88.0,'2026-07-05 08:37:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.8,49.9,115.0,57.6,122.8,50.7,117.0,44.7,85.0,50.0,153.0,59.3,'2026-07-03 19:49:58'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.7,44.6,115.8,59.7,117.4,44.0,121.7,48.1,122.1,57.1,125.0,50.2,'2026-07-01 05:21:46'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.9,63.7,115.0,59.8,118.4,55.6,123.2,63.5,115.6,52.6,124.8,64.8,'2026-07-05 09:19:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),NULL,NULL,120.7,82.0,120.2,51.6,117.6,44.7,121.6,45.6,121.7,48.2,'2026-06-30 02:26:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.3,51.5,91.0,44.7,121.4,58.8,152.0,55.9,115.0,54.8,124.2,59.3,'2026-07-04 04:38:06'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.1,79.0,121.7,47.4,116.5,55.6,117.2,54.7,118.3,51.1,122.6,53.7,'2026-07-04 23:10:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.2,57.3,115.0,46.0,118.7,47.6,79.0,49.5,117.8,86.0,122.2,55.5,'2026-07-03 05:33:29'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.1,65.6,115.0,53.3,119.8,58.1,123.8,57.8,123.9,60.8,123.9,63.6,'2026-07-05 14:08:50'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.6,44.4,123.9,50.9,121.9,47.7,122.2,55.5,119.7,51.0,116.9,49.0,'2026-07-02 22:11:20'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.8,54.3,122.9,57.5,116.6,53.5,140.0,48.4,153.0,57.4,122.9,47.2,'2026-07-05 20:04:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),147.0,64.5,122.8,65.1,123.4,53.9,124.3,64.0,122.0,62.2,121.5,61.8,'2026-07-05 10:06:23'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),151.0,55.1,117.2,45.2,94.0,59.5,121.7,48.8,84.0,47.2,118.8,45.2,'2026-07-04 00:43:16'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.1,53.7,115.8,57.8,115.4,57.2,117.7,57.6,122.3,62.6,121.9,62.0,'2026-06-30 15:25:18'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.5,58.3,117.0,82.0,115.7,63.2,117.9,50.7,120.4,60.9,122.9,56.6,'2026-06-29 17:56:40'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.2,57.9,77.0,53.4,121.0,53.3,120.7,91.0,122.3,87.0,115.0,51.9,'2026-07-04 18:50:05'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.2,53.0,115.9,54.9,120.1,52.4,136.0,55.0,117.8,60.7,154.0,54.5,'2026-06-30 08:19:53'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.5,55.0,120.8,51.0,118.7,57.9,NULL,NULL,118.4,62.6,121.8,60.6,'2026-07-05 10:35:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.8,50.1,119.1,51.9,125.0,62.0,123.8,64.2,116.1,62.3,147.0,63.7,'2026-07-02 11:27:39'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),151.0,44.9,115.0,52.8,124.3,46.4,118.3,50.9,123.5,53.3,120.0,45.2,'2026-07-03 23:10:44'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.6,51.2,115.1,51.9,121.9,51.0,118.1,59.4,116.9,48.5,123.7,49.3,'2026-07-06 06:29:21'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.8,51.0,121.9,64.1,123.0,50.5,115.1,88.0,116.1,59.7,122.6,55.2,'2026-07-04 08:34:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),94.0,54.6,120.9,79.0,124.7,55.0,122.7,58.2,122.6,48.3,116.5,87.0,'2026-07-02 03:29:59'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.0,52.3,116.8,86.0,122.0,58.6,120.1,90.0,115.4,57.5,123.6,54.0,'2026-07-03 14:30:25');
SET @first = LAST_INSERT_ID();
SET @last = @first + 40 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'WARNING', 'لاستیک 3 — دمای بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'WARNING', 'لاستیک 5 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'SENSOR_FAULT', 'WARNING', 'لاستیک 4 — قطع سنسور'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'WARNING', 'لاستیک 3 — دمای بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا');


-- ===== T105: batch 1 =====
-- Readings for T105 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,25.0,114.3,29.5,116.4,30.0,117.7,29.3,117.7,26.2,113.8,27.4,'2026-06-30 14:15:51'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.1,29.6,117.6,30.0,114.6,25.8,114.0,29.4,112.0,90.0,150.0,29.7,'2026-06-29 08:34:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,87.0,27.4,113.5,25.2,117.3,25.0,115.3,30.6,114.7,26.7,'2026-06-29 13:27:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),80.0,24.5,112.3,24.1,112.9,21.3,114.1,20.0,114.9,23.8,115.8,21.3,'2026-07-04 20:07:19'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.5,19.2,114.7,19.2,114.2,24.8,113.8,23.2,152.0,22.7,115.8,20.8,'2026-07-04 00:54:04'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.2,81.0,116.5,28.5,114.2,28.3,117.4,26.8,114.5,26.0,116.3,27.3,'2026-07-03 13:42:00'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.3,27.0,113.5,30.1,117.3,25.8,114.8,25.0,112.9,29.8,112.1,25.8,'2026-06-30 07:04:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.3,28.2,NULL,NULL,114.8,26.4,112.5,27.7,114.7,25.3,112.3,27.3,'2026-07-05 12:57:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.3,26.5,115.6,26.6,113.6,29.6,116.3,30.1,117.8,27.9,114.9,25.7,'2026-07-05 09:24:45'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.0,22.6,116.7,24.9,115.7,20.3,112.7,22.5,116.5,22.8,115.5,21.9,'2026-06-29 22:26:23'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,21.9,113.5,23.7,117.1,23.6,117.4,19.0,113.1,20.0,115.1,20.5,'2026-07-01 18:15:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.4,29.5,117.0,29.3,117.5,82.0,114.0,26.5,117.9,30.1,115.9,30.5,'2026-07-04 13:25:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,28.0,116.5,26.0,114.1,29.1,116.3,26.1,116.4,25.0,113.4,29.8,'2026-07-04 07:06:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.8,26.3,112.4,28.8,115.8,25.0,117.2,27.0,113.7,29.4,112.3,30.8,'2026-07-02 17:50:00'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.4,28.8,113.4,25.7,114.5,30.0,116.3,25.9,116.0,29.6,115.1,27.8,'2026-06-29 09:43:00'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.6,30.6,112.2,27.5,115.0,25.1,113.3,28.5,117.1,25.2,115.9,28.2,'2026-07-05 09:18:08'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.5,23.6,117.0,23.5,117.7,22.1,117.5,21.7,115.2,20.0,114.3,22.6,'2026-07-02 19:29:07'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,112.2,20.5,115.2,23.2,117.0,24.1,117.0,20.6,113.8,22.6,'2026-07-01 02:06:51'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.1,28.7,113.3,28.7,115.1,29.7,113.7,30.3,113.6,28.8,112.2,28.7,'2026-06-30 09:48:10'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.0,30.5,116.2,26.3,117.5,27.7,116.7,26.4,114.4,25.6,115.5,28.7,'2026-07-02 11:56:09'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.2,30.5,113.8,28.5,112.1,25.0,114.8,27.7,117.6,26.0,115.7,28.3,'2026-07-05 09:32:09'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.9,20.1,113.0,21.1,115.2,23.4,116.9,22.2,112.8,20.3,116.1,22.0,'2026-06-30 06:18:20'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.4,21.4,112.4,23.6,115.6,23.1,116.7,22.6,113.7,21.5,115.2,21.7,'2026-07-02 18:46:08'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,30.0,115.4,26.5,117.4,30.8,117.1,25.7,115.6,30.6,NULL,NULL,'2026-06-29 10:00:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.0,21.2,116.3,22.2,115.1,23.2,114.0,21.0,115.1,21.2,87.0,22.0,'2026-07-01 05:19:11'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,21.1,117.1,22.3,112.3,21.2,113.6,21.0,113.6,24.5,115.2,22.7,'2026-06-29 22:42:47'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,24.1,115.3,21.6,112.1,22.2,117.2,22.0,114.8,19.1,112.2,24.6,'2026-07-06 05:50:06'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,24.8,112.3,20.1,116.6,19.3,113.4,19.1,113.7,23.7,115.7,19.0,'2026-07-03 01:16:36'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.2,28.8,117.4,30.8,115.1,25.8,112.9,28.5,136.0,28.9,114.9,26.3,'2026-07-05 11:59:15'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),150.0,28.2,116.0,29.0,116.3,25.1,116.0,29.8,114.7,25.0,113.7,25.9,'2026-06-30 07:55:35'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.1,20.4,115.3,22.8,115.3,20.7,114.9,20.2,113.4,19.6,114.9,22.0,'2026-07-05 18:22:18'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.9,21.3,113.9,19.4,113.7,24.8,113.2,19.0,112.8,24.3,115.3,24.5,'2026-07-01 21:39:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.6,22.6,116.9,20.4,112.1,23.7,114.4,23.5,114.9,21.6,115.3,20.3,'2026-07-02 22:45:02'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.4,19.0,115.7,20.3,116.3,19.5,115.3,24.9,114.9,22.4,112.9,24.6,'2026-07-03 23:12:45'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.6,20.9,117.3,19.1,113.5,19.8,116.1,22.0,118.0,22.7,113.0,20.4,'2026-07-02 04:16:28'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.2,29.5,114.7,27.0,116.5,28.4,116.2,30.6,114.8,28.7,116.0,30.0,'2026-07-05 14:47:00'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.2,28.7,117.6,30.5,112.2,30.3,115.2,25.4,115.1,28.8,114.3,28.2,'2026-07-02 11:51:03'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.0,27.5,113.6,28.5,115.3,25.1,116.3,28.0,115.7,27.5,117.9,29.0,'2026-07-01 13:30:04'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.7,19.5,112.6,19.9,115.4,22.3,117.0,23.8,117.2,24.1,112.0,24.8,'2026-07-02 06:03:53'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.5,19.7,113.4,22.0,112.9,21.4,113.4,20.7,117.9,24.4,117.7,21.9,'2026-07-05 20:35:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.2,27.6,115.9,27.6,117.5,26.4,114.2,29.4,114.8,26.5,117.3,30.1,'2026-07-02 11:10:43'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),149.0,21.1,116.3,24.7,112.5,22.3,117.6,23.7,117.2,20.7,115.2,22.4,'2026-07-05 02:06:10'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.4,26.9,116.1,30.8,117.9,26.4,117.4,25.3,114.8,25.7,117.2,30.9,'2026-07-02 12:34:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,23.0,115.9,21.8,112.9,20.4,116.9,23.0,113.8,20.6,117.1,20.8,'2026-07-05 20:21:30'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.2,29.9,113.9,30.2,118.0,25.8,116.8,28.1,112.7,27.2,114.8,29.5,'2026-07-03 11:43:37'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.2,27.8,115.5,29.9,112.8,28.6,114.3,30.8,113.0,30.2,112.5,27.4,'2026-07-04 12:22:07'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.5,27.2,113.5,28.7,118.0,27.9,117.0,27.4,114.4,26.1,116.0,28.6,'2026-07-05 11:11:02'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.8,29.0,117.9,30.9,114.8,25.0,117.7,26.0,114.5,28.6,118.0,26.8,'2026-07-05 07:17:34'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.3,26.7,117.6,25.3,115.5,26.3,113.8,25.1,117.1,29.6,113.8,29.2,'2026-07-02 15:56:07'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,24.9,117.4,23.0,112.1,22.6,116.5,24.2,113.2,21.6,115.8,23.7,'2026-07-03 20:38:45');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 2, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'SENSOR_FAULT', 'WARNING', 'لاستیک 2 — قطع سنسور'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'SENSOR_FAULT', 'WARNING', 'لاستیک 1 — قطع سنسور'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'SENSOR_FAULT', 'WARNING', 'لاستیک 6 — قطع سنسور'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا');

-- ===== T105: batch 2 =====
-- Readings for T105 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,114.0,23.7,79.0,24.1,116.3,23.4,115.7,22.4,113.3,23.6,'2026-07-01 00:25:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.7,27.6,112.1,25.6,112.4,27.0,117.2,27.5,115.9,26.0,114.2,25.4,'2026-07-03 14:59:16'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.7,24.6,114.4,24.2,113.5,22.1,112.4,22.6,116.7,24.7,116.0,21.1,'2026-07-01 22:16:17'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.1,23.3,113.6,24.1,112.1,20.3,85.0,24.2,114.1,19.4,117.3,24.9,'2026-07-04 02:03:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.9,23.3,115.0,19.9,NULL,NULL,115.0,23.8,113.6,24.9,116.7,23.4,'2026-07-02 19:13:40'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,24.3,112.7,20.6,115.3,22.3,113.3,19.4,113.8,19.0,114.8,22.1,'2026-07-02 18:06:10'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.2,19.3,115.2,19.3,115.4,22.0,113.3,22.7,112.4,20.6,114.6,20.0,'2026-06-30 01:36:32'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.1,24.1,112.6,19.2,115.3,21.0,116.8,21.9,115.5,23.1,114.7,24.2,'2026-07-06 02:58:04'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.3,31.0,113.2,25.0,113.2,25.3,117.5,27.1,114.1,30.8,117.8,30.3,'2026-07-05 10:16:20'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),150.0,20.8,112.2,19.6,148.0,22.7,117.7,20.5,112.9,19.8,112.2,19.2,'2026-07-05 03:26:05'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.1,29.2,112.8,29.1,116.7,28.9,112.7,29.8,113.3,26.4,116.1,26.1,'2026-07-04 17:15:54'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.0,20.3,113.6,21.1,113.8,21.1,115.2,21.5,153.0,21.8,115.2,21.7,'2026-07-04 21:16:10'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.6,30.1,114.7,29.8,116.0,30.7,116.2,28.6,113.1,28.9,114.5,30.3,'2026-07-05 15:23:48'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.4,21.5,117.4,19.4,114.4,20.0,116.0,22.2,114.6,20.9,114.3,20.4,'2026-07-04 03:33:16'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.0,20.8,118.0,20.7,116.6,21.0,115.5,22.7,114.6,19.8,115.6,22.5,'2026-07-01 19:14:59'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.8,26.2,114.4,28.1,112.6,27.1,114.9,30.5,118.0,26.2,113.4,27.0,'2026-07-04 10:23:23'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.6,22.5,113.5,23.2,112.6,21.5,115.6,22.0,115.8,23.8,116.2,19.4,'2026-07-02 19:47:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,31.0,117.7,30.0,90.0,25.5,112.8,27.4,116.9,30.3,113.7,28.4,'2026-07-03 13:51:11'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,117.7,25.8,113.3,25.7,113.8,27.5,113.9,30.0,114.0,29.1,'2026-06-29 13:56:28'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.4,30.3,114.5,26.3,112.6,27.9,117.5,30.1,112.0,26.3,115.2,30.4,'2026-07-04 07:22:29'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.1,23.1,116.5,20.8,114.6,95.0,113.4,20.3,112.2,19.6,142.0,24.0,'2026-07-04 23:16:52'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),81.0,26.7,113.4,26.4,115.0,30.8,116.2,30.1,115.4,95.0,117.1,29.4,'2026-06-29 09:55:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.5,27.7,112.4,26.6,114.5,25.0,116.5,28.7,112.1,25.3,117.9,95.0,'2026-07-05 10:32:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.4,21.6,115.4,19.2,115.9,22.8,112.7,24.4,117.7,23.7,113.6,24.6,'2026-07-01 05:44:48'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.2,25.4,115.6,29.2,117.9,28.7,114.4,25.3,112.6,30.4,115.1,25.7,'2026-07-02 10:17:05'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,23.3,112.1,19.8,117.5,19.0,115.5,24.1,112.7,19.8,116.0,20.9,'2026-07-05 02:47:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,30.9,115.0,30.4,113.8,30.5,113.5,28.5,117.8,29.0,112.7,29.2,'2026-07-05 09:24:14'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.0,20.5,113.8,24.6,112.5,24.8,114.6,22.8,113.1,21.4,117.2,21.2,'2026-07-02 19:53:31'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.8,23.1,112.4,19.0,115.1,23.6,114.9,22.7,113.7,22.3,114.7,21.4,'2026-07-04 04:09:19'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.3,25.1,116.0,29.4,114.2,31.0,114.3,27.3,112.9,30.4,116.6,25.5,'2026-07-03 14:55:48'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.8,29.1,113.6,27.4,116.2,25.2,116.1,30.8,112.0,30.2,114.6,94.0,'2026-07-04 16:27:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,91.0,114.6,22.4,117.1,23.8,112.9,19.0,115.2,23.6,117.0,23.2,'2026-06-30 21:38:05'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,26.1,112.0,28.4,112.9,28.3,76.0,28.8,116.6,29.8,117.1,25.7,'2026-06-29 14:25:46'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.5,19.7,112.1,24.2,113.2,21.0,117.9,19.9,144.0,19.8,112.7,23.0,'2026-07-05 01:37:41'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.5,25.2,113.5,25.1,117.4,25.4,115.9,26.8,114.1,26.5,117.5,29.8,'2026-06-30 08:43:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.9,23.1,114.6,24.1,116.0,19.8,116.1,22.2,113.4,19.1,115.1,24.8,'2026-07-05 03:25:33'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,20.4,112.7,23.2,116.2,22.9,113.6,24.9,152.0,21.5,114.0,21.2,'2026-07-06 00:00:36'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.9,29.4,113.7,26.1,117.3,27.6,116.0,25.3,112.9,28.3,148.0,27.4,'2026-06-29 08:37:06'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,26.4,114.8,30.7,112.9,27.8,114.6,29.2,117.7,28.5,116.0,25.1,'2026-06-30 17:22:36'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.9,28.9,114.5,26.8,117.3,28.1,117.1,30.6,116.3,26.1,113.6,26.1,'2026-07-01 11:12:40'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.7,19.5,112.7,23.6,117.5,21.5,114.1,21.0,115.7,24.9,140.0,22.6,'2026-07-05 21:58:45'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,19.3,113.4,23.2,116.3,22.8,113.4,24.4,117.8,24.1,112.2,20.7,'2026-07-01 19:49:01'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.5,20.1,115.8,19.5,113.8,25.0,112.8,19.1,115.4,24.9,114.2,23.3,'2026-07-01 00:32:47'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.4,28.8,117.3,25.0,117.2,27.2,112.7,30.3,112.2,26.9,93.0,25.0,'2026-07-01 08:58:57'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.6,28.6,114.3,28.9,112.5,28.8,112.1,26.1,114.7,25.6,114.1,27.4,'2026-07-05 17:04:28'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.4,28.2,NULL,NULL,114.8,28.7,NULL,NULL,117.0,29.9,113.3,25.8,'2026-06-30 07:54:05'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.1,29.0,115.4,29.9,113.8,27.8,114.8,25.0,113.8,31.0,115.9,29.4,'2026-07-01 15:06:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.1,21.7,114.1,19.3,116.1,24.7,112.1,24.0,117.2,23.4,112.3,21.6,'2026-06-30 19:48:19'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,25.8,114.5,28.0,114.8,25.1,116.0,27.7,112.9,26.2,114.2,28.7,'2026-07-05 13:50:02'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.2,29.0,115.2,27.3,112.5,25.5,113.9,85.0,114.9,30.3,115.6,29.8,'2026-07-01 17:00:45');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 0, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'SENSOR_FAULT', 'WARNING', 'لاستیک 1 — قطع سنسور'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 5 — باد بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'SENSOR_FAULT', 'WARNING', 'لاستیک 4 — قطع سنسور'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا');

-- ===== T105: batch 3 =====
-- Readings for T105 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.5,26.5,112.9,26.6,116.0,28.2,113.3,25.8,115.4,29.5,115.5,26.2,'2026-07-04 12:01:08'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.6,19.4,83.0,24.8,116.2,24.5,114.2,20.0,113.1,21.7,113.4,24.5,'2026-07-02 03:30:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.1,26.1,114.2,26.4,115.1,31.0,114.0,30.9,114.6,26.6,115.7,27.7,'2026-07-04 13:11:05'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),155.0,21.3,NULL,NULL,114.6,22.7,114.0,21.4,112.7,19.9,114.6,23.9,'2026-07-02 19:23:37'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.5,22.1,116.7,21.0,115.7,23.9,113.7,24.5,112.7,20.9,NULL,NULL,'2026-07-01 05:33:14'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.0,26.2,115.5,30.4,116.2,29.6,114.2,28.1,117.6,25.8,113.8,29.4,'2026-07-04 12:21:23'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.4,23.1,113.8,21.8,118.0,25.0,114.8,23.1,112.3,24.9,114.0,19.4,'2026-07-03 19:58:02'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,29.6,114.6,29.0,117.5,30.0,113.2,25.0,91.0,30.0,113.8,28.2,'2026-07-01 10:42:23'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,24.5,116.8,20.3,115.6,21.4,113.0,25.0,114.5,22.1,116.4,20.3,'2026-07-03 05:32:41'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.8,24.8,117.8,22.8,114.3,24.8,117.3,19.3,113.6,22.9,117.8,22.6,'2026-07-03 05:31:31'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.4,25.6,112.7,28.0,116.5,29.4,115.4,30.6,116.6,28.2,116.7,25.2,'2026-07-06 07:00:26'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.8,25.3,114.5,27.4,116.3,26.3,116.0,29.1,113.3,28.0,115.2,25.3,'2026-07-05 13:25:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.6,24.9,114.4,20.8,117.2,79.0,112.9,24.6,112.6,21.5,115.5,23.1,'2026-07-06 03:46:18'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.7,19.5,114.4,21.7,114.7,19.7,117.2,24.3,116.7,23.5,113.0,21.6,'2026-07-05 01:19:19'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.5,25.1,113.3,27.3,115.4,25.4,114.8,29.5,114.3,31.0,116.1,28.7,'2026-07-02 09:49:11'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.0,21.4,114.9,24.7,115.5,19.2,117.2,20.7,75.0,22.8,112.9,24.0,'2026-07-02 21:03:03'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.1,28.0,115.5,30.1,112.4,29.0,112.3,26.0,114.3,31.0,113.5,25.0,'2026-06-30 16:41:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,117.8,22.6,NULL,NULL,114.9,23.8,116.5,24.4,115.0,22.0,'2026-07-03 23:48:10'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.7,24.6,114.0,19.8,115.2,79.0,112.0,21.8,112.3,24.2,112.9,20.2,'2026-07-04 21:29:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.6,29.3,116.2,28.0,114.8,28.0,117.9,30.0,112.7,29.3,112.6,27.4,'2026-07-03 16:10:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,21.5,113.8,19.2,114.4,22.3,NULL,NULL,115.9,23.5,117.2,24.3,'2026-07-02 01:22:02'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,29.5,115.9,26.2,117.3,25.5,113.5,28.9,114.3,29.4,114.6,25.3,'2026-07-01 16:37:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.5,81.0,112.2,19.4,NULL,NULL,115.2,19.2,115.6,23.5,114.9,24.8,'2026-07-04 21:59:03'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.8,30.4,115.2,28.2,117.7,25.5,115.6,27.5,113.6,27.4,115.2,30.9,'2026-06-29 13:14:16'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,24.3,117.6,20.3,115.1,23.4,114.7,21.3,113.9,21.5,117.6,22.7,'2026-07-02 20:39:36'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),79.0,19.8,147.0,22.4,117.0,19.1,115.5,23.9,112.9,22.1,116.1,20.2,'2026-06-30 06:12:11'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,21.0,117.8,20.3,76.0,24.7,116.6,19.2,115.8,22.7,115.3,19.7,'2026-07-03 21:33:32'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.4,85.0,114.1,29.4,115.4,30.6,115.9,29.3,112.3,30.9,114.8,27.6,'2026-07-02 13:03:37'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.5,20.0,115.2,24.0,112.8,23.3,114.2,24.4,113.9,23.9,142.0,23.9,'2026-07-01 05:40:21'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),152.0,30.5,118.0,26.3,112.0,30.5,113.2,28.8,112.8,25.6,116.7,26.9,'2026-07-05 09:49:17'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.0,27.6,112.1,29.8,115.1,27.7,115.2,28.1,112.8,29.2,113.3,27.6,'2026-07-03 11:28:16'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.7,90.0,117.6,23.9,117.9,21.5,114.7,21.7,NULL,NULL,116.4,23.4,'2026-06-29 22:04:31'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),118.0,21.5,113.1,22.5,117.7,23.5,114.9,20.8,114.0,22.6,114.1,22.9,'2026-07-05 06:20:00'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.0,22.8,112.1,22.5,114.3,23.7,117.9,19.4,113.8,19.7,118.0,23.9,'2026-07-01 00:54:36'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.6,19.4,118.0,24.5,117.1,19.5,116.1,19.7,114.7,19.2,NULL,NULL,'2026-07-04 00:22:38'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.6,20.7,115.3,25.0,115.1,21.2,116.0,20.4,NULL,NULL,112.6,23.6,'2026-07-04 01:47:09'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.4,23.1,112.2,22.1,112.1,21.5,112.9,20.1,114.6,22.8,115.5,19.1,'2026-07-06 03:25:51'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.0,25.0,118.0,19.8,117.7,21.4,113.6,23.4,113.5,22.0,113.8,19.1,'2026-07-06 03:18:02'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.1,23.1,118.0,23.2,114.6,23.3,112.3,23.6,117.0,20.3,118.0,21.3,'2026-07-05 04:28:13'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.7,27.4,115.4,29.2,117.5,28.2,113.7,28.2,116.7,30.4,114.2,29.1,'2026-07-05 12:10:15'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.4,27.6,114.5,30.3,112.9,25.1,115.0,87.0,113.5,26.0,116.9,30.1,'2026-07-04 08:39:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.9,20.5,115.8,23.4,114.2,19.1,114.0,24.1,112.2,22.8,141.0,20.0,'2026-07-03 05:55:30'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.1,24.8,113.2,22.6,113.4,24.8,117.4,22.7,117.9,21.2,139.0,20.5,'2026-07-02 21:36:41'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),75.0,21.2,113.9,21.1,115.5,19.6,117.6,19.4,113.6,23.9,113.4,24.2,'2026-07-02 05:40:25'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.2,19.5,112.6,19.7,115.6,19.1,114.5,21.2,113.6,19.9,114.4,24.7,'2026-07-02 06:58:33'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.4,19.3,115.3,20.2,114.2,20.8,116.0,80.0,115.7,20.4,116.2,24.7,'2026-07-04 22:56:23'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.0,23.8,116.4,19.2,115.0,20.1,114.9,20.2,112.6,24.3,114.0,24.3,'2026-07-01 23:09:00'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.8,21.7,116.8,21.7,112.7,22.2,NULL,NULL,115.9,24.9,112.5,22.8,'2026-07-04 06:41:37'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.9,28.9,114.7,29.7,114.1,25.2,117.2,28.7,112.8,30.8,114.8,26.4,'2026-07-03 10:51:44'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),118.0,23.8,117.2,23.9,112.2,20.9,112.5,23.2,112.9,21.3,113.9,21.3,'2026-07-04 04:48:46');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'SENSOR_FAULT', 'WARNING', 'لاستیک 2 — قطع سنسور'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'SENSOR_FAULT', 'WARNING', 'لاستیک 6 — قطع سنسور'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'SENSOR_FAULT', 'WARNING', 'لاستیک 4 — قطع سنسور'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 29, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'SENSOR_FAULT', 'WARNING', 'لاستیک 6 — قطع سنسور'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'SENSOR_FAULT', 'WARNING', 'لاستیک 5 — قطع سنسور'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 47, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'SENSOR_FAULT', 'WARNING', 'لاستیک 4 — قطع سنسور');

-- ===== T105: batch 4 =====
-- Readings for T105 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.1,30.0,113.6,25.8,114.8,27.4,112.4,25.7,112.1,29.7,117.7,25.5,'2026-06-29 14:12:26'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,27.7,117.8,83.0,116.2,28.7,116.1,25.6,116.3,28.7,114.9,28.8,'2026-07-02 16:08:18'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.1,19.4,113.0,22.2,116.3,22.9,115.2,22.1,113.0,19.6,115.6,24.7,'2026-07-02 04:19:10'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,27.9,116.9,25.1,116.3,27.8,113.8,27.2,117.3,29.6,112.3,26.6,'2026-07-03 15:49:32'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.0,19.8,117.1,22.3,115.9,19.2,113.9,23.0,115.8,21.0,114.5,19.3,'2026-07-04 03:32:57'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.0,22.8,113.7,21.6,114.2,20.9,116.6,19.9,115.2,19.6,117.3,22.5,'2026-07-02 23:59:21'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.3,30.5,113.5,26.7,113.9,26.0,115.4,29.2,113.5,26.1,113.2,29.3,'2026-07-05 10:23:52'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.3,25.7,113.4,27.6,115.6,29.3,118.0,29.4,NULL,NULL,116.7,28.2,'2026-07-01 14:37:43'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),139.0,28.0,112.5,26.6,112.3,28.0,114.7,26.5,117.0,25.1,117.3,28.8,'2026-06-30 09:41:20'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.0,28.3,117.6,29.9,113.6,30.1,117.9,27.3,115.9,27.5,112.7,28.8,'2026-06-30 17:38:41'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,27.8,112.7,29.4,114.6,29.8,115.7,27.2,114.5,29.8,150.0,28.4,'2026-07-05 08:28:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.9,19.6,115.3,22.0,112.2,20.0,116.1,24.9,116.2,21.4,117.0,21.5,'2026-07-03 18:50:33'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.3,23.6,116.3,19.7,116.9,19.6,116.2,19.6,113.4,19.7,116.7,21.6,'2026-07-01 03:41:53'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.0,19.1,114.4,22.4,152.0,24.7,152.0,23.9,113.4,22.1,113.4,21.5,'2026-07-03 02:58:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.8,27.2,118.0,25.9,118.0,28.8,115.0,30.9,113.4,26.7,112.3,27.4,'2026-07-05 08:20:01'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.5,22.4,113.0,20.7,112.1,19.5,115.7,23.9,112.3,24.4,114.8,22.3,'2026-07-05 03:50:21'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.1,20.6,113.8,22.7,112.3,21.0,112.6,22.1,117.4,21.6,114.2,22.3,'2026-06-29 23:37:34'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.2,19.6,112.0,21.7,117.1,23.3,114.0,21.6,114.6,20.2,114.9,21.3,'2026-06-29 19:34:42'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.7,24.5,115.8,20.9,117.8,22.5,117.3,24.7,116.5,22.7,112.3,21.5,'2026-07-04 03:25:29'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.7,29.8,115.1,25.4,113.2,30.0,114.4,26.4,114.6,30.8,112.4,28.0,'2026-07-05 17:28:43'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,79.0,113.5,22.0,116.7,20.8,115.2,20.4,117.2,24.5,115.7,22.5,'2026-07-03 01:16:57'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.4,26.7,116.0,25.9,117.7,27.1,112.4,30.3,114.0,28.5,116.7,30.3,'2026-06-30 10:55:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.3,22.1,117.7,24.9,113.1,23.5,112.7,23.4,115.8,20.6,113.3,23.6,'2026-07-03 05:16:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.6,27.0,NULL,NULL,116.9,30.1,116.2,29.7,112.2,29.1,113.9,27.3,'2026-07-03 11:11:15'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.8,29.0,115.5,29.7,116.4,25.6,117.7,26.2,117.9,25.5,112.4,30.6,'2026-06-30 15:53:12'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.2,82.0,112.7,28.0,112.0,29.5,116.1,26.0,118.0,26.7,117.6,30.0,'2026-06-30 14:14:22'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.6,29.3,113.5,27.7,112.6,30.7,113.9,26.8,115.5,30.5,116.2,25.1,'2026-07-05 13:24:34'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.0,23.4,114.2,23.4,116.2,23.7,114.1,87.0,112.6,20.9,115.4,22.9,'2026-07-01 20:07:40'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.2,27.0,113.9,30.3,116.0,28.9,113.1,27.4,117.2,29.9,114.0,27.4,'2026-06-30 15:06:59'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.2,23.0,114.4,23.5,117.9,21.7,115.6,21.2,112.5,22.6,116.0,24.2,'2026-07-04 04:10:34'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.3,22.9,113.9,19.8,NULL,NULL,114.7,23.3,113.7,21.6,116.3,22.3,'2026-07-06 02:32:33'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.6,26.3,116.7,28.3,113.6,29.6,117.1,27.3,113.5,29.6,115.9,31.0,'2026-07-03 09:54:47'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,20.7,112.1,22.6,116.8,24.4,115.3,24.1,113.7,24.6,NULL,NULL,'2026-07-06 01:12:29'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.7,30.1,114.7,26.8,112.6,30.3,112.2,26.6,NULL,NULL,116.8,28.7,'2026-06-29 09:26:51'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.5,28.2,113.7,26.8,114.5,29.2,114.7,27.8,NULL,NULL,116.4,25.6,'2026-07-04 15:33:06'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.5,24.5,112.3,19.5,117.8,19.5,113.3,24.1,118.0,23.5,114.1,21.5,'2026-07-06 00:47:35'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,114.1,19.4,118.0,19.1,116.2,20.8,116.3,20.1,114.3,22.9,'2026-07-01 01:24:18'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,117.9,26.7,116.1,27.1,116.5,28.6,114.1,26.9,116.7,30.7,'2026-06-29 07:39:06'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.7,25.4,115.7,26.0,112.7,26.9,114.1,25.3,113.5,28.4,115.1,27.7,'2026-06-29 11:52:24'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.2,30.0,116.8,26.5,113.5,29.8,117.5,25.3,115.2,27.2,112.5,25.1,'2026-07-02 15:38:36'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,28.5,112.5,30.1,116.8,26.8,114.3,25.9,115.1,27.9,115.0,25.3,'2026-07-04 14:06:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,19.3,113.3,20.6,116.0,22.8,115.8,21.4,113.4,19.6,112.9,20.2,'2026-07-01 06:24:34'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.5,22.0,112.3,21.8,117.6,21.8,114.9,21.9,114.6,24.6,114.5,21.8,'2026-07-01 04:27:02'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.9,24.7,115.8,22.1,115.1,23.9,116.3,20.8,117.3,22.2,114.2,24.4,'2026-06-30 02:53:18'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.6,24.2,117.0,20.5,115.5,22.0,112.9,19.1,114.9,21.2,114.2,20.2,'2026-07-03 05:21:48'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.9,26.3,115.9,79.0,146.0,30.4,114.5,27.2,116.7,26.8,115.3,30.1,'2026-06-30 14:01:52'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,21.1,117.5,23.3,112.2,23.0,135.0,19.0,117.4,22.6,116.7,20.5,'2026-07-01 20:49:35'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.2,21.6,116.8,22.8,114.5,24.3,115.5,19.6,113.3,23.7,113.7,21.5,'2026-07-01 21:55:43'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.0,27.8,116.1,29.8,116.2,25.0,115.7,27.6,117.0,30.3,NULL,NULL,'2026-07-02 14:01:28'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.5,19.8,115.8,22.7,115.9,19.4,113.4,23.4,115.6,23.5,NULL,NULL,'2026-07-01 18:40:08');
SET @first = LAST_INSERT_ID();
SET @last = @first + 50 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'SENSOR_FAULT', 'WARNING', 'لاستیک 5 — قطع سنسور'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 23, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'SENSOR_FAULT', 'WARNING', 'لاستیک 2 — قطع سنسور'),
  (@first + 25, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'SENSOR_FAULT', 'WARNING', 'لاستیک 6 — قطع سنسور'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'SENSOR_FAULT', 'WARNING', 'لاستیک 5 — قطع سنسور'),
  (@first + 34, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'SENSOR_FAULT', 'WARNING', 'لاستیک 5 — قطع سنسور'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'SENSOR_FAULT', 'WARNING', 'لاستیک 1 — قطع سنسور'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'SENSOR_FAULT', 'WARNING', 'لاستیک 1 — قطع سنسور'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'SENSOR_FAULT', 'WARNING', 'لاستیک 6 — قطع سنسور'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'SENSOR_FAULT', 'WARNING', 'لاستیک 6 — قطع سنسور');

-- ===== T105: batch 5 =====
-- Readings for T105 (batch)
INSERT INTO `tpms_readings`
  (`truck_id`, `value1`,`value2`,`value3`,`value4`,`value5`,`value6`,`value7`,`value8`,`value9`,`value10`,`value11`,`value12`, `recorded_at`) VALUES
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.3,22.0,114.7,20.1,112.3,21.2,115.4,21.4,113.9,21.8,115.7,24.3,'2026-07-02 22:13:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.1,20.0,113.9,24.2,115.8,83.0,117.8,23.6,116.1,20.4,115.4,24.8,'2026-06-30 05:32:17'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.6,26.9,115.0,26.9,113.3,30.8,113.2,25.0,113.2,26.7,116.9,27.0,'2026-07-01 08:56:01'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),118.0,22.9,114.3,23.0,115.5,22.8,117.1,22.9,113.9,23.5,112.4,24.8,'2026-07-03 18:05:44'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.1,21.3,117.5,19.7,115.9,20.1,117.4,19.6,116.8,22.6,116.8,19.2,'2026-07-01 18:00:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.4,24.2,113.6,19.8,113.1,20.9,115.8,24.6,117.3,20.5,117.3,22.7,'2026-06-29 20:03:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.2,27.0,113.8,25.5,114.5,25.5,117.6,29.1,112.3,31.0,113.2,25.3,'2026-07-05 12:49:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,22.4,117.7,19.3,114.6,21.3,116.9,21.0,117.3,23.5,113.9,21.0,'2026-06-30 20:15:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.7,26.1,114.6,31.0,113.7,27.1,116.3,25.5,117.1,25.6,117.8,29.4,'2026-06-29 12:38:20'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.4,28.9,116.8,30.6,115.3,29.0,112.8,30.1,112.9,27.6,112.9,29.3,'2026-07-01 16:26:04'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.9,23.0,114.4,24.3,112.9,19.1,115.1,22.6,NULL,NULL,115.6,20.4,'2026-07-01 23:37:40'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.1,19.8,114.9,19.3,112.1,19.2,117.8,24.4,115.1,23.7,115.5,21.9,'2026-07-02 00:50:06'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.5,20.8,117.1,19.2,91.0,24.9,114.5,78.0,113.1,24.0,112.0,21.6,'2026-07-02 01:25:52'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.6,27.8,115.8,27.1,113.6,30.5,116.6,28.7,116.4,26.6,114.4,27.1,'2026-06-30 12:18:23'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.4,28.2,117.9,28.2,114.2,27.7,115.9,28.9,114.4,29.2,112.8,30.6,'2026-07-04 16:05:12'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.6,19.5,150.0,20.2,117.3,22.7,117.7,24.6,112.0,20.3,112.7,23.8,'2026-07-06 00:33:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,24.1,113.5,22.5,113.8,20.9,112.7,20.6,112.3,21.3,115.5,20.5,'2026-06-29 23:30:18'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.0,26.3,114.1,29.6,NULL,NULL,115.5,26.6,114.5,30.2,114.6,30.3,'2026-07-01 08:11:25'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,30.7,118.0,29.2,117.6,26.0,NULL,NULL,116.8,25.7,114.3,26.3,'2026-07-04 11:48:05'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.1,21.7,118.0,24.3,116.0,22.1,114.5,20.7,115.0,20.7,117.3,22.6,'2026-06-30 01:29:26'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.2,29.0,114.0,30.7,114.1,28.8,116.4,28.9,114.9,26.7,116.5,29.0,'2026-07-03 11:58:30'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.7,27.8,116.7,29.1,115.1,27.7,115.9,27.6,116.9,27.2,117.6,25.7,'2026-07-04 09:41:33'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,24.9,112.3,22.6,115.2,24.2,114.5,88.0,115.6,22.0,117.9,20.7,'2026-07-01 02:58:06'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.0,29.7,115.8,26.0,112.3,28.6,114.7,29.1,117.1,29.0,113.7,25.0,'2026-06-29 17:33:53'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.5,25.0,117.5,26.4,117.0,30.6,116.7,28.1,93.0,26.7,112.9,30.7,'2026-07-02 15:53:19'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.1,24.4,114.5,23.0,112.3,23.0,117.9,23.4,115.6,19.4,116.5,22.3,'2026-06-30 23:51:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.7,23.0,115.2,21.3,112.5,24.6,114.0,23.6,117.3,23.2,112.1,23.3,'2026-06-30 21:49:08'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.5,25.8,113.1,27.6,114.3,27.5,113.8,29.7,115.9,29.9,117.3,27.1,'2026-07-02 10:03:33'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.4,28.6,112.4,27.9,112.9,28.6,112.6,30.0,114.1,26.3,113.7,28.9,'2026-06-29 11:24:40'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.3,29.9,115.0,26.7,114.4,29.9,115.0,25.1,115.9,26.6,116.0,30.3,'2026-07-03 08:02:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.4,22.0,117.5,21.6,NULL,NULL,115.7,20.7,112.3,22.1,113.5,20.9,'2026-07-01 01:28:15'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,21.9,116.2,19.3,116.1,20.6,116.9,20.8,116.2,19.4,116.4,22.4,'2026-07-01 22:25:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.9,22.2,113.4,21.1,116.0,22.1,114.1,24.6,115.9,23.2,112.9,22.4,'2026-07-01 20:52:38'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.1,30.3,117.0,30.3,113.9,30.3,112.6,86.0,116.0,29.0,113.0,26.5,'2026-06-29 14:17:29'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,25.0,113.6,27.5,114.8,29.0,115.1,29.2,117.1,30.2,112.7,28.5,'2026-07-02 15:19:25'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.2,22.3,113.8,21.3,112.7,21.9,NULL,NULL,78.0,21.2,114.8,23.7,'2026-07-02 04:13:41'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.0,91.0,116.4,28.8,114.0,29.3,112.9,25.7,117.1,29.9,117.0,30.9,'2026-06-29 08:26:23'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.2,20.2,113.5,21.3,89.0,22.3,112.8,19.8,116.9,19.5,114.2,24.2,'2026-07-03 06:27:34'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.4,20.7,117.8,24.4,113.9,22.9,116.3,24.9,116.9,23.6,117.2,24.6,'2026-07-06 05:08:48'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.1,20.2,NULL,NULL,112.3,24.8,117.1,21.3,114.3,22.5,112.1,22.2,'2026-06-29 23:45:57');
SET @first = LAST_INSERT_ID();
SET @last = @first + 40 - 1;
INSERT INTO `tpms_alerts`
  (`reading_id`, `truck_id`, `tire_index`, `alert_type`, `severity`, `message`) VALUES
  (@first + 1, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'SENSOR_FAULT', 'WARNING', 'لاستیک 5 — قطع سنسور'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'SENSOR_FAULT', 'WARNING', 'لاستیک 4 — قطع سنسور'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 24, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'SENSOR_FAULT', 'WARNING', 'لاستیک 2 — قطع سنسور');

-- ============================================================
-- خلاصه: تعداد ردیف‌های درج‌شده
-- ============================================================
SELECT 'trucks' AS tbl, COUNT(*) AS n FROM `trucks`
UNION ALL SELECT 'tpms_readings', COUNT(*) FROM `tpms_readings`
UNION ALL SELECT 'tpms_alerts',   COUNT(*) FROM `tpms_alerts`;