-- 科技局模拟数据 - 政策法规知识库
-- Run: psql -d govai_portal -f seed_keji.sql

-- 为管理员创建"科技局政策法规知识库"
INSERT INTO knowledge_bases (id, name, description, owner_id, visibility, doc_count, status)
VALUES (
  '20000000-0000-0000-0000-000000000001',
  '科技局政策法规库',
  '汇集科技创新、高新技术企业认定、科技成果转化、知识产权保护等领域的核心政策法规文件，为全局工作人员提供政策查询和决策参考。',
  '00000000-0000-0000-0000-000000000001',
  'public',
  12,
  'active'
) ON CONFLICT (id) DO NOTHING;

-- 插入示例文档记录
INSERT INTO knowledge_documents (id, kb_id, name, file_type, file_size, uploader_id, indexing_status) VALUES
  ('30000000-0000-0000-0000-000000000001', '20000000-0000-0000-0000-000000000001',
   '中华人民共和国科学技术进步法（2021修订）.pdf', 'pdf', 2048000,
   '00000000-0000-0000-0000-000000000001', 'completed'),
  ('30000000-0000-0000-0000-000000000002', '20000000-0000-0000-0000-000000000001',
   '高新技术企业认定管理办法（国科发火〔2016〕32号）.pdf', 'pdf', 1536000,
   '00000000-0000-0000-0000-000000000001', 'completed'),
  ('30000000-0000-0000-0000-000000000003', '20000000-0000-0000-0000-000000000001',
   '国家重点研发计划管理暂行办法.pdf', 'pdf', 1024000,
   '00000000-0000-0000-0000-000000000001', 'completed'),
  ('30000000-0000-0000-0000-000000000004', '20000000-0000-0000-0000-000000000001',
   '科技成果转化法实施细则.docx', 'docx', 768000,
   '00000000-0000-0000-0000-000000000001', 'completed'),
  ('30000000-0000-0000-0000-000000000005', '20000000-0000-0000-0000-000000000001',
   '企业研发费用加计扣除政策指引（2023版）.pdf', 'pdf', 1280000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000006', '20000000-0000-0000-0000-000000000001',
   '关于进一步促进科技成果转移转化的若干措施.docx', 'docx', 512000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000007', '20000000-0000-0000-0000-000000000001',
   '知识产权强国建设纲要（2021-2035年）.pdf', 'pdf', 1792000,
   '00000000-0000-0000-0000-000000000001', 'completed'),
  ('30000000-0000-0000-0000-000000000008', '20000000-0000-0000-0000-000000000001',
   '科技型中小企业评价办法.pdf', 'pdf', 896000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000009', '20000000-0000-0000-0000-000000000001',
   '国家自然科学基金条例.pdf', 'pdf', 640000,
   '00000000-0000-0000-0000-000000000001', 'completed'),
  ('30000000-0000-0000-0000-000000000010', '20000000-0000-0000-0000-000000000001',
   '本市科技创新"十四五"规划.pdf', 'pdf', 3072000,
   '00000000-0000-0000-0000-000000000001', 'completed'),
  ('30000000-0000-0000-0000-000000000011', '20000000-0000-0000-0000-000000000001',
   '科技项目经费管理办法.docx', 'docx', 480000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000012', '20000000-0000-0000-0000-000000000001',
   '技术合同认定登记管理办法.txt', 'txt', 256000,
   '00000000-0000-0000-0000-000000000001', 'completed')
ON CONFLICT (id) DO NOTHING;

-- 为王科长创建"项目申报材料库"
INSERT INTO knowledge_bases (id, name, description, owner_id, visibility, doc_count, status)
VALUES (
  '20000000-0000-0000-0000-000000000002',
  '项目申报材料模板库',
  '包含各类科技项目申报书模板、预算编制指南、评审标准等参考资料，方便各科室申报项目时参考使用。',
  '00000000-0000-0000-0000-000000000002',
  'department',
  5,
  'active'
) ON CONFLICT (id) DO NOTHING;

INSERT INTO knowledge_documents (id, kb_id, name, file_type, file_size, uploader_id, indexing_status) VALUES
  ('30000000-0000-0000-0000-000000000013', '20000000-0000-0000-0000-000000000002',
   '重点研发项目申报书模板.docx', 'docx', 384000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000014', '20000000-0000-0000-0000-000000000002',
   '科技项目预算编制指南.xlsx', 'xlsx', 256000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000015', '20000000-0000-0000-0000-000000000002',
   '高企认定申报材料清单.pdf', 'pdf', 512000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000016', '20000000-0000-0000-0000-000000000002',
   '科技成果评价报告模板.docx', 'docx', 320000,
   '00000000-0000-0000-0000-000000000002', 'completed'),
  ('30000000-0000-0000-0000-000000000017', '20000000-0000-0000-0000-000000000002',
   '项目验收报告撰写规范.md', 'md', 128000,
   '00000000-0000-0000-0000-000000000002', 'completed')
ON CONFLICT (id) DO NOTHING;

SELECT '科技局知识库模拟数据插入成功！共2个知识库，17个文档记录。' AS status;
