boyue-kfcode-hasfj/html_pages.sql
2025-05-29 15:03:59 +08:00

47 lines
3.4 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- HTML页面表设计
CREATE TABLE html_pages (
id INT PRIMARY KEY, -- 主键ID范围从1-150
format_id VARCHAR(6) NOT NULL, -- 格式化ID如000001
title VARCHAR(200) NOT NULL, -- 页面标题
content TEXT NOT NULL, -- HTML内容
page_type ENUM('law', 'case', 'form') NOT NULL, -- 页面类型:法律规定、典型案例、表单下载
page_url VARCHAR(255) NOT NULL, -- 页面访问URL
attachment_url VARCHAR(255), -- 附件URL主要用于表单下载类型
multi_attachments TEXT, -- 多附件URLsJSON格式存储多个附件URL及名称
create_time DATETIME NOT NULL, -- 创建时间
update_time DATETIME NOT NULL, -- 更新时间
status TINYINT NOT NULL DEFAULT 1, -- 状态1-启用0-禁用
sort_order INT NOT NULL DEFAULT 0, -- 排序序号
view_count INT NOT NULL DEFAULT 0, -- 浏览次数
author VARCHAR(50) -- 作者/负责人
);
-- 创建索引
CREATE INDEX idx_format_id ON html_pages(format_id);
CREATE INDEX idx_page_type ON html_pages(page_type);
CREATE INDEX idx_status ON html_pages(status);
CREATE INDEX idx_sort_order ON html_pages(sort_order);
-- 插入示例数据
INSERT INTO html_pages (id, format_id, title, content, page_type, page_url, attachment_url, create_time, update_time, status, sort_order)
VALUES
-- 法律规定页面
(1, '000001', '劳动法第四十条解读', '<div class="content">劳动法第四十条内容及解读...</div>', 'law', 'http://localhost/show.html?Id=000001', NULL, NOW(), NOW(), 1, 10),
(2, '000002', '劳动法第四十一条解读', '<div class="content">劳动法第四十一条内容及解读...</div>', 'law', 'http://localhost/show.html?Id=000002', NULL, NOW(), NOW(), 1, 11),
(3, '000003', '劳动法第四十二条解读', '<div class="content">劳动法第四十二条内容及解读...</div>', 'law', 'http://localhost/show.html?Id=000003', NULL, NOW(), NOW(), 1, 12),
-- 典型案例页面
(4, '000001', '某公司劳资纠纷典型案例一', '<div class="content">案例详情及判决结果...</div>', 'case', 'http://localhost/showcase.html?Id=000001', NULL, NOW(), NOW(), 1, 20),
(5, '000002', '某公司劳资纠纷典型案例二', '<div class="content">案例详情及判决结果...</div>', 'case', 'http://localhost/showcase.html?Id=000002', NULL, NOW(), NOW(), 1, 21),
(6, '000003', '某公司劳资纠纷典型案例三', '<div class="content">案例详情及判决结果...</div>', 'case', 'http://localhost/showcase.html?Id=000003', NULL, NOW(), NOW(), 1, 22),
-- 表单下载页面
(7, '000001', '劳动仲裁申请表', '<div class="content">表单下载内容...</div>', 'form', 'http://localhost/table.html?Id=000001', '/profile/upload/2023/10/15/labor_arbitration_form.docx', NOW(), NOW(), 1, 30),
(8, '000002', '劳动合同模板', '<div class="content">表单下载内容...</div>', 'form', 'http://localhost/table.html?Id=000002', '/profile/upload/2023/10/15/labor_contract_template.docx', NOW(), NOW(), 1, 31),
(9, '000003', '工伤认定申请表', '<div class="content">表单下载内容...</div>', 'form', 'http://localhost/table.html?Id=000003', '/profile/upload/2023/10/15/work_injury_application_form.docx', NOW(), NOW(), 1, 32);
-- 注意:
-- 1. 此处插入了9条示例数据每种类型各3条
-- 2. 实际使用时可以继续添加ID范围从1-150
-- 3. format_id是用于URL中的格式化ID如000001
-- 4. 每种页面类型的format_id是独立编号的