新增车辆三检的三检历史记录列表

This commit is contained in:
2026-06-02 10:02:09 +08:00
parent 71558b072d
commit c29596337f
13 changed files with 477 additions and 112 deletions

View File

@@ -0,0 +1,14 @@
ALTER TABLE hot_vehicle_three_inspect
ADD COLUMN inspect_no varchar(32) NULL COMMENT '三检记录编号',
ADD COLUMN inspect_location varchar(255) NULL COMMENT '检查地点';
UPDATE hot_vehicle_three_inspect t
LEFT JOIN hot_vehicle v ON v.id = t.vehicle_id
SET t.inspect_no = CONCAT(
'SJ',
DATE_FORMAT(COALESCE(t.inspect_time, t.create_time), '%Y%m%d'),
RIGHT(COALESCE(v.plate_number, '000'), 3),
LPAD(MOD(COALESCE(t.inspect_id, t.id), 10000), 4, '0')
)
WHERE (t.inspect_no IS NULL OR t.inspect_no = '')
AND t.is_deleted = 0;