-- ============================================
-- 修复 txw_gxzx_gxxxb 表 fwlxjh 字段缺失数据
-- 日期: 2026-06-11
-- 说明: 使用 qymc + bt_1 定位记录，跨环境通用
-- ============================================
SET NAMES utf8mb4;
SET CHARACTER SET utf8mb4;
-- 服务类型代码对照:
--   FWLX001  碳核查服务
--   FWLX002  碳足迹核算
--   FWLX003  碳减排技术服务
--   FWLX004  碳资产管理服务
--   FWLX005  ESG报告编制
--   FWLX006  碳交易咨询
-- ============================================

-- === AMT 企源 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003'       WHERE qymc = 'AMT 企源' AND bt_1 = '零碳园区解决方案';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX004,FWLX001' WHERE qymc = 'AMT 企源' AND bt_1 = '基于区块链技术的组织碳管理平台';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX003' WHERE qymc = 'AMT 企源' AND bt_1 = '可持续供应链溯源解决方案';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003,FWLX004' WHERE qymc = 'AMT 企源' AND bt_1 = '基于区块链技术的能碳双控解决方案';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX001' WHERE qymc = 'AMT 企源' AND bt_1 = '区块链驱动的全生命周期碳足迹溯源';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003,FWLX002' WHERE qymc = 'AMT 企源' AND bt_1 = '绿色产品生态设计平台';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX005'       WHERE qymc = 'AMT 企源' AND bt_1 = 'ESG 综合服务平台';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002'       WHERE qymc = 'AMT 企源' AND bt_1 = 'CBAM 申报平台';

-- === TUV 北德 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001'       WHERE qymc = 'TUV 北德' AND bt_1 = 'ISO 14064-1 温室气体核查认证解决方案';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX001' WHERE qymc = 'TUV 北德' AND bt_1 = 'ISO 14067 产品碳足迹核查认证解决方案';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001,FWLX003' WHERE qymc = 'TUV 北德' AND bt_1 = 'ISO 14068-1 碳中和核查认证解决方案';

-- === 上海建工四建 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003,FWLX001' WHERE qymc = '上海建工四建' AND bt_1 = '基于医院建筑运行特征智能化碳评价';

-- === 上海电气 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003,FWLX004' WHERE qymc = '上海电气' AND bt_1 = '能碳智慧管家解决方案';

-- === 中国电气装备 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003,FWLX002' WHERE qymc = '中国电气装备' AND bt_1 = '可再生能源溯源解决方案（源侧）';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003'       WHERE qymc = '中国电气装备' AND bt_1 = '智能微电网自洽系统解决方案（网侧）';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003'       WHERE qymc = '中国电气装备' AND bt_1 = '零碳园区解决方案（荷侧）';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003,FWLX004' WHERE qymc = '中国电气装备' AND bt_1 = '电化学储能解决方案（储侧）';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX004,FWLX002' WHERE qymc = '中国电气装备' AND bt_1 = '碳数据库解决方案（装备侧）';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003,FWLX006' WHERE qymc = '中国电气装备' AND bt_1 = '虚拟电厂场景解决方案（调控侧）';

-- === 必维认证 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX001' WHERE qymc = '必维认证' AND bt_1 = 'CBAM 填报 & 核验服务流程';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001'       WHERE qymc = '必维认证' AND bt_1 = 'ISO 14064 盘查 & 核查服务流程';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX001' WHERE qymc = '必维认证' AND bt_1 = 'ISO 14067 产品碳足迹服务流程';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001,FWLX003' WHERE qymc = '必维认证' AND bt_1 = 'ISO 14068 碳中和服务流程';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001,FWLX005' WHERE qymc = '必维认证' AND bt_1 = 'PAS 2080 碳管理体系服务流程';

-- === 时链科技 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX003'       WHERE qymc = '时链科技' AND bt_1 = '建筑节能降碳服务解决方案';

-- === 易碳数科 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX004' WHERE qymc = '易碳数科' AND bt_1 = 'HiQLCD 数据库 + HiQEditor';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX004' WHERE qymc = '易碳数科' AND bt_1 = '积木 LCA 云';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX004,FWLX002' WHERE qymc = '易碳数科' AND bt_1 = '积木碳云';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX001' WHERE qymc = '易碳数科' AND bt_1 = '碳边境调节机制计算工具 CBAM TOOL';

-- === 欧冶云商 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX001' WHERE qymc = '欧冶云商' AND bt_1 = 'CBAM 辅助核算系统';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002,FWLX001' WHERE qymc = '欧冶云商' AND bt_1 = '钢铁全产业链 EPD 平台';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX002'       WHERE qymc = '欧冶云商' AND bt_1 = 'OYLCA 工具';

-- === 联合征信 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001,FWLX005' WHERE qymc = '联合征信' AND bt_1 = '绿色企业认定';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001,FWLX003' WHERE qymc = '联合征信' AND bt_1 = '绿色项目认定';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX001,FWLX005' WHERE qymc = '联合征信' AND bt_1 = '中小企业环境信息披露';

-- === 零数科技 ===
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX004,FWLX006' WHERE qymc = '零数科技' AND bt_1 = '碳资产管理平台解决方案';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX006,FWLX004' WHERE qymc = '零数科技' AND bt_1 = '碳交易最优策略模拟平台解决方案';
UPDATE txw_gxzx_gxxxb SET fwlxjh = 'FWLX004,FWLX003' WHERE qymc = '零数科技' AND bt_1 = 'CCER 碳资产开发平台解决方案';

-- ============================================
-- 验证（确保每条语句都命中且仅命中1条）
-- ============================================
-- SELECT qymc, bt_1, fwlxjh FROM txw_gxzx_gxxxb ORDER BY qymc, bt_1;
-- SELECT fwlxjh, COUNT(*) cnt FROM txw_gxzx_gxxxb GROUP BY fwlxjh ORDER BY cnt DESC;
