Files
eip4-platform/docs/P1/D类报表服务流识别.sql
zhengwr 1b69f8b481
Some checks failed
ci / build-test-parity (push) Has been cancelled
docs: 统一项目文档进 eip4-platform/docs + 新增进度路线总览
- 从工作区根 docs/(非 git,未版本化)合并全部文档进版本控制,消除文档两头分裂
- 新增 README(状态总览+模块完成度+全文档索引)、项目进度与路线-总览-2026-06-17(A兼容/B新功能+关键路径+待拍板决策)
- 被取代的冲突状态/审计快照归入 归档/;对最易误导的两份("16视图已交付"实现交付报告、06-13架构快照)加"已归档"横幅
- 现行权威:engineclass移植backlog(46视图) + 用户管理Delta移植(方法论/交接) + 组件设计体系 + 通用模板收口 + 客户沟通
- 诚实口径:纵向模块仅用户管理 parity,横向引擎地基较全,余 153 定制视图(47 framework+106 业务)多为通用页已产·delta 未移植

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 14:53:29 +08:00

51 lines
2.5 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.
-- ============================================================================
-- D 类报表服务流识别 SQL(EIP3报表迁移方案 D 节口径)
-- ----------------------------------------------------------------------------
-- 库:192.168.20.68:5435/postgres,schema=eip3,只读账户 ceshi/ceshi
-- 口径:报表模板 = view_template.type=200(根元素 <report>,337/339 含脚本);
-- 报表取数服务流 = 报表模板 XML 内 selectservice="XXX" 属性所引服务流。
-- 去重后 = D 类「79 个 selectservice 服务流」。
-- 注意:servicename/selectservice 值有的是真实 sys_serviceflow_id,
-- 有的是 Java 服务方法 FQN 或已失效引用(orphan);需 left join sys_serviceflow 鉴别。
-- ============================================================================
set search_path to eip3;
-- 1) D 类去重总数(= 79)
with raw as (
select unnest(regexp_matches(xml::text, 'selectservice="([^"]+)"', 'g')) as svc
from view_template where type = 200
)
select count(distinct trim(svc)) as d_class_distinct
from raw where trim(svc) <> '';
-- 2) D 类逐条:是否在 sys_serviceflow 中存在、是否活跃、是否受控
with raw as (
select distinct trim(unnest(regexp_matches(xml::text, 'selectservice="([^"]+)"', 'g'))) as flowid
from view_template where type = 200
),
d as (select flowid from raw where flowid <> '')
select
d.flowid,
case when sf.sys_serviceflow_id is null then 'MISSING' else 'EXISTS' end as in_sysflow,
sf.isactive,
sf.iscontrol,
sf.displayname
from d
left join sys_serviceflow sf on trim(sf.sys_serviceflow_id) = d.flowid
order by (case when sf.sys_serviceflow_id is null then 1 else 0 end), d.flowid;
-- 3) 汇总:存在 40(非受控 38 + 受控 2)/ 缺失 orphan 39
with raw as (
select distinct trim(unnest(regexp_matches(xml::text, 'selectservice="([^"]+)"', 'g'))) as flowid
from view_template where type = 200
),
d as (select flowid from raw where flowid <> '')
select
count(*) as d_total,
count(sf.sys_serviceflow_id) as exists_cnt,
count(*) - count(sf.sys_serviceflow_id) as missing_orphan_cnt,
count(*) filter (where sf.iscontrol = 0) as exists_noncontrol,
count(*) filter (where sf.iscontrol = 1) as exists_control
from d
left join sys_serviceflow sf on trim(sf.sys_serviceflow_id) = d.flowid;