-- ============================================
-- 预览：品项「直播-生命之波」在各表中的影响行数（仅查询，不更新）
-- ============================================
-- 执行「修正品项直播-生命之波开单耗卡退卡分类-执行版.sql」前，可先执行本脚本确认影响范围。
-- 品项以 xmmc = '直播-生命之波' 匹配；若有多条请改用 F_Id。
-- ============================================

-- 品项当前值（请确认 qt2、F_BeautyType 已是目标值）
SELECT xmzl.F_Id, xmzl.xmmc, xmzl.qt2 AS 品项分类, xmzl.F_BeautyType AS 科美类型
FROM lq_xmzl xmzl
WHERE xmzl.xmmc = '直播-生命之波';

-- 各表将更新的行数
SELECT 'lq_kd_pxmx'       AS 表名, COUNT(*) AS 影响行数 FROM lq_kd_pxmx pxmx       INNER JOIN lq_xmzl xmzl ON pxmx.px = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_kd_deductinfo'  AS 表名, COUNT(*) AS 影响行数 FROM lq_kd_deductinfo d    INNER JOIN lq_xmzl xmzl ON d.F_ItemId = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_xh_pxmx'        AS 表名, COUNT(*) AS 影响行数 FROM lq_xh_pxmx pxmx       INNER JOIN lq_xmzl xmzl ON pxmx.px = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_hytk_mx'        AS 表名, COUNT(*) AS 影响行数 FROM lq_hytk_mx mx         INNER JOIN lq_xmzl xmzl ON mx.px = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_kd_jksyj'       AS 表名, COUNT(*) AS 影响行数 FROM lq_kd_jksyj j         INNER JOIN lq_xmzl xmzl ON j.F_ItemId = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_kd_jksyj(pxmx)' AS 表名, COUNT(*) AS 影响行数 FROM lq_kd_jksyj j         INNER JOIN lq_kd_pxmx px ON j.F_kdpxid = px.F_Id INNER JOIN lq_xmzl xmzl ON px.px = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_xh_jksyj'       AS 表名, COUNT(*) AS 影响行数 FROM lq_xh_jksyj j         INNER JOIN lq_xmzl xmzl ON j.F_ItemId = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_hytk_jksyj'     AS 表名, COUNT(*) AS 影响行数 FROM lq_hytk_jksyj j       INNER JOIN lq_xmzl xmzl ON j.F_ItemId = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_kd_kjbsyj'      AS 表名, COUNT(*) AS 影响行数 FROM lq_kd_kjbsyj j        INNER JOIN lq_xmzl xmzl ON j.F_ItemId = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_kd_kjbsyj(pxmx)'AS 表名, COUNT(*) AS 影响行数 FROM lq_kd_kjbsyj j        INNER JOIN lq_kd_pxmx px ON j.F_kdpxid = px.F_Id INNER JOIN lq_xmzl xmzl ON px.px = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_xh_kjbsyj'      AS 表名, COUNT(*) AS 影响行数 FROM lq_xh_kjbsyj j         INNER JOIN lq_xmzl xmzl ON j.F_ItemId = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波'
UNION ALL
SELECT 'lq_hytk_kjbsyj'    AS 表名, COUNT(*) AS 影响行数 FROM lq_hytk_kjbsyj j      INNER JOIN lq_xmzl xmzl ON j.F_ItemId = xmzl.F_Id WHERE xmzl.xmmc = '直播-生命之波';
