liusheng
5 天以前 0bbbd746e8c39d91ad7b47a4e36e29ab972dc98c
ruoyi-satisfaction/src/main/java/com/ruoyi/satisfaction/mapper/SatisfactionMapper.java
@@ -22,8 +22,8 @@
/**
 * 满意度统计 Mapper 接口。
 * <p>
 * 迁移说明:方法原本散落在 {@code com.smartor.mapper.ServiceSubtaskMapper} 与
 * {@code com.smartor.mapper.ServiceSubtaskDetailMapper} 中,满意度模块化后集中到此处。
 * 迁移说明:方法原本散落在 {@code com.ruoyi.task.mapper.ServiceSubtaskMapper} 与
 * {@code com.ruoyi.task.mapper.ServiceSubtaskDetailMapper} 中,满意度模块化后集中到此处。
 * <p>
 * 本模块自带 SQL,<b>直接查询</b> {@code service_subtask} / {@code service_subtask_detail},
 * 以及模板分类表;不依赖任何其它模块的 Mapper。
@@ -85,6 +85,25 @@
     */
    List<Map<String, Object>> selectSatisfactionFillPersonCount(SatisfactionStatQuery query);
    /**
     * 【按 模板 + 问题】统计答题人数({@code count(distinct ssd.sub_id)})。
     * <p>
     * <b>为什么单独加这一条</b>:{@code /statistics} 的「答题人数 / 未答题人数」必须与
     * 「发送人数」({@link #selectSatisfactionSendCount},也是人数)同口径。
     * 原实现误用 {@link #selectSatisfactionFillStatByMatchedtext} 的 {@code count(*)}(明细<b>行数</b>),
     * 而一条 {@code (sub_id, questiontext)} 可能有多行明细(多选项 / 重复明细),
     * 导致「未答题人数 = 发送人数 − 明细行数」出现负数(实测 -120)。
     * <p>
     * ⚠️ 平均分 / 最高分 / 最低分 / 各选项占比仍使用明细行数(那些口径本来就按行计),未改动。
     * <p>
     * 除聚合键与 {@code distinct} 外,from/where 与 {@link #selectSatisfactionFillStatByMatchedtext}
     * 完全一致,保证两者统计的是同一批数据。
     *
     * @param query 聚合查询条件
     * @return 每行含 libtemplateid、questiontext、cnt(人数)
     */
    List<Map<String, Object>> selectSatisfactionFillPersonCountByQuestion(SatisfactionStatQuery query);
    // ================================================================ 省立同德:趋势与维度
    /**