-- xccpgl 表结构迁移（执行前请备份）
-- 若已执行过某条，可跳过该条

-- 1. 封面图片
ALTER TABLE xccpgl ADD COLUMN fmtp varchar(500) NULL COMMENT '封面图片（单张，JSON格式）';

-- 2. 新闻正文
ALTER TABLE xccpgl ADD COLUMN xwzw longtext NULL COMMENT '新闻正文（超文本）';

-- 3. 系统问题反馈（问题）分类字典
-- 字典类型：xtwtfk_qxgn，用于管理端和移动端下拉选项
-- 若已存在该 EnCode 的字典类型，可跳过
INSERT INTO base_dictionarytype (F_Id, F_ParentId, F_FullName, F_EnCode, F_IsTree, F_SortCode, F_CreatorTime, F_EnabledMark, F_DeleteMark)
SELECT '626798200000000001', '0', '系统问题反馈-问题分类', 'xtwtfk_qxgn', 0, 0, NOW(), 1, 0
FROM DUAL
WHERE NOT EXISTS (SELECT 1 FROM base_dictionarytype WHERE F_EnCode = 'xtwtfk_qxgn');

-- 字典数据（系统缺陷、功能缺失、显示异常、优化建议、功能新增）
INSERT INTO base_dictionarydata (F_Id, F_ParentId, F_FullName, F_EnCode, F_SortCode, F_DictionaryTypeId, F_CreatorTime, F_EnabledMark, F_DeleteMark)
SELECT '626798200000000011', '0', '系统缺陷', 'xt1', 1, '626798200000000001', NOW(), 1, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM base_dictionarydata WHERE F_DictionaryTypeId = '626798200000000001' AND F_FullName = '系统缺陷');
INSERT INTO base_dictionarydata (F_Id, F_ParentId, F_FullName, F_EnCode, F_SortCode, F_DictionaryTypeId, F_CreatorTime, F_EnabledMark, F_DeleteMark)
SELECT '626798200000000012', '0', '功能缺失', 'xt2', 2, '626798200000000001', NOW(), 1, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM base_dictionarydata WHERE F_DictionaryTypeId = '626798200000000001' AND F_FullName = '功能缺失');
INSERT INTO base_dictionarydata (F_Id, F_ParentId, F_FullName, F_EnCode, F_SortCode, F_DictionaryTypeId, F_CreatorTime, F_EnabledMark, F_DeleteMark)
SELECT '626798200000000013', '0', '显示异常', 'xt3', 3, '626798200000000001', NOW(), 1, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM base_dictionarydata WHERE F_DictionaryTypeId = '626798200000000001' AND F_FullName = '显示异常');
INSERT INTO base_dictionarydata (F_Id, F_ParentId, F_FullName, F_EnCode, F_SortCode, F_DictionaryTypeId, F_CreatorTime, F_EnabledMark, F_DeleteMark)
SELECT '626798200000000014', '0', '优化建议', 'xt4', 4, '626798200000000001', NOW(), 1, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM base_dictionarydata WHERE F_DictionaryTypeId = '626798200000000001' AND F_FullName = '优化建议');
INSERT INTO base_dictionarydata (F_Id, F_ParentId, F_FullName, F_EnCode, F_SortCode, F_DictionaryTypeId, F_CreatorTime, F_EnabledMark, F_DeleteMark)
SELECT '626798200000000015', '0', '功能新增', 'xt5', 5, '626798200000000001', NOW(), 1, 0 FROM DUAL WHERE NOT EXISTS (SELECT 1 FROM base_dictionarydata WHERE F_DictionaryTypeId = '626798200000000001' AND F_FullName = '功能新增');
