| 12345678910111213141516171819202122232425 |
- DROP PROCEDURE IF EXISTS update_data_relation_appendix;
- DELIMITER $$
- CREATE PROCEDURE update_data_relation_appendix(IN n INT,
- IN mas_url VARCHAR(200))
- BEGIN
- SET @citySuffix = concat('_city', n);
- SET @prevDocId = ifnull((SELECT prev_id from data_migration_log where table_name = 'wcmdocument'), 0);
- SET @prevTableInfoId = ifnull((SELECT prev_id from data_migration_log where table_name = 'xwcmtableinfo'), 0);
- SET @wcmdocument_offset_num = ifnull((SELECT max(offset_num) FROM data_migration_offset WHERE table_name = 'wcmdocument'), 0);
- SET @docIdOffset = @wcmdocument_offset_num;
- SET @appendix_offset_num = ifnull((SELECT max(offset_num) FROM data_migration_offset WHERE table_name = 'xwcmmaterial'), 0);
- SET @appendixIdOffset = @appendix_offset_num;
- call update_data_relation_appendix_1(@prevDocId, @appendixIdOffset, @docIdOffset);
- call update_data_relation_appendix_2(@citySuffix, @prevTableInfoId, @prevDocId);
- UPDATE trs_hycloud_iip.wcmappendix SET APPFILE = CONCAT(mas_url, AppFromId) WHERE APPFLAG = 90 AND APPENDIXID > @appendixIdOffset;
- END $$
- DELIMITER ;
|