CREATE TRIGGER `before_plan_order_update` BEFORE UPDATE ON `plan_order` FOR EACH ROW BEGIN INSERT INTO `plan_order_log` ( order_id, operate_type, plan_id, number, orderTimeStart, orderTimeEnd, orderTime, unit, shipBoarding, visitRoute, paymentMethod, phonenumber, contact, orderNature, create_by, create_time, update_by, update_time, remark, status, guideNum, shipNum ) VALUES ( OLD.order_id, 'update_before', OLD.plan_id, OLD.number, OLD.orderTimeStart, OLD.orderTimeEnd, OLD.orderTime, OLD.unit, OLD.shipBoarding, OLD.visitRoute, OLD.paymentMethod, OLD.phonenumber, OLD.contact, OLD.orderNature, OLD.create_by, OLD.create_time, OLD.update_by, OLD.update_time, OLD.remark, OLD.status, OLD.guideNum, OLD.shipNum ); END; CREATE TRIGGER `after_plan_order_update` AFTER UPDATE ON `plan_order` FOR EACH ROW BEGIN INSERT INTO `plan_order_log` ( order_id, operate_type, plan_id, number, orderTimeStart, orderTimeEnd, orderTime, unit, shipBoarding, visitRoute, paymentMethod, phonenumber, contact, orderNature, create_by, create_time, update_by, update_time, remark, status, guideNum, shipNum ) VALUES ( NEW.order_id, 'update_after', NEW.plan_id, NEW.number, NEW.orderTimeStart, NEW.orderTimeEnd, NEW.orderTime, NEW.unit, NEW.shipBoarding, NEW.visitRoute, NEW.paymentMethod, NEW.phonenumber, NEW.contact, NEW.orderNature, NEW.create_by, NEW.create_time, NEW.update_by, NEW.update_time, NEW.remark, NEW.status, NEW.guideNum, NEW.shipNum ); END;