Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- STAMPS
- Cluster id si priority man pe tabela STAMP (pzk)
- CREATE TABLE `pizokel_catalog`.`stamp` (
- `stamp_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
- `label_id` INT(11) UNSIGNED NOT NULL,
- `cluster_id` INT(11) UNSIGNED DEFAULT NULL,
- `priority` INT(11) UNSIGNED DEFAULT NULL,
- `country` CHAR(2) NOT NULL,
- `name` VARCHAR(64) DEFAULT NULL,
- `color` VARCHAR(64) DEFAULT NULL,
- `translation_key` VARCHAR(64) DEFAULT NULL,
- PRIMARY KEY (`stamp_id`),
- KEY `i_label_id` (`label_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- ADD INDEX UNIQUE - country + clusterId + priority
- INSERT INTO `stamp` (`stamp_id`, `label_id`, `cluster_id`, `priority`, `country`, `name`, `color`, `translation_key`)
- VALUES
- (1, 1434, 1, 1, 'ro', 'auto_exclusive_ro', NULL, NULL),
- (2, 1435, 1, 1, 'bg', 'auto_exclusive_bg', NULL, NULL),
- (3, 1437, 1, 2, 'ro', 'auto_premium_ro', NULL, NULL),
- (4, 1439, 1, 2, 'hu', 'auto_premium_hu', NULL, NULL),
- (5, 1440, 2, 1, 'ro', 'auto_flash_ro', NULL, NULL),
- (6, 1441, 2, 1, 'bg', 'auto_flash_bg', NULL, NULL),
- (7, 1431, 2, 2, 'ro', 'auto_main_campaign_ro', NULL, NULL),
- (8, 1432, 2, 2, 'bg', 'auto_main_campaign_bg', NULL, NULL),
- (9, 1433, 2, 2, 'hu', 'auto_main_campaign_hu', NULL, NULL);
- > ETL GET stamps:
- SELECT * FROM stamp s
- INNER JOIN product_label pl ON pl.label_id = s.label_id
- INNER JOIN
- (SELECT product_id, cluster_id, MIN(priority) AS maxPrio
- FROM stamp s1
- INNER JOIN product_label pl1 ON pl1.label_id = s1.label_id
- GROUP BY product_id, cluster_id
- -- AND pl1.product_id IN (select product_id from product where product_id > 2001672)
- ) AS mp ON mp.product_id = pl.product_id AND mp.cluster_id = s.cluster_id AND s.priority = mp.maxPrio;
- ETL stuff
- 13.05 estimation added custom attributes localised, the java definition
- 14.05 - query TO find applicable labels, java functionality implementation
- FOR __stp output => it represents the cluster ids 1, 2, 3, IN ORDER -> json encoded array - {1431, 1432, 1433} OR WITHOUT string AND make sure the ORDER IS kept
- ------------------------
- Label cluster id si priority id vor fi sterse de pe tabela de label -> ajung pe STAMP, dar field-ul de $label de pe entitatea de Stamp ramane IN caz ca o sa avem nevoie de label name
- PREPARE the queries TO remove the cluster_id AND priority COLUMNS FROM auto_config_label
- De editat:
- template, color, label - cu dropdown, priority, cluster - Si mai vedem ce alte field-uri
- + pt template - niste string uri de templates salvate IN db
- CRUD- also CREATE now
- Validari
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement