DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `sync_fl2`()
BEGIN
DECLARE exit handler for sqlexception
BEGIN
-- ERROR
ROLLBACK;
END;
DECLARE exit handler for sqlwarning
BEGIN
-- WARNING
ROLLBACK;
END;
START TRANSACTION;
UPDATE `sh_prod_im` SET `updated` = 0;
INSERT INTO `sh_prod_im` (`prod`,`type`,`pict`)
SELECT `prod`,`type`,`pict`
FROM `sh_prod_im_`
FOR UPDATE
ON DUPLICATE KEY UPDATE `updated` = 1;
DELETE FROM `sh_prod_im` WHERE `updated` = 0;
COMMIT;
END$$
DELIMITER ;
SELECT * FROM `sh_prod_im` WHERE `prod` IN ('.implode(',',$prod_k).') ORDER BY `type`
CREATE TABLE `sh_prod_im` (
`prod` int(10) unsigned NOT NULL,
`type` int(10) unsigned NOT NULL,
`pict` int(10) unsigned NOT NULL,
`updated` int(1) unsigned default '1',
PRIMARY KEY (`prod`,`type`,`pict`)
) ENGINE=InnoDB;
DELIMITER $$
CREATE DEFINER=`root`@`%` PROCEDURE `sync_fl`()
BEGIN
UPDATE `sh_prod_im` SET `updated` = 0;
INSERT INTO `sh_prod_im` (`prod`,`type`,`pict`)
SELECT `prod`,`type`, `pict`
FROM `sh_prod_im_`
ON DUPLICATE KEY UPDATE `updated` = 1;
DELETE FROM `sh_prod_im` WHERE `updated` = 0;
END$$
DELIMITER;
var json = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"id": 0,
"geometry": {
"type": "Point",
"coordinates": [55.753215, 37.6225],
"Lat": 55.753215,
"Long": 37.6225,
"PrintCoordinates": "[55.753215,37.6225]"
},
"properties": {
"balloonContentHeader": "Основной",
"balloonContentBody": "Партнер: Charmante Соболева Ольга - клиенты",
"balloonContentFooter": null,
"clusterCaption": "Основной",
"hintContent": "Основной"
},
"options": {
"preset": "islands#redIcon"
}
}, {
"type": "Feature",
"id": 1,
"geometry": {
"type": "Point",
"coordinates": [55.933948, 37.8432],
"Lat": 55.933948,
"Long": 37.8432,
"PrintCoordinates": "[55.933948,37.8432]"
},
"properties": {
"balloonContentHeader": "ladybird",
"balloonContentBody": "Партнер: Вд Башинская Людмила Викторовна - (ФАВ)",
"balloonContentFooter": null,
"clusterCaption": "ladybird",
"hintContent": "ladybird"
},
"options": {
"preset": "islands#darkGreenIcon"
}
}]}
"features": [{...}, {...} , {...} ,{...}]
"features": [{...}, {...} , {...} ,{...}]