|
|
@@ -0,0 +1,137 @@
|
|
|
+SET NAMES utf8mb4;
|
|
|
+USE sp_gzhx_apps;
|
|
|
+
|
|
|
+START TRANSACTION;
|
|
|
+
|
|
|
+SET @screen_website_id := (
|
|
|
+ SELECT w.websiteid
|
|
|
+ FROM website w
|
|
|
+ JOIN website_template wt ON wt.wtid = w.wtid
|
|
|
+ WHERE w.dcode = 61
|
|
|
+ AND wt.config = 'ffkjscreen02'
|
|
|
+ AND FIND_IN_SET(
|
|
|
+ 'hxcs.feifan.net',
|
|
|
+ REPLACE(TRIM(BOTH ';' FROM IFNULL(w.domains, '')), ';', ',')
|
|
|
+ ) > 0
|
|
|
+ ORDER BY w.websiteid DESC
|
|
|
+ LIMIT 1
|
|
|
+);
|
|
|
+
|
|
|
+SET @screen_unit_id := (
|
|
|
+ SELECT unitid
|
|
|
+ FROM website
|
|
|
+ WHERE websiteid = @screen_website_id
|
|
|
+ LIMIT 1
|
|
|
+);
|
|
|
+
|
|
|
+SET @news2026_website_id := (
|
|
|
+ SELECT websiteid
|
|
|
+ FROM website
|
|
|
+ WHERE dcode = 61
|
|
|
+ AND name = '新闻网-2026'
|
|
|
+ AND FIND_IN_SET(
|
|
|
+ 'xinwen2026.hxcs.feifan.net',
|
|
|
+ REPLACE(TRIM(BOTH ';' FROM IFNULL(domains, '')), ';', ',')
|
|
|
+ ) > 0
|
|
|
+ ORDER BY websiteid DESC
|
|
|
+ LIMIT 1
|
|
|
+);
|
|
|
+
|
|
|
+SET @school_news_navigation_id := (
|
|
|
+ SELECT navigationid
|
|
|
+ FROM website_navigation
|
|
|
+ WHERE websiteid = @screen_website_id
|
|
|
+ AND wnccode = 10000
|
|
|
+ AND idcard = 'FFKJ_SCHOOL_NEWS'
|
|
|
+ AND dcode = 61
|
|
|
+ ORDER BY navigationid
|
|
|
+ LIMIT 1
|
|
|
+);
|
|
|
+
|
|
|
+SET @entry_title := '进入新闻网';
|
|
|
+SET @entry_url := 'https://xinwen2026.hxcs.feifan.net/';
|
|
|
+SET @entry_desc := '首页校园新闻区“进入新闻网”按钮入口。';
|
|
|
+SET @entry_content_path := '/web/upload/ffkj-template/content/portal-demo.html';
|
|
|
+SET @operator_pid := 10000;
|
|
|
+
|
|
|
+SET @guard_sql := IF(
|
|
|
+ @screen_website_id IS NOT NULL
|
|
|
+ AND @screen_unit_id IS NOT NULL
|
|
|
+ AND @news2026_website_id IS NOT NULL
|
|
|
+ AND @school_news_navigation_id IS NOT NULL,
|
|
|
+ 'SELECT 1',
|
|
|
+ 'SELECT * FROM __screen_newsroom_entry_guard_failed__'
|
|
|
+);
|
|
|
+PREPARE guard_stmt FROM @guard_sql;
|
|
|
+EXECUTE guard_stmt;
|
|
|
+DEALLOCATE PREPARE guard_stmt;
|
|
|
+
|
|
|
+SET @entry_article_id := (
|
|
|
+ SELECT articleid
|
|
|
+ FROM article
|
|
|
+ WHERE websiteid = @screen_website_id
|
|
|
+ AND navigationid = @school_news_navigation_id
|
|
|
+ AND title = @entry_title
|
|
|
+ AND dcode <> 72
|
|
|
+ ORDER BY articleid DESC
|
|
|
+ LIMIT 1
|
|
|
+);
|
|
|
+
|
|
|
+INSERT INTO article (
|
|
|
+ dcode, websiteid, unitid, 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, @screen_website_id, @screen_unit_id, 10010, @school_news_navigation_id,
|
|
|
+ @entry_title, 10020, @entry_desc, '广州华夏职业学院',
|
|
|
+ NULL, 0, NULL, NULL, 1, NOW(), NULL, @entry_content_path,
|
|
|
+ @entry_content_path, @entry_url, 1, NOW(), NOW(), @operator_pid,
|
|
|
+ @operator_pid, 0, 1
|
|
|
+FROM DUAL
|
|
|
+WHERE @entry_article_id IS NULL;
|
|
|
+
|
|
|
+SET @entry_article_id := COALESCE(
|
|
|
+ @entry_article_id,
|
|
|
+ (
|
|
|
+ SELECT articleid
|
|
|
+ FROM article
|
|
|
+ WHERE websiteid = @screen_website_id
|
|
|
+ AND navigationid = @school_news_navigation_id
|
|
|
+ AND title = @entry_title
|
|
|
+ AND dcode <> 72
|
|
|
+ ORDER BY articleid DESC
|
|
|
+ LIMIT 1
|
|
|
+ )
|
|
|
+);
|
|
|
+
|
|
|
+UPDATE article
|
|
|
+SET dcode = 61,
|
|
|
+ websiteid = @screen_website_id,
|
|
|
+ unitid = @screen_unit_id,
|
|
|
+ ascode = 10010,
|
|
|
+ navigationid = @school_news_navigation_id,
|
|
|
+ title = @entry_title,
|
|
|
+ ajtcode = 10020,
|
|
|
+ `desc` = @entry_desc,
|
|
|
+ source = '广州华夏职业学院',
|
|
|
+ thumbnail = NULL,
|
|
|
+ sticktop = 0,
|
|
|
+ sticktop_end_time = NULL,
|
|
|
+ sticktop_schedulesid = NULL,
|
|
|
+ `release` = 1,
|
|
|
+ release_time = COALESCE(release_time, NOW()),
|
|
|
+ release_task_schedulesid = NULL,
|
|
|
+ content = @entry_content_path,
|
|
|
+ edit_content = @entry_content_path,
|
|
|
+ url = @entry_url,
|
|
|
+ read_count = COALESCE(read_count, 1),
|
|
|
+ last_change_time = NOW(),
|
|
|
+ last_change_pid = @operator_pid,
|
|
|
+ guest_access_flag = 0,
|
|
|
+ sort_number = 1
|
|
|
+WHERE articleid = @entry_article_id;
|
|
|
+
|
|
|
+COMMIT;
|