-- ============================================================
-- 湛江市智慧人社运营运维项目 - 政策推送和岗位信息变动推送 真实测试数据脚本
-- 说明：
-- 1. policy_category 目录树结构（两级目录）
-- 2. policy_file 关联目录，模拟真实PDF政策文件
-- 3. 达梦数据库兼容格式
-- ============================================================

-- 清理旧数据 (确保幂等性，先删子表再删父表)
DELETE FROM policy_file;
DELETE FROM policy_category;

-- ============================================================
-- 一、政策文件目录树（POLICY_CATEGORY）
-- 结构：
--   国家政策法规
--     ├── 就业促进政策
--     └── 创业扶持政策
--   广东省政策文件
--     ├── 就业援助与补贴
--     └── 技能培训与提升
--   湛江市政策文件
--     ├── 人才引进政策
--     └── 公益性岗位管理
-- ============================================================

-- 一级目录
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000001', NULL, '国家政策法规', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000002', NULL, '广东省政策文件', 2, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000003', NULL, '湛江市政策文件', 3, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 二级目录（国家）
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000011', '178060500000001', '就业促进政策', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000012', '178060500000001', '创业扶持政策', 2, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 二级目录（广东省）
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000021', '178060500000002', '就业援助与补贴', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000022', '178060500000002', '技能培训与提升', 2, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 二级目录（湛江市）
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000031', '178060500000003', '人才引进政策', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_category (ID, PARENT_ID, NAME, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000032', '178060500000003', '公益性岗位管理', 2, 'admin', CURRENT_TIMESTAMP, 'A01');

-- ============================================================
-- 二、政策文件（POLICY_FILE）
-- 关联上述目录，文件路径为示例（部署后替换为实际路径）
-- ============================================================

-- 国家 — 就业促进政策
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000101', '178060500000011', '关于实施就业优先战略促进高质量充分就业的意见', '/files/policies/national/employment_priority_2025.pdf', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000102', '178060500000011', '高校毕业生就业创业促进计划实施方案', '/files/policies/national/graduate_employment_plan_2026.pdf', 2, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000103', '178060500000011', '关于进一步做好失业人员就业服务工作的通知', '/files/policies/national/unemployed_service_2025.pdf', 3, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 国家 — 创业扶持政策
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000111', '178060500000012', '关于优化创业担保贷款政策促进创业就业的通知', '/files/policies/national/startup_loan_2026.pdf', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000112', '178060500000012', '小微企业创业带动就业补贴实施办法', '/files/policies/national/sme_employment_subsidy_2025.pdf', 2, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 广东省 — 就业援助与补贴
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000201', '178060500000021', '广东省就业困难人员认定管理办法', '/files/policies/guangdong/difficult_employment_recognition_2026.pdf', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000202', '178060500000021', '广东省公益性岗位开发管理办法', '/files/policies/guangdong/welfare_post_management_2025.pdf', 2, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000203', '178060500000021', '广东省就业补贴和社保补贴申领指南', '/files/policies/guangdong/subsidy_guide_2026.pdf', 3, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 广东省 — 技能培训与提升
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000211', '178060500000022', '广东省职业技能提升行动实施方案（2025-2027年）', '/files/policies/guangdong/skill_upgrade_action_2025_2027.pdf', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000212', '178060500000022', '广东省企业新型学徒制实施办法', '/files/policies/guangdong/new_apprentice_system_2026.pdf', 2, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 湛江市 — 人才引进政策
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000301', '178060500000031', '湛江市高层次人才引进和培养实施办法', '/files/policies/zhanjiang/talent_introduction_2026.pdf', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000302', '178060500000031', '湛江市促进高校毕业生留湛就业创业若干措施', '/files/policies/zhanjiang/retain_graduates_2026.pdf', 2, 'admin', CURRENT_TIMESTAMP, 'A01');

-- 湛江市 — 公益性岗位管理
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000311', '178060500000032', '湛江市公益性岗位开发与管理办法', '/files/policies/zhanjiang/welfare_post_management_2025.pdf', 1, 'admin', CURRENT_TIMESTAMP, 'A01');
INSERT INTO policy_file (ID, CATEGORY_ID, NAME, FILE_URL, SORT_NO, CREATE_BY, CREATE_TIME, SYS_ORG_CODE)
VALUES ('178060500000312', '178060500000032', '湛江市公益性岗位人员考核实施细则', '/files/policies/zhanjiang/welfare_post_assessment_2026.pdf', 2, 'admin', CURRENT_TIMESTAMP, 'A01');
