UPDATE negative_work w LEFT JOIN negative n ON w.create_time = n.crtTime AND n.involveDepartId = w.depart_id SET w.negative_id = n.id WHERE w.negative_id IS NULL AND n.id IS NOT NULL; UPDATE negative SET handle_three_depart_id = involveDepartId, handle_three_depart_name = involveDepartName WHERE crtTime > '2024-10-25 19:00:00' AND handle_three_depart_id IS NULL; // 删除数据 DELETE FROM negative_work WHERE negative_id IS NULL;