-- TPMS Sample Data (compact) — Run in phpMyAdmin SQL tab
-- 60 قرائت برای هر دامپتراک (۳۰۰ کل) — بازه ۷ روز

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

-- ===== T101 =====
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,25.7,116.6,27.4,116.1,24.5,116.1,27.5,119.4,26.6,116.0,25.0,'2026-07-04 22:53:28'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,26.1,118.2,26.2,118.9,27.4,116.5,27.5,118.3,27.6,117.4,25.8,'2026-07-04 10:01:55'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.4,25.7,117.0,26.3,116.4,27.8,117.5,25.0,120.0,27.5,116.3,25.4,'2026-07-05 01:54:00'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.7,24.4,118.0,25.3,118.9,24.9,119.5,27.4,119.7,26.5,116.8,27.2,'2026-07-01 10:28:16'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,28.0,119.8,24.4,118.9,27.3,116.0,24.7,117.7,26.1,118.9,24.0,'2026-07-04 23:22:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,25.1,120.0,25.9,117.2,24.9,119.3,24.0,116.7,26.3,117.9,25.5,'2026-07-03 02:36:04'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,27.1,119.4,24.8,119.5,25.0,118.7,25.3,117.2,25.9,118.3,26.8,'2026-07-05 08:22:45'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.4,24.4,117.4,27.7,120.0,24.3,118.1,24.4,119.1,25.3,119.6,27.6,'2026-07-03 07:06:40'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,24.6,118.7,26.6,116.6,24.3,116.6,25.5,116.8,26.7,116.4,26.8,'2026-07-01 08:45:14'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,27.4,117.5,25.0,143.0,24.3,118.9,25.8,119.5,27.1,116.3,27.7,'2026-07-05 02:48:03'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,24.3,119.3,25.0,117.1,24.4,117.5,26.5,117.5,27.7,118.6,27.7,'2026-07-02 11:58:29'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.3,26.0,117.9,26.9,116.4,24.0,116.6,24.4,116.8,26.2,118.3,25.8,'2026-07-03 03:21:55'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.9,27.3,117.9,24.6,116.7,24.6,117.8,27.8,120.0,25.6,116.3,24.5,'2026-07-02 15:12:15'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.0,26.1,117.6,25.0,118.7,27.5,116.9,27.4,119.5,24.9,118.3,24.2,'2026-07-05 18:28:39'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,26.2,118.6,27.9,117.5,25.0,118.6,24.1,118.6,25.5,116.6,26.4,'2026-07-03 06:38:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,26.9,117.4,25.4,118.1,25.7,117.7,26.2,119.4,26.1,117.6,25.1,'2026-07-03 14:31:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,27.8,118.0,26.7,118.4,27.6,118.7,24.0,117.2,26.3,118.1,27.9,'2026-07-05 20:10:32'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,25.9,117.8,27.5,118.4,25.1,119.5,24.0,119.7,27.8,118.8,25.3,'2026-07-02 15:50:37'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,25.8,118.1,24.5,117.9,25.4,116.2,25.5,116.4,26.9,117.2,26.4,'2026-07-04 05:53:33'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,26.7,119.3,26.9,116.7,26.9,119.3,27.5,118.8,27.9,118.7,27.5,'2026-07-06 05:42:13'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,25.6,117.7,27.3,118.8,24.4,118.1,26.0,116.9,25.4,117.3,24.4,'2026-06-30 13:03:35'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,24.3,119.7,24.1,118.4,27.0,118.4,26.6,119.8,25.4,119.1,24.1,'2026-06-30 15:36:30'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,26.9,119.4,24.1,116.1,24.5,118.9,25.1,117.3,26.9,118.4,25.7,'2026-07-01 09:33:11'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,27.0,118.2,25.4,116.2,24.1,116.1,27.9,116.7,27.6,117.6,26.3,'2026-07-03 05:50:22'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,25.9,117.9,27.6,118.5,25.2,120.0,25.5,119.8,24.7,116.2,26.2,'2026-07-04 21:57:31'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.2,26.1,119.1,24.6,118.9,24.9,117.7,27.9,119.0,26.9,117.7,26.0,'2026-07-05 11:14:01'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.7,26.8,119.9,26.4,118.0,25.1,117.6,26.1,117.7,27.5,116.5,25.5,'2026-07-05 06:04:35'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),142.0,27.1,118.5,25.5,119.0,27.5,119.5,26.1,117.9,25.6,118.0,24.7,'2026-07-03 09:19:10'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.2,25.3,119.7,27.3,117.2,25.8,116.0,27.4,116.3,27.5,150.0,27.1,'2026-07-04 01:23:24'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,26.1,119.0,24.7,116.4,27.6,116.9,27.6,117.5,24.7,119.8,27.9,'2026-06-30 11:52:59'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,25.9,117.9,27.6,116.6,25.3,116.5,25.0,117.0,24.0,119.0,25.8,'2026-06-30 20:05:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.9,24.4,120.0,27.7,118.7,24.7,117.7,24.9,117.9,27.8,117.8,26.8,'2026-07-02 20:58:16'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.7,27.2,119.8,24.2,119.8,25.6,119.6,27.7,117.7,27.6,119.0,27.3,'2026-07-01 10:04:47'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.7,26.7,116.5,27.0,116.6,25.0,117.8,26.5,118.9,24.5,118.5,92.0,'2026-07-04 02:27:22'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,25.2,119.1,28.0,117.7,27.5,119.1,24.7,137.0,25.0,117.4,24.7,'2026-07-01 06:57:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.1,25.8,119.0,27.0,118.4,25.2,116.8,24.4,118.6,26.1,116.0,25.8,'2026-07-04 10:28:17'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,26.8,119.5,27.4,117.2,25.5,118.6,24.2,118.4,26.4,116.9,27.1,'2026-06-30 08:42:02'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.6,26.8,116.0,24.9,116.9,24.4,118.1,27.9,118.1,27.4,119.1,27.4,'2026-07-02 06:37:06'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.4,24.5,120.0,24.6,116.1,24.2,118.2,26.3,118.6,27.6,117.1,24.5,'2026-07-02 19:36:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.1,27.7,144.0,26.9,119.4,25.0,119.7,25.9,117.6,26.9,118.4,27.0,'2026-07-03 09:10:19'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.6,25.8,118.5,25.7,116.3,27.8,117.8,25.4,120.0,25.2,116.8,28.0,'2026-07-01 22:45:52'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.9,26.8,116.8,24.5,118.6,25.1,118.3,27.3,117.0,25.6,117.8,26.1,'2026-07-05 19:50:10'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,25.4,118.5,27.5,116.0,25.6,117.6,27.7,118.3,24.6,119.9,27.5,'2026-07-05 09:23:10'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,26.9,118.6,24.7,117.9,27.1,119.4,24.8,119.4,26.6,118.6,24.6,'2026-07-05 12:54:20'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.2,26.3,117.5,26.3,119.4,26.2,116.7,26.9,120.0,27.8,118.1,25.5,'2026-07-02 21:50:19'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.4,27.5,117.4,26.1,119.8,24.0,116.8,27.4,116.1,24.8,117.5,27.7,'2026-07-03 19:32:54'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,26.6,119.0,26.8,116.6,26.8,116.2,27.3,116.1,24.3,118.7,24.6,'2026-07-05 16:03:23'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.5,26.0,117.7,27.9,118.0,26.4,118.9,27.2,116.7,27.5,118.8,25.4,'2026-07-05 09:54:47'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.6,24.6,117.6,26.3,119.0,24.4,118.7,24.6,116.8,27.5,119.5,26.1,'2026-07-01 11:10:49'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.3,25.8,119.6,27.2,117.4,24.6,116.7,25.7,119.5,27.9,116.1,27.8,'2026-07-01 04:07:46'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.1,25.1,118.1,26.2,119.6,26.5,116.1,24.5,118.6,26.9,118.0,27.6,'2026-07-03 01:25:08'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.0,27.9,118.8,26.7,117.7,25.3,118.7,24.7,119.1,27.3,118.5,27.8,'2026-07-04 10:00:10'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.8,25.6,119.1,26.7,117.4,27.2,118.2,24.4,118.7,24.1,118.0,27.6,'2026-07-03 17:47:33'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),117.8,24.7,117.0,27.9,118.3,24.5,118.7,27.7,117.9,26.1,116.4,27.2,'2026-07-01 05:39:24'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.2,26.2,116.9,25.5,117.1,27.8,116.4,25.1,118.9,27.6,119.6,28.0,'2026-07-03 22:50:25'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),116.9,26.8,117.9,25.7,116.4,25.9,118.3,25.8,116.5,27.9,119.7,27.5,'2026-07-02 11:14:12'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),118.8,27.6,119.0,27.2,116.6,26.1,117.1,24.2,118.8,27.3,118.3,25.8,'2026-07-05 19:22:12'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),120.0,26.1,118.4,25.8,119.8,24.9,116.9,26.2,118.5,24.8,117.9,27.5,'2026-07-05 16:03:58'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.3,24.5,118.3,24.1,117.3,26.1,117.4,24.8,116.6,27.2,119.3,24.2,'2026-07-04 18:05:46'),
  ((SELECT id FROM trucks WHERE truck_code='T101'),119.8,26.4,119.9,25.0,118.3,25.5,118.8,25.4,119.0,25.2,118.8,26.9,'2026-07-04 17:08:53');
SET @first = LAST_INSERT_ID();
SET @last  = @first + 60 - 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 — باد بالا');

-- ===== T102 =====
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'),117.7,29.3,146.0,25.7,118.0,25.3,114.5,27.6,116.7,30.5,115.8,29.7,'2026-06-30 04:50:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.6,29.0,114.0,28.7,112.2,28.2,116.6,30.0,117.0,29.7,113.2,27.2,'2026-07-01 06:28:17'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.4,25.4,114.5,24.6,118.9,29.8,119.3,31.6,118.3,27.0,113.0,31.8,'2026-06-29 21:35:39'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.0,30.7,119.7,30.9,118.0,24.2,86.0,28.7,114.0,32.0,117.2,25.7,'2026-07-04 00:45:35'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.9,30.1,113.8,29.8,113.5,24.5,118.0,84.0,114.6,88.0,116.4,25.5,'2026-07-04 04:19:13'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.6,28.9,119.3,28.7,112.0,29.4,115.3,30.9,115.1,27.7,118.4,26.1,'2026-07-01 10:48:14'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.5,31.8,113.7,24.9,117.5,26.0,120.7,29.6,115.6,28.6,120.7,25.9,'2026-07-05 18:58:55'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.6,24.9,118.0,28.0,112.4,24.3,117.9,31.1,116.7,26.7,119.2,26.5,'2026-07-01 18:57:43'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.2,29.6,117.0,28.4,114.7,27.8,115.2,28.6,113.5,25.7,117.6,31.0,'2026-06-30 19:39:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.6,31.8,118.0,30.1,118.3,24.9,113.9,29.7,112.6,31.0,114.6,29.5,'2026-06-29 14:38:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.6,25.9,115.8,28.4,114.6,25.0,120.0,27.5,117.8,25.1,120.4,25.9,'2026-07-04 19:09:15'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),93.0,24.5,116.3,26.6,111.3,30.3,116.8,30.1,116.1,27.8,115.0,29.6,'2026-07-02 04:58:48'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.7,25.8,117.4,29.1,118.1,25.3,116.4,29.7,114.7,28.9,115.0,28.1,'2026-07-02 04:13:50'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.0,30.3,116.9,30.3,117.4,29.8,117.5,24.6,117.0,27.6,118.5,25.7,'2026-07-04 00:01:32'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.6,24.5,115.4,28.6,117.4,29.7,120.9,31.8,116.0,28.7,117.6,25.8,'2026-07-01 09:51:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.5,24.5,119.0,30.6,117.5,25.7,115.0,29.0,114.8,31.5,119.8,30.2,'2026-06-30 05:39:38'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.7,28.2,120.4,27.9,119.0,24.3,140.0,31.3,117.7,32.0,117.8,25.8,'2026-07-06 02:28:22'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.4,26.4,114.9,29.2,118.8,30.0,113.7,25.7,117.1,30.7,118.8,30.8,'2026-06-29 08:32:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.8,30.1,120.1,27.8,114.8,27.6,119.2,28.0,114.5,27.6,117.8,29.0,'2026-07-03 02:19:04'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.7,24.5,117.4,29.6,113.7,26.5,120.1,27.4,118.5,27.0,145.0,26.8,'2026-07-04 12:39:16'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.2,25.7,115.0,29.2,117.0,30.1,93.0,28.1,113.9,30.8,113.4,26.2,'2026-06-30 13:43:16'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.0,30.3,116.7,24.4,112.3,28.2,119.9,30.7,117.4,29.9,117.2,26.0,'2026-07-05 20:44:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.1,28.3,115.4,26.2,116.1,29.4,114.2,26.3,114.1,24.0,116.4,28.2,'2026-07-04 01:05:04'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.3,28.6,114.5,29.9,117.4,27.9,116.7,28.7,112.7,30.1,120.7,28.7,'2026-07-06 03:59:16'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.8,26.7,120.6,25.0,115.6,24.9,120.0,30.4,113.1,28.1,115.6,31.4,'2026-06-30 14:10:48'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.7,29.8,120.2,24.7,114.9,24.2,115.7,31.4,111.8,30.9,113.8,30.0,'2026-06-30 21:33:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.3,28.7,117.8,28.8,117.9,25.7,115.2,30.8,113.8,24.0,118.9,30.9,'2026-07-04 15:52:20'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.1,29.8,114.4,24.4,111.2,27.0,113.4,29.7,111.6,27.1,115.9,30.9,'2026-07-03 12:25:27'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.7,30.4,120.3,28.0,115.1,27.0,119.6,26.8,118.1,31.5,155.0,29.4,'2026-07-05 14:52:42'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.7,28.0,116.8,28.8,114.0,26.8,118.9,24.7,118.1,30.7,115.6,28.2,'2026-07-01 16:17:58'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.1,30.8,116.4,28.8,111.9,26.4,120.1,26.7,78.0,27.8,119.1,27.1,'2026-07-01 19:14:05'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.0,31.0,118.9,30.8,115.6,30.5,119.0,28.0,116.2,24.5,114.8,24.2,'2026-07-01 11:47:29'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.7,25.9,120.2,27.1,115.3,27.2,119.2,29.8,113.1,25.7,119.9,24.7,'2026-07-01 05:41:25'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.6,24.0,115.9,92.0,115.7,24.7,120.8,95.0,116.2,24.1,119.8,27.6,'2026-07-05 09:40:06'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.2,25.3,116.0,26.4,115.5,27.4,118.1,29.8,113.8,27.8,113.4,25.1,'2026-07-01 01:54:19'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.7,24.1,118.5,28.2,112.2,30.7,120.2,30.0,135.0,30.9,115.6,31.5,'2026-06-30 12:40:20'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.9,27.8,117.9,30.9,112.7,25.0,113.6,25.2,115.3,31.7,118.0,28.1,'2026-07-01 11:18:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.2,26.9,118.5,26.3,112.0,31.9,113.9,25.0,112.9,28.9,113.0,27.9,'2026-06-30 20:05:11'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.6,25.1,152.0,30.5,112.1,31.6,117.9,24.1,112.0,31.1,120.3,30.6,'2026-07-05 01:32:30'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.4,27.8,115.1,29.5,111.9,28.6,121.0,30.3,112.3,25.7,117.2,31.9,'2026-07-04 14:52:43'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.2,29.5,120.6,25.7,113.5,30.1,117.0,27.7,118.3,27.1,118.0,28.6,'2026-06-30 23:05:40'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.3,31.0,115.6,29.6,111.8,29.2,116.8,27.0,116.4,28.8,119.1,31.4,'2026-06-29 16:23:34'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.9,24.4,119.8,31.6,114.1,28.5,120.2,29.1,116.5,25.3,119.5,30.6,'2026-07-01 05:28:47'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.7,28.7,120.5,30.4,117.1,25.3,114.0,25.4,115.4,27.9,119.6,30.1,'2026-07-03 14:56:19'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.0,24.8,114.4,24.2,113.1,27.1,117.2,31.1,116.1,32.0,118.5,29.0,'2026-06-30 19:32:02'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),81.0,31.5,116.5,24.8,117.8,26.3,114.4,27.3,115.0,31.6,114.4,28.4,'2026-07-03 21:50:38'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),114.8,31.8,117.0,25.5,115.7,25.8,114.7,31.3,117.8,26.2,114.7,26.3,'2026-07-04 05:03:59'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),115.5,24.1,117.9,31.1,117.2,29.3,115.1,25.0,113.8,27.7,116.6,26.1,'2026-07-05 15:42:12'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.0,30.5,119.9,28.6,116.6,30.9,146.0,27.8,112.1,29.6,116.0,26.6,'2026-06-30 07:02:54'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),118.8,32.0,115.6,26.6,117.8,27.5,116.7,27.7,117.5,25.2,118.2,24.7,'2026-07-02 01:11:24'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),112.6,27.1,116.1,29.0,114.4,32.0,114.1,29.1,115.7,29.8,113.0,25.1,'2026-07-04 18:21:36'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.8,30.8,115.7,30.3,115.3,31.0,119.2,28.3,111.5,25.2,113.2,25.5,'2026-07-01 22:58:44'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.0,29.4,114.6,27.8,114.5,25.1,117.7,26.1,113.9,29.4,113.0,26.7,'2026-06-30 18:20:54'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),117.6,29.6,114.5,29.4,113.9,28.9,114.3,28.0,115.8,25.7,113.8,30.7,'2026-07-03 13:26:09'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.6,28.4,114.9,29.2,113.7,25.1,114.5,31.5,116.4,28.0,114.0,27.1,'2026-07-04 07:30:59'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.3,27.8,90.0,29.0,115.9,25.4,145.0,30.7,112.6,28.9,117.6,30.9,'2026-07-02 20:19:46'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),111.2,31.5,113.5,24.7,114.6,32.0,118.4,29.1,118.8,25.9,119.5,26.6,'2026-07-05 10:03:30'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),116.0,31.5,113.8,27.9,114.0,24.7,114.4,83.0,112.5,24.1,115.0,30.3,'2026-07-02 08:08:45'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.1,28.7,143.0,25.5,117.7,24.8,121.0,24.9,111.7,30.3,115.0,27.2,'2026-07-03 03:48:27'),
  ((SELECT id FROM trucks WHERE truck_code='T102'),113.9,30.5,113.1,27.1,112.9,26.2,120.0,29.3,115.0,27.4,91.0,30.4,'2026-07-04 21:43:31');
SET @first = LAST_INSERT_ID();
SET @last  = @first + 60 - 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, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 3, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 4, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 11, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T102'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@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'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T102'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 48, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 4 — باد بالا'),
  (@first + 55, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 57, (SELECT id FROM trucks WHERE truck_code='T102'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 58, (SELECT id FROM trucks WHERE truck_code='T102'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 59, (SELECT id FROM trucks WHERE truck_code='T102'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد');

-- ===== T103 =====
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.5,25.4,135.0,30.4,89.3,23.2,121.7,28.9,109.1,29.9,109.4,29.8,'2026-07-05 17:56:28'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.1,26.4,121.4,30.6,91.8,26.2,118.9,25.6,108.6,28.1,91.0,29.5,'2026-07-01 07:53:13'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.4,30.7,117.5,28.7,92.2,24.5,119.7,29.2,107.6,30.4,110.4,30.3,'2026-07-01 07:00:26'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.4,25.4,121.9,28.7,89.8,24.9,119.2,29.9,107.6,30.4,110.3,26.9,'2026-07-03 00:06:21'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,30.3,121.5,26.5,87.3,26.3,118.1,25.1,79.0,29.7,106.7,25.0,'2026-07-05 19:34:19'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.8,26.2,121.0,31.0,81.0,27.8,122.7,29.1,111.7,30.4,106.2,31.0,'2026-07-03 14:34:21'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.7,30.2,119.4,29.3,92.8,23.1,117.9,25.2,110.1,26.8,109.0,25.3,'2026-06-29 08:09:46'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.2,29.1,146.0,30.1,90.0,25.4,120.6,28.2,136.0,27.0,111.1,28.0,'2026-07-01 05:12:28'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.0,25.6,120.4,30.2,91.8,28.0,122.1,27.4,111.4,26.1,111.1,29.7,'2026-07-03 11:31:19'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.5,29.4,117.9,28.6,92.1,27.6,118.1,85.0,106.1,28.3,109.9,26.2,'2026-07-05 23:06:11'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.8,30.1,117.1,25.9,91.9,22.7,117.4,27.3,109.7,25.6,107.0,29.6,'2026-07-04 03:37:47'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.1,27.0,121.4,30.6,88.4,26.2,118.9,29.6,110.6,25.0,108.5,30.4,'2026-06-30 09:24:41'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.1,28.8,120.9,26.4,145.0,22.9,118.0,88.0,108.8,25.0,106.4,27.2,'2026-07-05 21:53:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.3,27.4,118.0,30.6,89.2,25.4,122.0,30.5,107.4,26.0,106.2,26.8,'2026-07-06 06:56:44'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.4,27.1,121.6,25.4,87.5,24.1,120.0,29.5,107.0,28.8,106.6,27.1,'2026-07-05 00:48:55'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.6,30.9,118.8,95.0,92.3,25.1,119.7,25.5,84.0,28.0,106.5,28.0,'2026-06-29 13:55:19'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.0,28.1,121.1,28.4,149.0,24.3,118.6,26.4,106.9,89.0,111.1,28.4,'2026-07-01 11:32:53'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.5,25.3,119.6,28.4,90.6,27.6,119.5,94.0,111.1,28.6,106.7,31.0,'2026-07-03 13:03:03'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),88.0,30.1,118.2,30.2,88.6,24.0,117.4,25.5,108.0,30.4,111.5,25.0,'2026-07-04 06:37:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.0,27.6,120.6,28.7,87.6,27.9,122.0,26.8,111.6,27.6,109.6,28.8,'2026-06-29 23:06:42'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.9,28.9,117.2,27.5,88.5,22.3,122.7,27.3,107.9,26.9,110.4,29.3,'2026-07-01 09:56:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.9,29.7,118.7,29.6,88.2,24.8,121.7,28.1,111.2,25.3,107.9,29.5,'2026-07-04 16:10:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.6,28.6,122.3,26.2,89.9,22.3,118.7,27.3,150.0,30.9,109.8,27.8,'2026-06-29 22:36:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.2,27.2,121.7,30.3,89.4,22.3,118.3,30.4,107.3,26.7,111.5,29.9,'2026-06-29 14:43:52'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.8,25.8,117.0,26.4,88.9,26.5,119.7,30.7,107.6,26.3,111.2,28.9,'2026-06-30 13:13:41'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.2,30.3,120.8,28.8,90.0,22.4,119.0,30.5,112.0,30.7,109.3,90.0,'2026-06-30 02:19:46'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.3,25.8,118.8,26.6,91.7,22.2,122.2,26.2,110.3,28.4,112.0,29.2,'2026-07-02 10:13:58'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.3,29.2,117.6,28.0,92.1,25.5,142.0,30.7,110.7,30.5,108.1,27.3,'2026-07-04 05:48:24'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.0,25.3,123.0,28.9,90.2,22.7,118.9,27.6,106.8,26.2,111.7,30.8,'2026-07-04 21:00:45'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.9,25.5,141.0,27.0,91.8,26.9,120.1,91.0,110.0,27.7,108.4,25.0,'2026-07-04 02:47:10'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),123.0,25.0,120.3,85.0,88.4,26.4,117.6,27.4,106.4,30.2,108.9,29.6,'2026-07-01 18:38:42'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.6,29.3,122.7,28.1,93.0,27.8,118.4,26.4,110.6,25.1,108.3,86.0,'2026-07-01 01:00:17'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),75.0,25.3,117.3,29.4,87.7,25.5,138.0,29.4,110.2,28.3,106.8,27.6,'2026-06-29 19:33:59'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.8,25.7,120.8,26.2,88.2,24.2,117.2,28.5,111.9,80.0,111.8,25.7,'2026-07-04 21:01:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),123.0,81.0,122.7,26.6,76.0,23.6,122.4,26.8,108.7,29.7,111.6,25.2,'2026-07-04 11:52:38'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.1,27.2,118.7,30.6,89.1,23.1,119.9,26.7,109.0,30.1,107.0,25.7,'2026-07-04 05:39:12'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.6,27.6,120.6,29.3,91.9,24.2,122.6,30.3,109.0,30.8,108.8,25.2,'2026-07-04 08:53:29'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.5,30.5,120.6,29.6,91.2,27.5,121.4,28.9,107.5,28.0,108.4,25.9,'2026-07-06 03:43:07'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.0,29.1,120.0,30.4,91.8,25.1,118.7,25.3,153.0,27.5,108.8,25.5,'2026-07-05 15:25:31'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.1,29.7,94.0,25.2,90.9,26.0,118.3,29.1,108.3,30.2,108.9,27.1,'2026-07-04 20:44:34'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.5,29.2,155.0,29.8,92.1,23.8,117.6,25.2,111.2,29.5,107.6,28.9,'2026-06-30 13:30:31'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.3,27.9,119.1,81.0,91.9,27.7,120.2,79.0,109.5,30.9,111.9,28.2,'2026-07-01 12:52:46'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.6,30.2,120.8,28.8,89.4,24.6,121.8,26.5,107.8,27.8,109.8,29.4,'2026-07-04 04:44:22'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.5,27.0,121.0,26.3,88.8,26.3,121.5,29.1,109.4,29.4,110.8,27.2,'2026-06-29 15:45:31'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.3,29.7,75.0,30.4,140.0,22.9,118.8,29.3,110.4,30.0,106.2,27.2,'2026-07-01 05:43:10'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.5,26.4,118.5,28.2,88.8,26.4,119.4,27.6,108.0,28.5,107.2,28.9,'2026-06-29 11:39:28'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.3,26.4,121.1,27.3,90.8,23.2,118.8,27.8,107.1,26.1,106.2,27.7,'2026-06-30 22:16:01'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.7,30.4,121.5,30.9,89.0,25.8,120.9,30.3,109.6,28.5,108.0,28.3,'2026-07-04 08:26:41'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.0,28.2,119.5,25.5,91.2,24.1,123.0,29.8,109.5,30.2,106.7,29.2,'2026-07-05 11:27:39'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.2,29.3,122.0,31.0,91.6,23.8,121.9,27.3,109.1,25.2,108.0,95.0,'2026-07-03 08:17:56'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.0,25.4,118.3,30.5,88.3,25.4,121.7,29.9,106.4,88.0,106.2,25.5,'2026-07-06 05:11:01'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.5,25.4,118.6,27.6,89.7,24.0,120.4,25.0,110.8,29.7,106.4,27.2,'2026-07-03 05:56:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.8,25.5,92.0,27.5,88.4,22.8,122.4,28.4,107.9,29.3,111.5,29.6,'2026-07-02 15:32:38'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.5,30.5,117.0,28.6,93.0,22.5,122.7,29.6,110.1,30.4,107.4,28.9,'2026-07-06 04:04:16'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),121.2,92.0,121.1,28.5,88.6,22.6,123.0,27.1,85.0,25.6,109.1,27.8,'2026-07-04 02:29:40'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),120.6,28.6,119.7,26.0,88.4,26.5,122.3,27.3,111.6,28.0,107.9,28.1,'2026-07-04 10:55:50'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),122.3,26.7,120.4,26.2,87.4,78.0,122.2,28.7,107.3,30.8,111.7,28.4,'2026-07-05 07:26:32'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),119.5,26.4,122.4,26.8,94.0,24.5,121.3,26.0,107.0,26.1,111.5,25.9,'2026-07-01 20:45:59'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),117.2,26.4,118.6,27.3,90.3,27.8,122.8,88.0,106.6,29.5,107.7,30.3,'2026-07-01 22:48:43'),
  ((SELECT id FROM trucks WHERE truck_code='T103'),118.1,27.4,121.1,30.7,89.4,27.8,122.2,30.5,111.6,28.8,108.8,26.0,'2026-06-29 09:14:51');
SET @first = LAST_INSERT_ID();
SET @last  = @first + 60 - 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'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@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'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@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'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@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'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@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'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@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'), 6, 'HIGH_TEMP', '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, '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'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@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'), 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'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@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'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@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'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 50, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 51, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 52, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 53, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 54, (SELECT id FROM trucks WHERE truck_code='T103'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 55, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 56, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 57, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 58, (SELECT id FROM trucks WHERE truck_code='T103'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 59, (SELECT id FROM trucks WHERE truck_code='T103'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد');

-- ===== T104 =====
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'),117.7,50.8,124.1,50.0,119.2,49.9,117.6,62.1,115.2,53.2,117.0,82.0,'2026-07-02 21:31:37'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.1,53.6,120.1,62.3,124.2,54.2,154.0,59.0,116.8,61.9,123.4,60.0,'2026-07-05 15:02:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.8,62.2,119.9,50.3,121.4,57.7,117.2,59.1,139.0,60.6,122.7,60.8,'2026-07-02 03:30:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.6,91.0,117.9,59.3,142.0,61.7,116.0,54.2,118.2,51.8,115.0,61.7,'2026-07-01 01:38:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.3,52.2,119.6,49.7,118.2,53.6,119.6,62.6,124.6,52.2,121.1,51.5,'2026-07-01 18:05:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.9,61.7,124.4,50.5,124.5,52.8,117.0,49.5,119.3,61.0,115.6,51.1,'2026-07-03 05:24:02'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.8,59.0,87.0,53.7,120.1,62.7,122.6,48.4,123.1,59.6,123.4,94.0,'2026-07-05 04:47:14'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.9,52.9,119.6,53.1,116.1,54.0,120.0,57.3,124.4,48.7,124.2,61.3,'2026-06-30 01:04:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.8,62.5,120.1,81.0,122.1,48.8,116.4,60.1,122.3,53.4,122.2,59.3,'2026-07-02 22:46:48'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.7,58.7,121.1,49.9,125.0,52.6,119.0,57.5,115.1,88.0,115.9,61.1,'2026-06-30 17:40:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.7,61.6,123.7,51.8,124.4,53.1,117.5,53.3,124.9,93.0,122.8,47.1,'2026-07-02 00:20:36'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.1,56.5,122.3,54.0,121.5,54.1,116.6,48.3,121.9,47.8,123.7,92.0,'2026-07-05 19:00:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.8,47.2,122.4,49.5,118.3,51.7,121.0,62.6,120.4,52.3,93.0,57.2,'2026-07-02 11:22:43'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.2,53.9,119.8,52.0,139.0,59.1,123.0,60.2,121.2,54.6,83.0,57.1,'2026-07-03 12:44:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.0,49.4,119.6,56.2,118.2,84.0,122.3,61.7,124.9,54.2,121.2,58.4,'2026-06-30 12:31:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.9,50.7,119.3,57.7,115.9,49.0,119.0,54.4,120.0,53.9,119.6,62.0,'2026-07-02 19:51:46'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.3,47.5,118.2,49.0,116.2,48.6,115.6,47.6,116.0,90.0,118.9,52.8,'2026-07-04 06:35:02'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.6,89.0,119.1,59.1,118.4,61.0,123.9,60.8,123.0,61.4,121.8,54.9,'2026-07-04 18:29:55'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.1,58.3,116.9,54.7,124.7,50.4,115.1,59.5,115.1,58.0,115.0,61.0,'2026-07-03 13:09:46'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.5,57.1,123.2,56.9,116.0,57.8,122.8,53.9,84.0,57.5,116.4,58.6,'2026-06-29 12:02:44'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.4,78.0,135.0,49.6,117.9,49.3,119.3,57.7,79.0,58.8,140.0,53.8,'2026-06-30 08:00:52'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.2,85.0,119.9,58.3,117.5,84.0,121.0,56.9,119.1,94.0,116.5,53.4,'2026-07-03 23:20:19'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.6,52.5,120.5,55.3,122.4,50.0,115.5,61.8,90.0,50.9,116.1,62.8,'2026-07-01 22:20:13'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.7,56.1,116.3,50.2,122.1,55.8,117.4,47.5,116.7,53.4,120.6,61.3,'2026-07-05 13:49:38'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.2,51.7,120.9,54.0,143.0,51.1,121.9,56.3,121.4,56.7,122.9,56.3,'2026-07-04 00:02:33'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.4,60.7,145.0,59.7,120.2,55.2,81.0,48.1,116.3,90.0,123.4,59.5,'2026-07-05 12:52:09'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.6,56.3,115.1,52.3,116.0,91.0,119.7,48.4,91.0,48.8,116.2,49.5,'2026-07-03 04:46:16'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.4,60.4,117.2,61.2,116.3,61.7,92.0,57.9,120.1,92.0,119.5,55.0,'2026-07-04 00:08:04'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.2,58.0,118.0,61.4,122.0,53.5,120.0,47.0,122.6,47.4,118.8,47.1,'2026-07-01 19:02:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.2,54.0,139.0,61.6,116.7,53.7,153.0,53.5,117.7,48.9,117.2,59.4,'2026-07-02 11:35:46'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.2,90.0,116.0,48.4,94.0,57.6,115.1,56.7,119.0,60.8,123.9,52.6,'2026-06-29 07:28:44'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),144.0,62.2,125.0,57.0,121.0,61.6,118.3,49.1,123.9,50.3,117.5,59.4,'2026-07-01 12:53:00'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),145.0,60.4,123.7,61.7,120.4,56.3,154.0,47.6,81.0,62.9,123.7,56.5,'2026-06-29 11:52:01'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.4,48.3,116.8,54.3,92.0,54.8,117.7,52.2,122.0,59.3,123.8,47.4,'2026-07-05 06:19:25'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),115.5,53.5,123.9,62.8,115.1,48.7,123.4,90.0,117.9,56.7,119.0,59.4,'2026-06-29 21:52:39'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.5,59.8,124.1,47.5,118.9,55.5,115.2,55.8,118.8,53.0,118.5,48.5,'2026-07-04 01:01:15'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.1,54.1,120.0,50.5,123.6,62.6,120.3,53.1,118.9,62.4,117.6,50.5,'2026-07-05 22:44:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.7,54.9,116.7,58.0,116.8,61.4,139.0,60.6,124.3,47.7,120.2,57.5,'2026-07-03 20:23:30'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.9,51.8,124.7,62.6,122.8,52.9,115.3,56.1,116.7,59.8,123.3,56.5,'2026-07-02 23:34:11'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),83.0,51.1,120.2,52.6,124.6,52.2,120.6,62.7,120.8,53.3,122.7,56.7,'2026-06-30 13:18:03'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.6,60.7,125.0,47.9,115.5,53.2,124.4,48.0,123.0,48.2,118.8,54.3,'2026-06-29 08:43:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.8,60.2,123.2,58.5,117.3,61.9,116.7,57.0,117.2,58.6,117.5,58.6,'2026-07-05 15:25:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.1,50.1,123.1,56.2,124.3,90.0,115.5,51.3,123.4,79.0,120.3,54.8,'2026-07-04 07:33:07'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),118.6,63.0,117.5,47.0,120.8,59.7,115.0,62.5,122.5,59.1,122.6,62.3,'2026-06-30 21:20:12'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.9,63.0,115.6,51.7,115.4,50.7,88.0,54.6,117.2,51.1,123.8,62.2,'2026-07-02 22:18:45'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),145.0,61.8,119.7,56.7,122.0,86.0,119.2,60.4,117.6,62.6,123.0,60.5,'2026-06-30 18:41:31'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.4,62.5,122.3,93.0,121.6,85.0,89.0,54.4,123.0,50.0,122.8,57.6,'2026-07-02 19:40:10'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),123.1,52.4,118.6,53.5,121.4,88.0,119.3,57.1,115.3,51.4,123.6,59.2,'2026-06-29 12:05:09'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),121.1,50.9,121.8,55.5,124.5,48.4,124.2,88.0,119.5,48.6,115.3,55.6,'2026-07-04 15:46:39'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.3,62.5,125.0,54.8,115.4,53.9,118.0,56.5,81.0,60.4,116.1,58.3,'2026-07-04 06:58:36'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.9,51.8,91.0,54.9,151.0,50.3,116.4,80.0,119.2,87.0,115.2,61.7,'2026-06-30 05:40:03'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),119.1,52.1,119.0,58.2,117.0,54.0,122.1,60.1,122.0,55.1,118.6,88.0,'2026-07-03 18:11:48'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.6,48.2,147.0,48.2,117.2,62.2,123.8,58.4,117.5,60.6,124.7,92.0,'2026-06-29 17:51:51'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),120.8,54.9,120.9,59.0,122.8,53.6,123.9,55.4,120.8,59.4,154.0,59.2,'2026-07-05 02:59:20'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.6,60.0,152.0,55.3,120.9,57.2,118.1,61.0,115.8,55.7,120.5,58.1,'2026-06-29 07:55:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),117.2,48.9,121.2,49.9,137.0,49.4,122.6,49.7,119.8,55.3,116.1,52.5,'2026-07-03 10:32:02'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),124.6,50.7,118.7,56.9,117.6,55.1,123.6,54.7,124.1,55.8,136.0,60.0,'2026-07-06 07:15:54'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),NULL,NULL,122.1,56.1,115.3,53.0,123.0,55.1,81.0,60.9,122.1,56.8,'2026-07-01 19:46:29'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),116.9,54.3,116.7,93.0,88.0,58.1,120.8,62.4,120.8,60.0,119.9,56.0,'2026-07-01 05:47:24'),
  ((SELECT id FROM trucks WHERE truck_code='T104'),122.3,59.7,121.4,53.8,119.6,47.8,124.0,56.4,123.8,49.0,124.6,80.0,'2026-07-06 05:09:17');
SET @first = LAST_INSERT_ID();
SET @last  = @first + 60 - 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'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@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'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@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'), 4, 'HIGH_TEMP', 'WARNING', 'لاستیک 4 — دمای بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 6, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 7, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'WARNING', 'لاستیک 6 — دمای بالا'),
  (@first + 8, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 2 — دمای بالا'),
  (@first + 9, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@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'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 12, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 13, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 6 — افت باد'),
  (@first + 14, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'WARNING', 'لاستیک 6 — دمای بالا'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 17, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 18, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'WARNING', 'لاستیک 6 — دمای بالا'),
  (@first + 19, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 20, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 21, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@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_TEMP', 'WARNING', 'لاستیک 6 — دمای بالا'),
  (@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'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 26, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 27, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@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'), 2, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 2 — باد بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 31, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@first + 32, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 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'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 36, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'WARNING', 'لاستیک 3 — دمای بالا'),
  (@first + 37, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'WARNING', 'لاستیک 3 — دمای بالا'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T104'), 2, 'HIGH_TEMP', 'WARNING', 'لاستیک 2 — دمای بالا'),
  (@first + 39, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 1 — افت باد'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 41, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 43, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 44, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 46, (SELECT id FROM trucks WHERE truck_code='T104'), 4, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 4 — افت باد'),
  (@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'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 49, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 50, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 51, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 52, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 53, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 54, (SELECT id FROM trucks WHERE truck_code='T104'), 1, 'HIGH_TEMP', 'WARNING', 'لاستیک 1 — دمای بالا'),
  (@first + 55, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 3 — باد بالا'),
  (@first + 56, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 57, (SELECT id FROM trucks WHERE truck_code='T104'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 58, (SELECT id FROM trucks WHERE truck_code='T104'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 59, (SELECT id FROM trucks WHERE truck_code='T104'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا');

-- ===== T105 =====
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'),115.0,26.0,112.4,26.3,113.9,25.9,116.9,22.0,115.0,25.6,117.1,87.0,'2026-07-03 07:53:24'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.6,22.3,115.6,22.3,116.7,25.9,112.8,25.2,113.6,22.8,113.6,22.0,'2026-06-29 11:07:39'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.2,24.8,117.0,26.4,115.3,27.5,112.9,25.8,115.1,26.8,113.5,26.2,'2026-07-04 11:17:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.6,26.6,113.6,26.8,114.9,24.5,118.0,26.8,116.3,26.5,115.3,27.5,'2026-07-03 17:54:08'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.4,26.3,112.2,22.6,117.4,24.7,113.7,24.1,113.6,26.1,116.3,26.7,'2026-06-30 20:35:25'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.3,24.1,NULL,NULL,112.0,27.3,115.3,22.6,116.6,80.0,112.3,28.0,'2026-07-03 22:32:33'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),118.0,25.8,112.7,22.5,116.2,26.8,113.1,27.7,113.8,24.9,114.9,27.9,'2026-07-03 16:09:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.6,23.0,112.3,24.4,113.6,27.2,115.1,27.9,116.1,25.1,114.7,23.3,'2026-07-02 09:07:14'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.5,23.6,115.6,26.6,117.7,25.1,117.9,22.2,116.4,24.1,115.2,26.5,'2026-06-30 22:41:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.5,27.4,112.4,25.4,116.4,27.2,115.4,27.9,113.9,24.5,116.1,22.5,'2026-07-01 00:18:28'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.5,27.3,141.0,23.2,113.9,26.4,116.4,24.2,93.0,26.7,113.5,25.1,'2026-07-02 04:16:06'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.1,25.4,112.1,22.2,116.6,22.2,116.1,26.2,117.5,27.5,113.4,27.9,'2026-07-02 13:41:08'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.1,22.1,112.2,23.5,113.1,26.0,117.0,22.6,115.7,22.4,115.1,25.8,'2026-06-30 08:55:04'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.7,24.1,116.3,24.5,115.6,25.4,117.0,23.3,114.1,22.4,114.6,23.0,'2026-07-03 20:17:43'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,27.9,117.0,27.4,113.0,22.1,112.0,23.1,115.7,27.6,117.0,26.9,'2026-06-30 23:32:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.0,23.7,90.0,23.1,115.9,28.0,113.9,24.2,113.2,22.7,115.9,24.3,'2026-07-04 13:38:29'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.4,24.9,113.7,22.3,116.3,27.4,113.1,89.0,113.8,23.3,117.1,79.0,'2026-06-30 03:29:12'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.1,23.0,112.7,22.4,115.7,25.7,116.3,27.7,114.0,23.4,117.5,23.2,'2026-06-29 18:48:04'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,25.1,113.3,27.9,114.3,22.8,114.2,23.7,116.4,25.6,117.4,24.9,'2026-06-30 14:07:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.4,27.6,117.0,26.0,115.6,25.5,117.4,25.3,115.7,25.0,116.6,24.7,'2026-07-02 03:14:42'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.7,25.7,118.0,22.9,114.6,22.2,116.9,25.2,115.0,27.1,114.8,25.1,'2026-07-02 07:59:13'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.4,26.6,114.2,23.8,112.1,25.0,114.9,27.4,114.9,24.9,114.5,23.1,'2026-07-06 03:42:01'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,116.0,22.4,115.3,22.2,116.4,28.0,113.3,27.0,114.1,26.7,'2026-06-30 16:04:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.6,22.3,115.9,22.2,115.5,26.5,113.3,22.8,112.7,26.1,115.7,27.5,'2026-07-01 21:17:56'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.0,24.2,114.7,23.7,114.8,25.1,115.0,26.5,117.7,23.8,116.3,28.0,'2026-07-03 13:39:19'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.2,27.7,114.5,27.7,112.4,22.6,112.9,25.1,118.0,26.0,116.3,25.4,'2026-07-05 12:12:12'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,26.7,112.4,22.1,118.0,25.3,114.1,26.1,115.7,26.2,114.8,24.9,'2026-07-01 04:56:49'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.0,27.0,113.8,26.9,113.8,24.9,113.0,26.5,113.1,27.3,117.0,22.9,'2026-07-02 14:02:44'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.6,22.8,113.3,25.5,114.2,22.9,113.0,25.4,114.5,27.9,114.9,95.0,'2026-07-02 11:05:41'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.1,26.1,113.8,28.0,116.2,22.9,117.9,24.8,115.0,27.7,112.7,23.9,'2026-06-30 03:31:31'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.8,24.2,116.1,23.2,117.9,92.0,116.3,26.2,114.5,23.2,115.2,28.0,'2026-07-03 15:07:58'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,26.5,114.3,22.0,114.8,27.5,117.6,24.8,114.8,23.8,117.7,24.7,'2026-07-01 11:31:18'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,23.3,115.3,24.1,116.8,24.4,117.8,23.7,116.5,25.6,113.1,27.3,'2026-07-05 06:14:48'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.2,27.2,115.1,25.5,117.0,22.0,116.0,27.3,116.2,27.7,150.0,26.4,'2026-07-05 19:01:03'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.8,26.7,114.7,27.5,116.4,27.2,115.6,22.1,112.3,22.9,112.8,24.2,'2026-07-05 11:53:01'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),151.0,27.8,116.0,27.9,116.0,23.1,113.0,25.4,117.4,26.3,116.4,26.4,'2026-07-01 05:07:35'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),NULL,NULL,115.3,23.8,114.1,27.8,112.9,25.2,117.7,25.5,115.3,27.4,'2026-07-02 00:53:57'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.6,24.9,NULL,NULL,114.2,23.9,114.8,27.6,82.0,23.1,112.8,27.4,'2026-07-04 22:07:25'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.8,23.3,116.4,26.8,76.0,25.0,117.0,26.2,112.7,27.8,116.2,22.0,'2026-07-02 13:46:26'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.7,27.7,112.1,22.5,113.7,28.0,117.4,25.2,115.2,25.6,116.8,22.0,'2026-07-03 19:29:29'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.0,81.0,117.9,23.3,115.0,24.3,116.3,22.6,114.4,24.7,112.7,26.8,'2026-07-02 21:13:19'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.3,22.8,113.8,25.5,115.1,22.7,116.7,23.9,113.4,25.5,114.7,23.2,'2026-07-04 23:11:13'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),118.0,93.0,116.3,22.6,116.3,22.5,116.4,25.7,117.7,23.0,114.1,23.2,'2026-06-30 12:46:04'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.4,27.3,116.8,26.5,116.8,27.0,114.2,25.0,115.1,25.2,112.6,22.7,'2026-07-04 19:33:42'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.1,22.6,115.1,26.3,115.8,26.3,115.9,22.6,115.3,26.9,113.8,26.2,'2026-07-04 16:06:40'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),114.1,27.1,118.0,26.8,117.8,22.7,114.4,87.0,117.6,26.5,113.9,26.5,'2026-06-29 17:19:20'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.3,25.1,115.6,25.0,115.2,22.3,114.4,25.9,113.8,24.0,112.8,27.3,'2026-06-29 09:37:40'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.8,27.7,114.7,24.2,112.3,26.2,113.9,25.7,117.5,23.9,115.4,24.0,'2026-07-05 23:29:01'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),115.6,25.2,116.4,25.0,114.4,25.6,117.1,25.1,114.1,25.1,114.1,23.0,'2026-07-01 04:15:52'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.2,25.1,112.4,27.3,113.6,22.3,117.1,23.4,116.5,27.4,113.7,22.4,'2026-07-01 00:19:38'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.3,24.2,113.9,25.2,115.4,24.0,115.9,25.2,NULL,NULL,116.5,25.3,'2026-07-01 02:54:55'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.2,27.2,117.9,26.0,116.9,27.8,116.0,22.3,112.9,23.5,113.9,27.4,'2026-07-03 17:17:30'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),116.0,23.3,113.8,26.1,113.5,24.5,112.1,23.5,115.1,25.5,117.7,22.2,'2026-07-05 12:33:10'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.6,27.0,113.1,26.1,NULL,NULL,117.5,27.7,117.5,22.4,114.3,26.2,'2026-07-05 22:49:50'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),113.5,22.7,112.7,25.3,116.9,27.9,112.5,23.5,114.0,24.1,117.1,26.7,'2026-07-04 14:22:39'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.9,22.6,114.8,24.6,115.1,25.4,114.0,25.4,113.7,27.6,115.0,26.5,'2026-07-03 15:49:09'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.3,26.7,116.4,27.8,115.5,24.4,114.3,27.7,117.5,23.5,117.8,24.5,'2026-07-05 21:10:47'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),112.5,27.9,113.3,27.5,116.0,24.0,114.6,27.0,117.2,26.9,114.6,27.9,'2026-07-02 15:40:43'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.2,23.0,114.2,24.6,80.0,24.0,116.0,24.8,114.5,23.2,112.5,22.7,'2026-07-05 02:04:35'),
  ((SELECT id FROM trucks WHERE truck_code='T105'),117.4,25.8,114.0,24.8,113.6,23.1,117.1,23.8,113.1,24.5,117.6,25.6,'2026-07-04 17:25:35');
SET @first = LAST_INSERT_ID();
SET @last  = @first + 60 - 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'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 5, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 5 — دمای بالا'),
  (@first + 10, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 15, (SELECT id FROM trucks WHERE truck_code='T105'), 2, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 2 — افت باد'),
  (@first + 16, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 22, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'SENSOR_FAULT', 'WARNING', 'لاستیک 1 — قطع سنسور'),
  (@first + 28, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 6 — دمای بالا'),
  (@first + 30, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 3 — دمای بالا'),
  (@first + 33, (SELECT id FROM trucks WHERE truck_code='T105'), 6, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 6 — باد بالا'),
  (@first + 35, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_PRESSURE', 'WARNING', 'لاستیک 1 — باد بالا'),
  (@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'), 5, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 5 — افت باد'),
  (@first + 38, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد'),
  (@first + 40, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 42, (SELECT id FROM trucks WHERE truck_code='T105'), 1, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 1 — دمای بالا'),
  (@first + 45, (SELECT id FROM trucks WHERE truck_code='T105'), 4, 'HIGH_TEMP', 'CRITICAL', 'لاستیک 4 — دمای بالا'),
  (@first + 50, (SELECT id FROM trucks WHERE truck_code='T105'), 5, 'SENSOR_FAULT', 'WARNING', 'لاستیک 5 — قطع سنسور'),
  (@first + 53, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'SENSOR_FAULT', 'WARNING', 'لاستیک 3 — قطع سنسور'),
  (@first + 58, (SELECT id FROM trucks WHERE truck_code='T105'), 3, 'LOW_PRESSURE', 'CRITICAL', 'لاستیک 3 — افت باد');

SELECT 'trucks' tbl, COUNT(*) n FROM `trucks`
UNION ALL SELECT 'tpms_readings', COUNT(*) FROM `tpms_readings`
UNION ALL SELECT 'tpms_alerts',   COUNT(*) FROM `tpms_alerts`;