|
@@ -35,74 +35,76 @@ CREATE PROCEDURE sp_city_n(IN n INT)
|
|
|
SET @prevAppendixId = ifnull((SELECT prev_id from trs_data_migration.data_migration_log where table_name = 'wcmappendix'), 0);
|
|
SET @prevAppendixId = ifnull((SELECT prev_id from trs_data_migration.data_migration_log where table_name = 'wcmappendix'), 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ # 支持数据增量 偏移量 修改
|
|
|
|
|
|
|
|
# xx ID 偏移量,获取海云系统中的对应 xx maxID 错开一段距离,改为存入最大id
|
|
# xx ID 偏移量,获取海云系统中的对应 xx maxID 错开一段距离,改为存入最大id
|
|
|
- SET @siteIdOffset= IFNULL((SELECT MAX(siteId) from trs_hycloud_iip.wcmwebsite),0);
|
|
|
|
|
- CALL setOffset('wcmwebsite',@siteIdOffset);
|
|
|
|
|
- SET @chnlIdOffset= IFNULL((SELECT MAX(channelId) from trs_hycloud_iip.wcmchannel),0);
|
|
|
|
|
- CALL setOffset('wcmchannel',@chnlIdOffset);
|
|
|
|
|
- SET @appendixIdOffset= IFNULL((SELECT MAX(appendixId) from trs_hycloud_iip.wcmappendix),0);
|
|
|
|
|
- CALL setOffset('wcmappendix',@appendixIdOffset);
|
|
|
|
|
- SET @recIdOffset= IFNULL((SELECT MAX(recId) from trs_hycloud_iip.wcmchnldoc),0);
|
|
|
|
|
- CALL setOffset('wcmchnldoc',@recIdOffset);
|
|
|
|
|
- SET @docIdOffset= IFNULL((SELECT MAX(documentId) from trs_hycloud_iip.wcmdocument),0);
|
|
|
|
|
- CALL setOffset('wcmdocument',@docIdOffset);
|
|
|
|
|
- SET @viewIdOffset= IFNULL((SELECT MAX(viewInfoId) from trs_hycloud_iip.xwcmviewinfo),0);
|
|
|
|
|
- CALL setOffset('xwcmviewinfo',@viewIdOffset);
|
|
|
|
|
- SET @tableInfoIdOffset= IFNULL((SELECT MAX(TABLEINFOID) from trs_hycloud_iip.xwcmtableinfo),0);
|
|
|
|
|
- CALL setOffset('xwcmtableinfo',@tableInfoIdOffset);
|
|
|
|
|
- SET @fieldIdOffset= IFNULL((SELECT MAX(dbFieldId) from trs_hycloud_iip.xwcmdbfieldinfo),0);
|
|
|
|
|
- CALL setOffset('xwcmdbfieldinfo',@fieldIdOffset);
|
|
|
|
|
- SET @channelSynIdOffset= IFNULL((SELECT MAX(channelSynId) from trs_hycloud_iip.wcmchannelsyn),0);
|
|
|
|
|
- CALL setOffset('wcmchannelsyn',@channelSynIdOffset);
|
|
|
|
|
- SET @templateIdOffset= IFNULL((SELECT MAX(templateId) from trs_hycloud_iip.wcmtemplate),0);
|
|
|
|
|
- CALL setOffset('wcmtemplate',@templateIdOffset);
|
|
|
|
|
- SET @folderPublishConfigIdOffset= IFNULL((SELECT MAX(folderPublishConfigId) from trs_hycloud_iip.wcmfolderpublishconfig),0);
|
|
|
|
|
- CALL setOffset('wcmfolderpublishconfig',@folderPublishConfigIdOffset);
|
|
|
|
|
- SET @templateEmployIdOffset= IFNULL((SELECT MAX(templateEmployId) from trs_hycloud_iip.wcmtemplateemploy),0);
|
|
|
|
|
- CALL setOffset('wcmtemplateemploy',@templateEmployIdOffset);
|
|
|
|
|
- SET @templateNestIdOffset= IFNULL((SELECT MAX(templateNestId) from trs_hycloud_iip.wcmtemplatenest),0);
|
|
|
|
|
- CALL setOffset('wcmtemplatenest',@templateNestIdOffset);
|
|
|
|
|
- SET @templateQuoteIdOffset= IFNULL((SELECT MAX(templateQuoteId) from trs_hycloud_iip.wcmtemplatequote),0);
|
|
|
|
|
- CALL setOffset('wcmtemplatequote',@templateQuoteIdOffset);
|
|
|
|
|
-
|
|
|
|
|
- SET @metaViewEmployerIdOffset= IFNULL((SELECT MAX(metaViewEmployerId) from trs_hycloud_iip.xwcmmetaviewemployer),0);
|
|
|
|
|
- CALL setOffset('xwcmmetaviewemployer',@metaViewEmployerIdOffset);
|
|
|
|
|
- SET @viewFieldInfoIdOffset= IFNULL((SELECT MAX(viewfieldinfoId) from trs_hycloud_iip.xwcmviewfieldinfo),0);
|
|
|
|
|
- CALL setOffset('xwcmviewfieldinfo',@viewFieldInfoIdOffset);
|
|
|
|
|
- SET @templateArgIdOffset= IFNULL((SELECT MAX(TEMPLATEARGUMENTID) from trs_hycloud_iip.wcmtemplateargument),0);
|
|
|
|
|
- CALL setOffset('wcmtemplateargument',@templateArgIdOffset);
|
|
|
|
|
- SET @classInfoIdOffset= IFNULL((SELECT MAX(classInfoId) from trs_hycloud_iip.xwcmclassinfo),0);
|
|
|
|
|
- CALL setOffset('xwcmclassinfo',@classInfoIdOffset);
|
|
|
|
|
- SET @classInfoViewIdOffset= IFNULL((SELECT MAX(classInfoViewId) from trs_hycloud_iip.xwcmclassinfoview),0);
|
|
|
|
|
- CALL setOffset('xwcmclassinfoview',@classInfoViewIdOffset);
|
|
|
|
|
- # xx ID 偏移量,为了和海云系统中的 xx ID 错开一段距离(原)
|
|
|
|
|
|
|
+ SET @maxSiteId = IFNULL((SELECT MAX(siteId) from trs_hycloud_iip.wcmwebsite),0);
|
|
|
|
|
+ SET @siteIdOffset = @maxSiteId - @prevSiteId;
|
|
|
|
|
+ SET @maxChannelId= IFNULL((SELECT MAX(channelId) from trs_hycloud_iip.wcmchannel),0);
|
|
|
|
|
+ SET @channelIdOffset = @maxChannelId - @prevChannelId;
|
|
|
|
|
+ SET @maxAppendixId= IFNULL((SELECT MAX(appendixId) from trs_hycloud_iip.wcmappendix),0);
|
|
|
|
|
+ SET @appendixIdOffset = @maxAppendixId - @prevAppendixId;
|
|
|
|
|
+ SET @maxRecId= IFNULL((SELECT MAX(recId) from trs_hycloud_iip.wcmchnldoc),0);
|
|
|
|
|
+ SET @recIdOffset = @maxRecId - @prevRecId;
|
|
|
|
|
+ SET @maxDocId= IFNULL((SELECT MAX(DOCID) from trs_hycloud_iip.wcmdocument),0);
|
|
|
|
|
+ SET @docIdOffset = @maxDocId - @prevDocId;
|
|
|
|
|
+ SET @maxViewId= IFNULL((SELECT MAX(viewInfoId) from trs_hycloud_iip.xwcmviewinfo),0);
|
|
|
|
|
+ SET @viewIdOffset = @maxViewId - @prevViewId;
|
|
|
|
|
+ SET @maxTableInfoId= IFNULL((SELECT MAX(TABLEINFOID) from trs_hycloud_iip.xwcmtableinfo),0);
|
|
|
|
|
+ SET @tableInfoIdOffset = @maxTableInfoId - @prevTableInfoId;
|
|
|
|
|
+ SET @maxFieldId = IFNULL((SELECT MAX(DBFIELDINFOID) from trs_hycloud_iip.xwcmdbfieldinfo),0);
|
|
|
|
|
+ SET @fieldIdOffset = @maxFieldId - @prevFieldId;
|
|
|
|
|
+ SET @maxChannelSynId= IFNULL((SELECT MAX(channelSynId) from trs_hycloud_iip.wcmchannelsyn),0);
|
|
|
|
|
+ SET @channelSynIdOffset = @maxChannelSynId - @prevChannelSynId;
|
|
|
|
|
+ SET @maxTemplateId = IFNULL((SELECT MAX(TEMPID) from trs_hycloud_iip.wcmtemplate),0);
|
|
|
|
|
+ SET @templateIdOffset = @maxTemplateId - @prevTemplateId;
|
|
|
|
|
+ SET @maxFolderPublishConfigId = IFNULL((SELECT MAX(FOLDERPUBLISHCONFIGID) from trs_hycloud_iip.wcmfolderpublishconfig),0);
|
|
|
|
|
+ SET @folderPublishConfigIdOffset = @maxFolderPublishConfigId - @prevFolderPublishConfigId;
|
|
|
|
|
+ SET @maxTemplateEmployId = IFNULL((SELECT MAX(TEMPLATEEMPLOYID) from trs_hycloud_iip.wcmtemplateemploy),0);
|
|
|
|
|
+ SET @templateEmployIdOffset = @maxTemplateEmployId - @prevTemplateEmployId;
|
|
|
|
|
+ SET @maxTemplateNestId= IFNULL((SELECT MAX(TEMPLATENESTID) from trs_hycloud_iip.wcmtemplatenest),0);
|
|
|
|
|
+ SET @templateNestIdOffset = @maxTemplateNestId - @prevTemplateNestId;
|
|
|
|
|
+ SET @maxTemplateQuoteId = IFNULL((SELECT MAX(TEMPLATEQUOTEID) from trs_hycloud_iip.wcmtemplatequote),0);
|
|
|
|
|
+ SET @templateQuoteIdOffset = @maxTemplateQuoteId - @prevTemplateQuoteId;
|
|
|
|
|
+ SET @maxMetaViewEmployerId = IFNULL((SELECT MAX(METAVIEWEMPLOYERID) from trs_hycloud_iip.xwcmmetaviewemployer),0);
|
|
|
|
|
+ SET @metaViewEmployerIdOffset = @maxMetaViewEmployerId - @prevMetaViewEmployerId;
|
|
|
|
|
+ SET @maxViewFieldInfoId = IFNULL((SELECT MAX(VIEWFIELDINFOID) from trs_hycloud_iip.xwcmviewfieldinfo),0);
|
|
|
|
|
+ SET @viewFieldInfoIdOffset = @maxViewFieldInfoId - @prevViewFieldInfoId;
|
|
|
|
|
+ SET @maxTemplateArgId= IFNULL((SELECT MAX(TEMPLATEARGUMENTID) from trs_hycloud_iip.wcmtemplateargument),0);
|
|
|
|
|
+ SET @templateArgIdOffset = @maxTemplateArgId - @prevTemplateArgId;
|
|
|
|
|
+ SET @maxClassInfoId = IFNULL((SELECT MAX(classInfoId) from trs_hycloud_iip.xwcmclassinfoxwcmclassinfo),0);
|
|
|
|
|
+ SET @classInfoIdOffset = @maxClassInfoId - @prevClassInfoId;
|
|
|
|
|
+ SET @maxClassInfoViewId = IFNULL((SELECT MAX(CLASSINFOVIEWID) from trs_hycloud_iip.xwcmclassinfoview),0);
|
|
|
|
|
+ SET @classInfoViewIdOffset = @maxClassInfoViewId - @prevClassInfoViewId;
|
|
|
#字段分组不用迁移,旧环境分组无法复用
|
|
#字段分组不用迁移,旧环境分组无法复用
|
|
|
- SET @metaViewFieldGroupIdOffset = 100000 * @n;
|
|
|
|
|
|
|
+-- SET @maxMetaViewFieldGroupId = IFNULL((SELECT MAX(METAVIEWFIELDGROUPID) from trs_hycloud_iip.xwcmmetaviewfieldgroup),0);
|
|
|
|
|
+-- SET @metaViewFieldGroupIdOffset = @maxMetaViewFieldGroupId - @prevMetaViewFieldGroupId;
|
|
|
|
|
+
|
|
|
|
|
|
|
|
- call sp_data_migration_wcmappendix(@prevAppendixId, @appendixIdOffset, @docIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmchannel(@prevChannelId, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmchannelchildindexquote(@templateIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmchannelsyn(@prevChannelSynId, @channelSynIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmchnldoc(@prevRecId, @recIdOffset, @docIdOffset, @siteIdOffset, @channelIdOffset, @viewIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmdocument(@prevDocId, @docIdOffset, @viewIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmfolderpublishconfig(@prevFolderPublishConfigId, @folderPublishConfigIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmtemplate(@prevTemplateId, @templateIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmtemplateargument(@prevTemplateArgId, @templateArgIdOffset, @templateIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmtemplateemploy(@prevTemplateEmployId, @templateEmployIdOffset, @templateIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmtemplatenest(@prevTemplateNestId, @templateNestIdOffset);
|
|
|
|
|
- call sp_data_migration_wcmtemplatequote(@prevTemplateQuoteId, @templateQuoteIdOffset, @templateIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
|
|
call sp_data_migration_wcmwebsite(@citySuffix, @prevSiteId, @siteIdOffset);
|
|
call sp_data_migration_wcmwebsite(@citySuffix, @prevSiteId, @siteIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmchannel(@prevChannelId, @channelIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmchannelsyn(@prevChannelSynId, @channelSynIdOffset);
|
|
|
|
|
+ call sp_data_migration_xwcmtableinfo(@citySuffix, @prevTableInfoId, @tableInfoIdOffset);
|
|
|
call sp_data_migration_xwcmclassinfo(@prevClassInfoId, @classInfoIdOffset);
|
|
call sp_data_migration_xwcmclassinfo(@prevClassInfoId, @classInfoIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmtemplate(@prevTemplateId, @templateIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmtemplatenest(@prevTemplateNestId, @templateNestIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmfolderpublishconfig(@prevFolderPublishConfigId, @folderPublishConfigIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmtemplateargument(@prevTemplateArgId, @templateArgIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmtemplateemploy(@prevTemplateEmployId, @templateEmployIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmtemplatequote(@prevTemplateQuoteId, @templateQuoteIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmchannelchildindexquote();
|
|
|
|
|
+ call sp_data_migration_xwcmviewinfo(@citySuffix, @prevViewId, @viewIdOffset);
|
|
|
|
|
+ call sp_data_migration_xwcmdbfieldinfo(@citySuffix, @prevFieldId, @fieldIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmdocument(@prevDocId, @docIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmappendix(@prevAppendixId, @appendixIdOffset, @docIdOffset);
|
|
|
|
|
+ call sp_data_migration_wcmchnldoc(@prevRecId, @recIdOffset, @docIdOffset, @siteIdOffset, @channelIdOffset, @viewIdOffset);
|
|
|
call sp_data_migration_xwcmclassinfoview(@prevClassInfoViewId, @classInfoViewIdOffset, @classInfoIdOffset, @docIdOffset, @viewIdOffset);
|
|
call sp_data_migration_xwcmclassinfoview(@prevClassInfoViewId, @classInfoViewIdOffset, @classInfoIdOffset, @docIdOffset, @viewIdOffset);
|
|
|
- call sp_data_migration_xwcmdbfieldinfo(@citySuffix, @prevFieldId, @fieldIdOffset, @prevClassInfoId, @tableInfoIdOffset);
|
|
|
|
|
call sp_data_migration_xwcmmetaviewemployer(@prevMetaViewEmployerId, @metaViewEmployerIdOffset, @viewIdOffset, @siteIdOffset, @channelIdOffset);
|
|
call sp_data_migration_xwcmmetaviewemployer(@prevMetaViewEmployerId, @metaViewEmployerIdOffset, @viewIdOffset, @siteIdOffset, @channelIdOffset);
|
|
|
- call sp_data_migration_xwcmmetaviewfieldgroup(@prevMetaViewFieldGroupId, @metaViewFieldGroupIdOffset, @viewIdOffset);
|
|
|
|
|
- call sp_data_migration_xwcmtableinfo(@citySuffix, @prevTableInfoId, @tableInfoIdOffset);
|
|
|
|
|
call sp_data_migration_xwcmviewfieldinfo(@citySuffix, @prevViewFieldInfoId, @viewFieldInfoIdOffset, @tableInfoIdOffset, @prevClassInfoId, @dbFieldIdOffset, @metaViewFieldGroupIdOffset, @viewIdOffset, @viewIdOffset);
|
|
call sp_data_migration_xwcmviewfieldinfo(@citySuffix, @prevViewFieldInfoId, @viewFieldInfoIdOffset, @tableInfoIdOffset, @prevClassInfoId, @dbFieldIdOffset, @metaViewFieldGroupIdOffset, @viewIdOffset, @viewIdOffset);
|
|
|
- call sp_data_migration_xwcmviewinfo(@citySuffix, @prevViewId, @viewIdOffset, @tableInfoIdOffset);
|
|
|
|
|
|
|
+
|
|
|
call sp_data_migration_wcmmetatable(@citySuffix, @prevTableInfoId, @prevDocId, @docIdOffset, @channelIdOffset);
|
|
call sp_data_migration_wcmmetatable(@citySuffix, @prevTableInfoId, @prevDocId, @docIdOffset, @channelIdOffset);
|
|
|
|
|
+-- call sp_data_migration_xwcmmetaviewfieldgroup(@prevMetaViewFieldGroupId, @metaViewFieldGroupIdOffset, @viewIdOffset);
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
# 待优化
|
|
# 待优化
|
|
@@ -112,8 +114,10 @@ CREATE PROCEDURE sp_city_n(IN n INT)
|
|
|
SET @prevMasId = ifnull((SELECT prev_id from trs_data_migration.data_migration_log where table_name = 'mas_masid'), 0);
|
|
SET @prevMasId = ifnull((SELECT prev_id from trs_data_migration.data_migration_log where table_name = 'mas_masid'), 0);
|
|
|
SET @prevMasVideoId = ifnull((SELECT prev_id from trs_data_migration.data_migration_log where table_name = 'mas_masvideo'), 0);
|
|
SET @prevMasVideoId = ifnull((SELECT prev_id from trs_data_migration.data_migration_log where table_name = 'mas_masvideo'), 0);
|
|
|
|
|
|
|
|
- SET @masIdOffset = 1000000;
|
|
|
|
|
- SET @masVideoIdOffset = 1000000;
|
|
|
|
|
|
|
+ SET @maxMasId = IFNULL((SELECT MAX(ID) from trs_mas.mas_masid),0);
|
|
|
|
|
+ SET @masIdOffset = @maxMasId - @prevMasId;
|
|
|
|
|
+ SET @maxMasVideoId = IFNULL((SELECT MAX(ID) from trs_mas.mas_videostream),0);
|
|
|
|
|
+ SET @masVideoIdOffset = @maxMasVideoId - @prevMasVideoId;
|
|
|
|
|
|
|
|
call trs_data_migration.sp_data_migration_masid(@prevMasId, @masIdOffset);
|
|
call trs_data_migration.sp_data_migration_masid(@prevMasId, @masIdOffset);
|
|
|
call trs_data_migration.sp_data_migration_masvideo(@prevMasVideoId, @masVideoIdOffset);
|
|
call trs_data_migration.sp_data_migration_masvideo(@prevMasVideoId, @masVideoIdOffset);
|