This commit is contained in:
parent
f3d96f178f
commit
cb0461b241
|
@ -5,11 +5,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCoord
|
|||
vLatitude INT)
|
||||
BEGIN
|
||||
/**
|
||||
* Actualiza las coordenadas de una direccion
|
||||
* Actualiza las coordenadas de una dirección
|
||||
*
|
||||
* @param vTicketFk id del ticket
|
||||
* @param vLongitude longitud de la direccion
|
||||
* @param vLatitude latitud de la dirrecion
|
||||
* @param vTicketFk Id del ticket
|
||||
* @param vLongitude Longitud de la dirección
|
||||
* @param vLatitude Latitud de la dirección
|
||||
*/
|
||||
DECLARE vAddressFK INT;
|
||||
|
||||
|
@ -21,6 +21,5 @@ BEGIN
|
|||
SET longitude = vLongitude,
|
||||
latitude = vLatitude
|
||||
WHERE id = vAddressFK;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -3,10 +3,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeInsert
|
|||
BEFORE INSERT ON `delivery`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN
|
||||
CALL address_updateCoordinates(NEW.ticketFk,NEW.longitude,NEW.latitude);
|
||||
IF (NEW.longitude IS NOT NULL
|
||||
AND NEW.latitude IS NOT NULL
|
||||
AND NEW.ticketFK IS NOT NULL)
|
||||
THEN
|
||||
CALL address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
|
||||
END IF;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -3,10 +3,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeUpdate
|
|||
BEFORE UPDATE ON `delivery`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
|
||||
IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN
|
||||
CALL address_updateCoordinates(NEW.ticketFk,NEW.longitude,NEW.latitude);
|
||||
IF (NEW.longitude IS NOT NULL
|
||||
AND NEW.latitude IS NOT NULL
|
||||
AND NEW.ticketFK IS NOT NULL)
|
||||
THEN
|
||||
CALL address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
|
||||
END IF;
|
||||
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
Loading…
Reference in New Issue