|
|
@@ -0,0 +1,103 @@
|
|
|
+-- 将 2026 年新闻按主题补充到首页“产教融合共同体”和“招生就业”标签及对应更多页面。
|
|
|
+-- 来源为已迁移到首页新闻栏目 4307 的 2026 年在用文章。
|
|
|
+
|
|
|
+SET NAMES utf8mb4;
|
|
|
+USE sp_gzhx_apps_mig_next;
|
|
|
+START TRANSACTION;
|
|
|
+
|
|
|
+DROP TEMPORARY TABLE IF EXISTS tmp_xg_topic_map;
|
|
|
+CREATE TEMPORARY TABLE tmp_xg_topic_map (
|
|
|
+ source_articleid INT NOT NULL,
|
|
|
+ target_navigationid INT NOT NULL,
|
|
|
+ PRIMARY KEY (source_articleid, target_navigationid)
|
|
|
+);
|
|
|
+INSERT INTO tmp_xg_topic_map (source_articleid, target_navigationid)
|
|
|
+SELECT a.articleid AS source_articleid, 4304 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e6a0a1e4bc81'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4baa7e69599e89e8de59088'),'%') OR a.title LIKE CONCAT('%',UNHEX('e8aebfe4bc81'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4bc81e4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e59088e4bd9c'),'%') OR a.title LIKE CONCAT('%',UNHEX('e88194e9809a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e7bd91e69893'),'%') OR a.title LIKE CONCAT('%',UNHEX('e58d8ee4b8ba'),'%') OR a.title LIKE CONCAT('%',UNHEX('e7a791e68a80'),'%') OR a.title LIKE CONCAT('%',UNHEX('e585ace58fb8'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5ae9ee8aead'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5ae9ee4b9a0'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5b0b1e4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e68b9be88198'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5b297e4bd8d'),'%') OR a.title LIKE CONCAT('%',UNHEX('e6a8aae59091'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4282 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e585b1e5908ce4bd93'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4baa7e69599e89e8de59088'),'%') OR a.title LIKE CONCAT('%',UNHEX('e8a18ce4b89ae4baa7e69599'),'%') OR a.title LIKE CONCAT('%',UNHEX('e88194e59088e4bd93'),'%') OR a.title LIKE CONCAT('%',UNHEX('e58d8fe5908ce882b2e4baba'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4306 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e585b1e5908ce4bd93'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4baa7e69599e89e8de59088'),'%') OR a.title LIKE CONCAT('%',UNHEX('e8a18ce4b89ae4baa7e69599'),'%') OR a.title LIKE CONCAT('%',UNHEX('e88194e59088e4bd93'),'%') OR a.title LIKE CONCAT('%',UNHEX('e58d8fe5908ce882b2e4baba'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4280 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e5969ce68aa5'),'%') OR a.title LIKE CONCAT('%',UNHEX('e88eb7e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5a4a7e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e6af94e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e696a9e88eb7'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4bdb3e7bba9'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b880e7ad89e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4ba8ce7ad89e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b889e7ad89e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e9939ce5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e98791e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e586a0e5869b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4bc98e7a780e6a188e4be8b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e88da3e8aa89'),'%') OR a.title LIKE CONCAT('%',UNHEX('e68a80e883bde5a4a7e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e79c81e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e59bbde8b59b'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4303 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e5969ce68aa5'),'%') OR a.title LIKE CONCAT('%',UNHEX('e88eb7e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5a4a7e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e6af94e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e696a9e88eb7'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4bdb3e7bba9'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b880e7ad89e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4ba8ce7ad89e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b889e7ad89e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e9939ce5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e98791e5a596'),'%') OR a.title LIKE CONCAT('%',UNHEX('e586a0e5869b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4bc98e7a780e6a188e4be8b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e88da3e8aa89'),'%') OR a.title LIKE CONCAT('%',UNHEX('e68a80e883bde5a4a7e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e79c81e8b59b'),'%') OR a.title LIKE CONCAT('%',UNHEX('e59bbde8b59b'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4277 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e68b9be7949f'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b893e4b89ae69599e882b2'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b893e4b89ae5aea3e8aeb2'),'%') OR a.title LIKE CONCAT('%',UNHEX('e696b0e7949f'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5bd95e58f96'),'%') OR a.title LIKE CONCAT('%',UNHEX('e698a5e5ada3e9ab98e88083'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5beaee4b893e4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b893e4b89ae4bb8be7bb8d'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4302 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e68b9be7949f'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b893e4b89ae69599e882b2'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b893e4b89ae5aea3e8aeb2'),'%') OR a.title LIKE CONCAT('%',UNHEX('e696b0e7949f'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5bd95e58f96'),'%') OR a.title LIKE CONCAT('%',UNHEX('e698a5e5ada3e9ab98e88083'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5beaee4b893e4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4b893e4b89ae4bb8be7bb8d'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4276 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e5b0b1e4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e68b9be88198'),'%') OR a.title LIKE CONCAT('%',UNHEX('e8aebfe4bc81e68b93e5b297'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5ae9ee4b9a0'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5b297e4bd8d'),'%') OR a.title LIKE CONCAT('%',UNHEX('e6af95e4b89ae7949f'),'%') OR a.title LIKE CONCAT('%',UNHEX('e8818ce4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4bc81e4b89ae5aea3e8aeb2'),'%'))
|
|
|
+UNION
|
|
|
+SELECT a.articleid AS source_articleid, 4301 AS target_navigationid FROM sp_gzhx_apps_mig_next.article a WHERE a.websiteid=10078 AND a.navigationid=4307 AND a.dcode=61 AND a.ascode=10010 AND YEAR(COALESCE(a.release_time,a.create_time))=2026 AND (a.title LIKE CONCAT('%',UNHEX('e5b0b1e4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e68b9be88198'),'%') OR a.title LIKE CONCAT('%',UNHEX('e8aebfe4bc81e68b93e5b297'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5ae9ee4b9a0'),'%') OR a.title LIKE CONCAT('%',UNHEX('e5b297e4bd8d'),'%') OR a.title LIKE CONCAT('%',UNHEX('e6af95e4b89ae7949f'),'%') OR a.title LIKE CONCAT('%',UNHEX('e8818ce4b89a'),'%') OR a.title LIKE CONCAT('%',UNHEX('e4bc81e4b89ae5aea3e8aeb2'),'%'));
|
|
|
+
|
|
|
+DROP TEMPORARY TABLE IF EXISTS tmp_xg_topic_candidates;
|
|
|
+CREATE TEMPORARY TABLE tmp_xg_topic_candidates AS
|
|
|
+SELECT
|
|
|
+ a.articleid AS source_articleid,
|
|
|
+ m.target_navigationid,
|
|
|
+ CONCAT(
|
|
|
+ TRIM(TRAILING '/' FROM n.url), '/',
|
|
|
+ DATE_FORMAT(COALESCE(a.release_time,a.create_time), '%y%m%d'),
|
|
|
+ '/CPY', LPAD(a.articleid,9,'0'), '.htm'
|
|
|
+ ) AS new_url,
|
|
|
+ a.unitid, a.title, a.ajtcode, a.`desc`, a.source, a.thumbnail,
|
|
|
+ a.sticktop, a.sticktop_end_time, a.sticktop_schedulesid,
|
|
|
+ a.`release`, a.release_time, a.release_task_schedulesid,
|
|
|
+ a.content, a.edit_content, a.read_count, a.create_time,
|
|
|
+ a.create_pid, a.last_change_pid, a.guest_access_flag
|
|
|
+FROM tmp_xg_topic_map m
|
|
|
+JOIN sp_gzhx_apps_mig_next.article a ON a.articleid=m.source_articleid
|
|
|
+JOIN sp_gzhx_apps_mig_next.website_navigation n
|
|
|
+ ON n.navigationid=m.target_navigationid AND n.websiteid=10078 AND n.dcode=61
|
|
|
+WHERE NOT EXISTS (
|
|
|
+ SELECT 1 FROM sp_gzhx_apps_mig_next.article existing
|
|
|
+ WHERE existing.websiteid=10078
|
|
|
+ AND existing.navigationid=m.target_navigationid
|
|
|
+ AND (
|
|
|
+ existing.url=CONCAT(
|
|
|
+ TRIM(TRAILING '/' FROM n.url), '/',
|
|
|
+ DATE_FORMAT(COALESCE(a.release_time,a.create_time), '%y%m%d'),
|
|
|
+ '/CPY', LPAD(a.articleid,9,'0'), '.htm'
|
|
|
+ )
|
|
|
+ OR (
|
|
|
+ existing.url NOT LIKE '%/CPY%'
|
|
|
+ AND existing.title=a.title
|
|
|
+ AND COALESCE(existing.release_time,existing.create_time)=COALESCE(a.release_time,a.create_time)
|
|
|
+ )
|
|
|
+ )
|
|
|
+);
|
|
|
+
|
|
|
+SELECT target_navigationid,COUNT(*) AS expected_copy_count
|
|
|
+FROM tmp_xg_topic_candidates GROUP BY target_navigationid ORDER BY target_navigationid;
|
|
|
+
|
|
|
+INSERT INTO sp_gzhx_apps_mig_next.article (
|
|
|
+ dcode,unitid,websiteid,ascode,navigationid,title,ajtcode,`desc`,source,
|
|
|
+ thumbnail,sticktop,sticktop_end_time,sticktop_schedulesid,`release`,release_time,
|
|
|
+ release_task_schedulesid,content,edit_content,url,read_count,create_time,
|
|
|
+ last_change_time,create_pid,last_change_pid,guest_access_flag,sort_number
|
|
|
+)
|
|
|
+SELECT
|
|
|
+ 61,c.unitid,10078,10010,c.target_navigationid,c.title,c.ajtcode,c.`desc`,c.source,
|
|
|
+ c.thumbnail,c.sticktop,c.sticktop_end_time,c.sticktop_schedulesid,c.`release`,c.release_time,
|
|
|
+ c.release_task_schedulesid,c.content,c.edit_content,c.new_url,c.read_count,c.create_time,
|
|
|
+ NOW(),c.create_pid,c.last_change_pid,c.guest_access_flag,NULL
|
|
|
+FROM tmp_xg_topic_candidates c;
|
|
|
+
|
|
|
+SET @actual_copy_count=ROW_COUNT();
|
|
|
+SELECT @actual_copy_count AS actual_copy_count;
|
|
|
+
|
|
|
+-- 清除主题栏目旧文章的手工排序号,让 2026 年内容按发布时间优先展示。
|
|
|
+UPDATE sp_gzhx_apps_mig_next.article
|
|
|
+SET sort_number=NULL
|
|
|
+WHERE websiteid=10078
|
|
|
+ AND dcode=61
|
|
|
+ AND ascode=10010
|
|
|
+ AND navigationid IN (4276,4277,4280,4282,4301,4302,4303,4304,4306);
|
|
|
+
|
|
|
+COMMIT;
|
|
|
+
|
|
|
+SELECT a.navigationid,COUNT(*) article_count,DATE_FORMAT(MAX(COALESCE(a.release_time,a.create_time)),'%Y-%m-%d') latest
|
|
|
+FROM sp_gzhx_apps_mig_next.article a
|
|
|
+WHERE a.websiteid=10078 AND a.dcode=61 AND a.ascode=10010
|
|
|
+ AND a.navigationid IN (4276,4277,4280,4282,4301,4302,4303,4304,4306)
|
|
|
+GROUP BY a.navigationid ORDER BY a.navigationid;
|