package com.ruoyi.satisfaction.mapper; import com.ruoyi.satisfaction.domain.ServiceSubtaskDetailRatioExport; import com.ruoyi.satisfaction.domain.dto.MydTrendReqDTO; import com.ruoyi.satisfaction.domain.dto.MzMydScoreRankDTO; import com.ruoyi.satisfaction.domain.dto.QuestionCountKsOrBqDTO; import com.ruoyi.satisfaction.domain.dto.ServiceSubtaskOptionStatDTO; import com.ruoyi.satisfaction.domain.entity.SatisfactionStatQuery; import com.ruoyi.satisfaction.domain.row.SatisfactionSubtaskQuery; import com.ruoyi.satisfaction.domain.row.SatisfactionSubtaskRef; import com.ruoyi.satisfaction.domain.row.SatisfactionTaskRow; import com.ruoyi.satisfaction.domain.vo.MzMydScoreRankVO; import com.ruoyi.satisfaction.domain.vo.PatSatisfactionReqVO; import com.ruoyi.satisfaction.domain.vo.QuestionCountKsOrBqVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; import java.util.Map; /** * 满意度统计 Mapper 接口。 *
* 迁移说明:方法原本散落在 {@code com.smartor.mapper.ServiceSubtaskMapper} 与 * {@code com.smartor.mapper.ServiceSubtaskDetailMapper} 中,满意度模块化后集中到此处。 *
* 本模块自带 SQL,直接查询 {@code service_subtask} / {@code service_subtask_detail}, * 以及模板分类表;不依赖任何其它模块的 Mapper。 *
* 对应 XML:{@code ruoyi-satisfaction/src/main/resources/mapper/satisfaction/SatisfactionMapper.xml} *
* 已删除的死代码(搬迁时确认零调用点): *
* 回收人数必须是人数口径(count distinct sub_id),不能按题目汇总答案行数(题量口径)。 * * @param query 聚合查询条件 * @return 每行含 libtemplateid、cnt */ List> selectSatisfactionFillPersonCount(SatisfactionStatQuery query); /** * 【按 模板 + 问题】统计答题人数({@code count(distinct ssd.sub_id)})。 * * 为什么单独加这一条:{@code /statistics} 的「答题人数 / 未答题人数」必须与 * 「发送人数」({@link #selectSatisfactionSendCount},也是人数)同口径。 * 原实现误用 {@link #selectSatisfactionFillStatByMatchedtext} 的 {@code count(*)}(明细行数), * 而一条 {@code (sub_id, questiontext)} 可能有多行明细(多选项 / 重复明细), * 导致「未答题人数 = 发送人数 − 明细行数」出现负数(实测 -120)。 * * ⚠️ 平均分 / 最高分 / 最低分 / 各选项占比仍使用明细行数(那些口径本来就按行计),未改动。 * * 除聚合键与 {@code distinct} 外,from/where 与 {@link #selectSatisfactionFillStatByMatchedtext} * 完全一致,保证两者统计的是同一批数据。 * * @param query 聚合查询条件 * @return 每行含 libtemplateid、questiontext、cnt(人数) */ List> selectSatisfactionFillPersonCountByQuestion(SatisfactionStatQuery query); // ================================================================ 省立同德:趋势与维度 /** * 省立同德患者满意度趋势。 * * @param startFinishTime 开始时间 * @param endFinishTime 结束时间 * @param type 粒度:week / month / year / day * @return 趋势数据 */ List mydTrend(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); /** * 省立同德患者满意度——按科室维度统计。 */ List sltdMydTotalByDimension(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); /** * 省立同德患者满意度——按院区维度统计。 */ List sltdMydTotalByYQ(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); // ================================================================ 选项占比 /** * 统计满意度选项的百分比。 * * @param taskIds 任务 ID 列表 * @param subtaskIds 子任务 ID 列表(非空时只统计这些子任务;为空则统计这些任务下的全部子任务) * @param startOutHospTime 出院开始时间 * @param endOutHospTime 出院结束时间 * @param startFinishTime 完成开始时间 * @param endFinishTime 完成结束时间 * @param scoreStart 分值下限 * @param scoreEnd 分值上限 * @param questiontext 题目内容(模糊匹配) * @param valueType 题型(2=多选) */ List statQuestionOption( @Param("taskIds") List taskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType, @Param("subtaskIds") List subtaskIds); /** * 满意度导出:选项占比。 * * 项数 = 选了该选项的患者数(同一人同一题只取最新一条明细);分数 = 该选项所有明细 score 之和。 * * @param subtaskIds 本次导出的子任务 ID * @param questiontext 题目内容(可选,模糊匹配) */ List statMydQuestionOptionForExport( @Param("subtaskIds") List subtaskIds, @Param("questiontext") String questiontext); /** * 根据子任务 ID 统计满意度选项的百分比(用于满意度统计 serviceType=6/14)。 */ List statQuestionOptionBySubtaskIds( @Param("subtaskIds") List subtaskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType); /** * 按科室/病区对满意度题目做归类统计。 */ List statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO questionCountKsOrBqVO); // ================================================================ 综合得分排名 /** * 门诊满意度综合得分排名(按科室或病区)。 * * 综合满意度 = Σ(评分明细权重) / 评分明细条数 × 100%;权重只取 1、0.8、0.6、0.4、0.2 五档。 * * @param mzMydScoreRankVO 查询条件(dimensionType、serviceType、时间区间、科室/病区编号、orgid/campusid) * @return 每行科室/病区的综合得分,已按综合得分降序 */ List selectMzMydScoreRank(MzMydScoreRankVO mzMydScoreRankVO); // ================================================================ 重复明细清理(满意度统计前置) /** * 找出「同一 sub_id + questiontext」下除最新一条之外的重复明细 id。 * * 原属 {@code ServiceSubtaskDetailMapper},只有满意度统计调用(已核实),故一并搬入。 * * ⚠️ 注意:调用它的 {@code statQuestionOption} / {@code statQuestionOptionBySubtaskIds} * 会先执行本查询再执行 {@link #deleteRepeatDetailByIds},这是会写库的行为(原实现即如此)。 * * @return 需要清理的明细 id */ List selectRepeatDetailIds(); /** * 按 id 逻辑删除重复明细({@code del_flag = 1})。 */ Integer deleteRepeatDetailByIds(@Param("ids") List ids); // ================================================================ 子任务(满意度统计取数) /** * 按机构/院区/服务类型/出院时间/科室病区取子任务,只返回 id 与 taskid。 * * 对应原实现 {@code ServiceSubtaskServiceImpl.getServiceSubtasks(ServiceSubtaskEntity)} * 中 {@code sltdMydTotalByScore} 实际用到的口径。原方法基于 * {@code selectServiceSubtaskList}(近百个可选条件 + 返回全表字段), * 满意度只需要上述条件与两个 id 列,因此这里专写一条精简查询。 * * 条件与原文逐字一致(均「非空才拼」): * {@code del_flag = 0}、{@code orgid}、{@code campusid}、{@code service_type}、 * {@code endtime} 的日期区间、{@code deptOrDistrict==1} 时的病区 IN、 * {@code leaveldeptcodes} 的科室 IN。 * * ⚠️ 原文无默认排序、无默认分页({@code sort}/{@code pageSize} 未设置即不生效), * 本查询同样不加排序,保证结果顺序行为一致。 */ List selectMydSubtaskRefs(@Param("q") SatisfactionSubtaskQuery query); // ================================================================ 随访「满意度指数」取数 // 以下 5 个方法服务于 getSatisfactionIndex(随访统计页的「满意度题目总量/填报量/完成比例」), // 原本散落在 smartor 的 ServiceTaskMapper / IvrTaskTemplateScriptMapper / // SvyTaskTemplateScriptMapper / ServiceSubtaskMapper / ServiceSubtaskDetailMapper 中, // 由 ServiceSubtaskServiceImpl#getSatisfactionIndex 逐个调用。 /** * 按科室 或 病区取随访任务(只取统计用到的 4 列)。 * * 对应原实现 {@code ServiceTaskMapper.selectServiceTaskList},调用方按 type 二选一传参: * * {@code deptcode} 非空 → 拼 {@code deptcode REGEXP CONCAT('(^|,)', #{deptcode}, '(,|$)')}; * {@code leavehospitaldistrictcode} 非空 → 拼同形态的 REGEXP; * * 两者只会有一个非空,因此本方法一条 SQL 即可覆盖原实现的两个分支。 * * 口径逐字一致:{@code del_flag = 0}、{@code orgid}、{@code order by update_time desc, taskid desc}。 */ List selectSatisfactionServiceTasks( @Param("orgid") String orgid, @Param("deptcode") String deptcode, @Param("leavehospitaldistrictcode") String leavehospitaldistrictcode); /** * 统计某模板下的语音满意度题目数量。 * * 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 * * 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 为什么单独加这一条:{@code /statistics} 的「答题人数 / 未答题人数」必须与 * 「发送人数」({@link #selectSatisfactionSendCount},也是人数)同口径。 * 原实现误用 {@link #selectSatisfactionFillStatByMatchedtext} 的 {@code count(*)}(明细行数), * 而一条 {@code (sub_id, questiontext)} 可能有多行明细(多选项 / 重复明细), * 导致「未答题人数 = 发送人数 − 明细行数」出现负数(实测 -120)。 *
* ⚠️ 平均分 / 最高分 / 最低分 / 各选项占比仍使用明细行数(那些口径本来就按行计),未改动。 *
* 除聚合键与 {@code distinct} 外,from/where 与 {@link #selectSatisfactionFillStatByMatchedtext} * 完全一致,保证两者统计的是同一批数据。 * * @param query 聚合查询条件 * @return 每行含 libtemplateid、questiontext、cnt(人数) */ List> selectSatisfactionFillPersonCountByQuestion(SatisfactionStatQuery query); // ================================================================ 省立同德:趋势与维度 /** * 省立同德患者满意度趋势。 * * @param startFinishTime 开始时间 * @param endFinishTime 结束时间 * @param type 粒度:week / month / year / day * @return 趋势数据 */ List mydTrend(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); /** * 省立同德患者满意度——按科室维度统计。 */ List sltdMydTotalByDimension(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); /** * 省立同德患者满意度——按院区维度统计。 */ List sltdMydTotalByYQ(@Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("type") String type); // ================================================================ 选项占比 /** * 统计满意度选项的百分比。 * * @param taskIds 任务 ID 列表 * @param subtaskIds 子任务 ID 列表(非空时只统计这些子任务;为空则统计这些任务下的全部子任务) * @param startOutHospTime 出院开始时间 * @param endOutHospTime 出院结束时间 * @param startFinishTime 完成开始时间 * @param endFinishTime 完成结束时间 * @param scoreStart 分值下限 * @param scoreEnd 分值上限 * @param questiontext 题目内容(模糊匹配) * @param valueType 题型(2=多选) */ List statQuestionOption( @Param("taskIds") List taskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType, @Param("subtaskIds") List subtaskIds); /** * 满意度导出:选项占比。 * * 项数 = 选了该选项的患者数(同一人同一题只取最新一条明细);分数 = 该选项所有明细 score 之和。 * * @param subtaskIds 本次导出的子任务 ID * @param questiontext 题目内容(可选,模糊匹配) */ List statMydQuestionOptionForExport( @Param("subtaskIds") List subtaskIds, @Param("questiontext") String questiontext); /** * 根据子任务 ID 统计满意度选项的百分比(用于满意度统计 serviceType=6/14)。 */ List statQuestionOptionBySubtaskIds( @Param("subtaskIds") List subtaskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType); /** * 按科室/病区对满意度题目做归类统计。 */ List statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO questionCountKsOrBqVO); // ================================================================ 综合得分排名 /** * 门诊满意度综合得分排名(按科室或病区)。 * * 综合满意度 = Σ(评分明细权重) / 评分明细条数 × 100%;权重只取 1、0.8、0.6、0.4、0.2 五档。 * * @param mzMydScoreRankVO 查询条件(dimensionType、serviceType、时间区间、科室/病区编号、orgid/campusid) * @return 每行科室/病区的综合得分,已按综合得分降序 */ List selectMzMydScoreRank(MzMydScoreRankVO mzMydScoreRankVO); // ================================================================ 重复明细清理(满意度统计前置) /** * 找出「同一 sub_id + questiontext」下除最新一条之外的重复明细 id。 * * 原属 {@code ServiceSubtaskDetailMapper},只有满意度统计调用(已核实),故一并搬入。 * * ⚠️ 注意:调用它的 {@code statQuestionOption} / {@code statQuestionOptionBySubtaskIds} * 会先执行本查询再执行 {@link #deleteRepeatDetailByIds},这是会写库的行为(原实现即如此)。 * * @return 需要清理的明细 id */ List selectRepeatDetailIds(); /** * 按 id 逻辑删除重复明细({@code del_flag = 1})。 */ Integer deleteRepeatDetailByIds(@Param("ids") List ids); // ================================================================ 子任务(满意度统计取数) /** * 按机构/院区/服务类型/出院时间/科室病区取子任务,只返回 id 与 taskid。 * * 对应原实现 {@code ServiceSubtaskServiceImpl.getServiceSubtasks(ServiceSubtaskEntity)} * 中 {@code sltdMydTotalByScore} 实际用到的口径。原方法基于 * {@code selectServiceSubtaskList}(近百个可选条件 + 返回全表字段), * 满意度只需要上述条件与两个 id 列,因此这里专写一条精简查询。 * * 条件与原文逐字一致(均「非空才拼」): * {@code del_flag = 0}、{@code orgid}、{@code campusid}、{@code service_type}、 * {@code endtime} 的日期区间、{@code deptOrDistrict==1} 时的病区 IN、 * {@code leaveldeptcodes} 的科室 IN。 * * ⚠️ 原文无默认排序、无默认分页({@code sort}/{@code pageSize} 未设置即不生效), * 本查询同样不加排序,保证结果顺序行为一致。 */ List selectMydSubtaskRefs(@Param("q") SatisfactionSubtaskQuery query); // ================================================================ 随访「满意度指数」取数 // 以下 5 个方法服务于 getSatisfactionIndex(随访统计页的「满意度题目总量/填报量/完成比例」), // 原本散落在 smartor 的 ServiceTaskMapper / IvrTaskTemplateScriptMapper / // SvyTaskTemplateScriptMapper / ServiceSubtaskMapper / ServiceSubtaskDetailMapper 中, // 由 ServiceSubtaskServiceImpl#getSatisfactionIndex 逐个调用。 /** * 按科室 或 病区取随访任务(只取统计用到的 4 列)。 * * 对应原实现 {@code ServiceTaskMapper.selectServiceTaskList},调用方按 type 二选一传参: * * {@code deptcode} 非空 → 拼 {@code deptcode REGEXP CONCAT('(^|,)', #{deptcode}, '(,|$)')}; * {@code leavehospitaldistrictcode} 非空 → 拼同形态的 REGEXP; * * 两者只会有一个非空,因此本方法一条 SQL 即可覆盖原实现的两个分支。 * * 口径逐字一致:{@code del_flag = 0}、{@code orgid}、{@code order by update_time desc, taskid desc}。 */ List selectSatisfactionServiceTasks( @Param("orgid") String orgid, @Param("deptcode") String deptcode, @Param("leavehospitaldistrictcode") String leavehospitaldistrictcode); /** * 统计某模板下的语音满意度题目数量。 * * 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 * * 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 项数 = 选了该选项的患者数(同一人同一题只取最新一条明细);分数 = 该选项所有明细 score 之和。 * * @param subtaskIds 本次导出的子任务 ID * @param questiontext 题目内容(可选,模糊匹配) */ List statMydQuestionOptionForExport( @Param("subtaskIds") List subtaskIds, @Param("questiontext") String questiontext); /** * 根据子任务 ID 统计满意度选项的百分比(用于满意度统计 serviceType=6/14)。 */ List statQuestionOptionBySubtaskIds( @Param("subtaskIds") List subtaskIds, @Param("startOutHospTime") Date startOutHospTime, @Param("endOutHospTime") Date endOutHospTime, @Param("startFinishTime") Date startFinishTime, @Param("endFinishTime") Date endFinishTime, @Param("scoreStart") Double scoreStart, @Param("scoreEnd") Double scoreEnd, @Param("questiontext") String questiontext, @Param("valueType") String valueType); /** * 按科室/病区对满意度题目做归类统计。 */ List statQuestionOptionByKsOrBq(QuestionCountKsOrBqVO questionCountKsOrBqVO); // ================================================================ 综合得分排名 /** * 门诊满意度综合得分排名(按科室或病区)。 * * 综合满意度 = Σ(评分明细权重) / 评分明细条数 × 100%;权重只取 1、0.8、0.6、0.4、0.2 五档。 * * @param mzMydScoreRankVO 查询条件(dimensionType、serviceType、时间区间、科室/病区编号、orgid/campusid) * @return 每行科室/病区的综合得分,已按综合得分降序 */ List selectMzMydScoreRank(MzMydScoreRankVO mzMydScoreRankVO); // ================================================================ 重复明细清理(满意度统计前置) /** * 找出「同一 sub_id + questiontext」下除最新一条之外的重复明细 id。 * * 原属 {@code ServiceSubtaskDetailMapper},只有满意度统计调用(已核实),故一并搬入。 * * ⚠️ 注意:调用它的 {@code statQuestionOption} / {@code statQuestionOptionBySubtaskIds} * 会先执行本查询再执行 {@link #deleteRepeatDetailByIds},这是会写库的行为(原实现即如此)。 * * @return 需要清理的明细 id */ List selectRepeatDetailIds(); /** * 按 id 逻辑删除重复明细({@code del_flag = 1})。 */ Integer deleteRepeatDetailByIds(@Param("ids") List ids); // ================================================================ 子任务(满意度统计取数) /** * 按机构/院区/服务类型/出院时间/科室病区取子任务,只返回 id 与 taskid。 * * 对应原实现 {@code ServiceSubtaskServiceImpl.getServiceSubtasks(ServiceSubtaskEntity)} * 中 {@code sltdMydTotalByScore} 实际用到的口径。原方法基于 * {@code selectServiceSubtaskList}(近百个可选条件 + 返回全表字段), * 满意度只需要上述条件与两个 id 列,因此这里专写一条精简查询。 * * 条件与原文逐字一致(均「非空才拼」): * {@code del_flag = 0}、{@code orgid}、{@code campusid}、{@code service_type}、 * {@code endtime} 的日期区间、{@code deptOrDistrict==1} 时的病区 IN、 * {@code leaveldeptcodes} 的科室 IN。 * * ⚠️ 原文无默认排序、无默认分页({@code sort}/{@code pageSize} 未设置即不生效), * 本查询同样不加排序,保证结果顺序行为一致。 */ List selectMydSubtaskRefs(@Param("q") SatisfactionSubtaskQuery query); // ================================================================ 随访「满意度指数」取数 // 以下 5 个方法服务于 getSatisfactionIndex(随访统计页的「满意度题目总量/填报量/完成比例」), // 原本散落在 smartor 的 ServiceTaskMapper / IvrTaskTemplateScriptMapper / // SvyTaskTemplateScriptMapper / ServiceSubtaskMapper / ServiceSubtaskDetailMapper 中, // 由 ServiceSubtaskServiceImpl#getSatisfactionIndex 逐个调用。 /** * 按科室 或 病区取随访任务(只取统计用到的 4 列)。 * * 对应原实现 {@code ServiceTaskMapper.selectServiceTaskList},调用方按 type 二选一传参: * * {@code deptcode} 非空 → 拼 {@code deptcode REGEXP CONCAT('(^|,)', #{deptcode}, '(,|$)')}; * {@code leavehospitaldistrictcode} 非空 → 拼同形态的 REGEXP; * * 两者只会有一个非空,因此本方法一条 SQL 即可覆盖原实现的两个分支。 * * 口径逐字一致:{@code del_flag = 0}、{@code orgid}、{@code order by update_time desc, taskid desc}。 */ List selectSatisfactionServiceTasks( @Param("orgid") String orgid, @Param("deptcode") String deptcode, @Param("leavehospitaldistrictcode") String leavehospitaldistrictcode); /** * 统计某模板下的语音满意度题目数量。 * * 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 * * 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 综合满意度 = Σ(评分明细权重) / 评分明细条数 × 100%;权重只取 1、0.8、0.6、0.4、0.2 五档。 * * @param mzMydScoreRankVO 查询条件(dimensionType、serviceType、时间区间、科室/病区编号、orgid/campusid) * @return 每行科室/病区的综合得分,已按综合得分降序 */ List selectMzMydScoreRank(MzMydScoreRankVO mzMydScoreRankVO); // ================================================================ 重复明细清理(满意度统计前置) /** * 找出「同一 sub_id + questiontext」下除最新一条之外的重复明细 id。 * * 原属 {@code ServiceSubtaskDetailMapper},只有满意度统计调用(已核实),故一并搬入。 * * ⚠️ 注意:调用它的 {@code statQuestionOption} / {@code statQuestionOptionBySubtaskIds} * 会先执行本查询再执行 {@link #deleteRepeatDetailByIds},这是会写库的行为(原实现即如此)。 * * @return 需要清理的明细 id */ List selectRepeatDetailIds(); /** * 按 id 逻辑删除重复明细({@code del_flag = 1})。 */ Integer deleteRepeatDetailByIds(@Param("ids") List ids); // ================================================================ 子任务(满意度统计取数) /** * 按机构/院区/服务类型/出院时间/科室病区取子任务,只返回 id 与 taskid。 * * 对应原实现 {@code ServiceSubtaskServiceImpl.getServiceSubtasks(ServiceSubtaskEntity)} * 中 {@code sltdMydTotalByScore} 实际用到的口径。原方法基于 * {@code selectServiceSubtaskList}(近百个可选条件 + 返回全表字段), * 满意度只需要上述条件与两个 id 列,因此这里专写一条精简查询。 * * 条件与原文逐字一致(均「非空才拼」): * {@code del_flag = 0}、{@code orgid}、{@code campusid}、{@code service_type}、 * {@code endtime} 的日期区间、{@code deptOrDistrict==1} 时的病区 IN、 * {@code leaveldeptcodes} 的科室 IN。 * * ⚠️ 原文无默认排序、无默认分页({@code sort}/{@code pageSize} 未设置即不生效), * 本查询同样不加排序,保证结果顺序行为一致。 */ List selectMydSubtaskRefs(@Param("q") SatisfactionSubtaskQuery query); // ================================================================ 随访「满意度指数」取数 // 以下 5 个方法服务于 getSatisfactionIndex(随访统计页的「满意度题目总量/填报量/完成比例」), // 原本散落在 smartor 的 ServiceTaskMapper / IvrTaskTemplateScriptMapper / // SvyTaskTemplateScriptMapper / ServiceSubtaskMapper / ServiceSubtaskDetailMapper 中, // 由 ServiceSubtaskServiceImpl#getSatisfactionIndex 逐个调用。 /** * 按科室 或 病区取随访任务(只取统计用到的 4 列)。 * * 对应原实现 {@code ServiceTaskMapper.selectServiceTaskList},调用方按 type 二选一传参: * * {@code deptcode} 非空 → 拼 {@code deptcode REGEXP CONCAT('(^|,)', #{deptcode}, '(,|$)')}; * {@code leavehospitaldistrictcode} 非空 → 拼同形态的 REGEXP; * * 两者只会有一个非空,因此本方法一条 SQL 即可覆盖原实现的两个分支。 * * 口径逐字一致:{@code del_flag = 0}、{@code orgid}、{@code order by update_time desc, taskid desc}。 */ List selectSatisfactionServiceTasks( @Param("orgid") String orgid, @Param("deptcode") String deptcode, @Param("leavehospitaldistrictcode") String leavehospitaldistrictcode); /** * 统计某模板下的语音满意度题目数量。 * * 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 * * 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 原属 {@code ServiceSubtaskDetailMapper},只有满意度统计调用(已核实),故一并搬入。 *
* ⚠️ 注意:调用它的 {@code statQuestionOption} / {@code statQuestionOptionBySubtaskIds} * 会先执行本查询再执行 {@link #deleteRepeatDetailByIds},这是会写库的行为(原实现即如此)。 * * @return 需要清理的明细 id */ List selectRepeatDetailIds(); /** * 按 id 逻辑删除重复明细({@code del_flag = 1})。 */ Integer deleteRepeatDetailByIds(@Param("ids") List ids); // ================================================================ 子任务(满意度统计取数) /** * 按机构/院区/服务类型/出院时间/科室病区取子任务,只返回 id 与 taskid。 * * 对应原实现 {@code ServiceSubtaskServiceImpl.getServiceSubtasks(ServiceSubtaskEntity)} * 中 {@code sltdMydTotalByScore} 实际用到的口径。原方法基于 * {@code selectServiceSubtaskList}(近百个可选条件 + 返回全表字段), * 满意度只需要上述条件与两个 id 列,因此这里专写一条精简查询。 * * 条件与原文逐字一致(均「非空才拼」): * {@code del_flag = 0}、{@code orgid}、{@code campusid}、{@code service_type}、 * {@code endtime} 的日期区间、{@code deptOrDistrict==1} 时的病区 IN、 * {@code leaveldeptcodes} 的科室 IN。 * * ⚠️ 原文无默认排序、无默认分页({@code sort}/{@code pageSize} 未设置即不生效), * 本查询同样不加排序,保证结果顺序行为一致。 */ List selectMydSubtaskRefs(@Param("q") SatisfactionSubtaskQuery query); // ================================================================ 随访「满意度指数」取数 // 以下 5 个方法服务于 getSatisfactionIndex(随访统计页的「满意度题目总量/填报量/完成比例」), // 原本散落在 smartor 的 ServiceTaskMapper / IvrTaskTemplateScriptMapper / // SvyTaskTemplateScriptMapper / ServiceSubtaskMapper / ServiceSubtaskDetailMapper 中, // 由 ServiceSubtaskServiceImpl#getSatisfactionIndex 逐个调用。 /** * 按科室 或 病区取随访任务(只取统计用到的 4 列)。 * * 对应原实现 {@code ServiceTaskMapper.selectServiceTaskList},调用方按 type 二选一传参: * * {@code deptcode} 非空 → 拼 {@code deptcode REGEXP CONCAT('(^|,)', #{deptcode}, '(,|$)')}; * {@code leavehospitaldistrictcode} 非空 → 拼同形态的 REGEXP; * * 两者只会有一个非空,因此本方法一条 SQL 即可覆盖原实现的两个分支。 * * 口径逐字一致:{@code del_flag = 0}、{@code orgid}、{@code order by update_time desc, taskid desc}。 */ List selectSatisfactionServiceTasks( @Param("orgid") String orgid, @Param("deptcode") String deptcode, @Param("leavehospitaldistrictcode") String leavehospitaldistrictcode); /** * 统计某模板下的语音满意度题目数量。 * * 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 * * 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 对应原实现 {@code ServiceSubtaskServiceImpl.getServiceSubtasks(ServiceSubtaskEntity)} * 中 {@code sltdMydTotalByScore} 实际用到的口径。原方法基于 * {@code selectServiceSubtaskList}(近百个可选条件 + 返回全表字段), * 满意度只需要上述条件与两个 id 列,因此这里专写一条精简查询。 *
* 条件与原文逐字一致(均「非空才拼」): * {@code del_flag = 0}、{@code orgid}、{@code campusid}、{@code service_type}、 * {@code endtime} 的日期区间、{@code deptOrDistrict==1} 时的病区 IN、 * {@code leaveldeptcodes} 的科室 IN。 *
* ⚠️ 原文无默认排序、无默认分页({@code sort}/{@code pageSize} 未设置即不生效), * 本查询同样不加排序,保证结果顺序行为一致。 */ List selectMydSubtaskRefs(@Param("q") SatisfactionSubtaskQuery query); // ================================================================ 随访「满意度指数」取数 // 以下 5 个方法服务于 getSatisfactionIndex(随访统计页的「满意度题目总量/填报量/完成比例」), // 原本散落在 smartor 的 ServiceTaskMapper / IvrTaskTemplateScriptMapper / // SvyTaskTemplateScriptMapper / ServiceSubtaskMapper / ServiceSubtaskDetailMapper 中, // 由 ServiceSubtaskServiceImpl#getSatisfactionIndex 逐个调用。 /** * 按科室 或 病区取随访任务(只取统计用到的 4 列)。 * * 对应原实现 {@code ServiceTaskMapper.selectServiceTaskList},调用方按 type 二选一传参: * * {@code deptcode} 非空 → 拼 {@code deptcode REGEXP CONCAT('(^|,)', #{deptcode}, '(,|$)')}; * {@code leavehospitaldistrictcode} 非空 → 拼同形态的 REGEXP; * * 两者只会有一个非空,因此本方法一条 SQL 即可覆盖原实现的两个分支。 * * 口径逐字一致:{@code del_flag = 0}、{@code orgid}、{@code order by update_time desc, taskid desc}。 */ List selectSatisfactionServiceTasks( @Param("orgid") String orgid, @Param("deptcode") String deptcode, @Param("leavehospitaldistrictcode") String leavehospitaldistrictcode); /** * 统计某模板下的语音满意度题目数量。 * * 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 * * 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 对应原实现 {@code ServiceTaskMapper.selectServiceTaskList},调用方按 type 二选一传参: *
* 口径逐字一致:{@code del_flag = 0}、{@code orgid}、{@code order by update_time desc, taskid desc}。 */ List selectSatisfactionServiceTasks( @Param("orgid") String orgid, @Param("deptcode") String deptcode, @Param("leavehospitaldistrictcode") String leavehospitaldistrictcode); /** * 统计某模板下的语音满意度题目数量。 * * 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 * * 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 对应原实现 {@code IvrTaskTemplateScriptMapper.selectIvrTaskTemplateScriptList} * 在 {@code templateID + orgid + scriptAssortid} 三个条件下的 {@code size()}。 *
* 口径注意:{@code scriptAssortid} 为 {@code null} 时不拼该条件 * (等于统计该模板全部题目)——与原文 {@code } 一致。 */ int countIvrTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("scriptAssortid") Long scriptAssortid); /** * 统计某模板下的问卷满意度题目数量。 * * 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 * * 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 * * 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 * * 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 对应原实现 {@code SvyTaskTemplateScriptMapper.selectSvyTaskTemplateScriptList} * 在 {@code templateID + orgid + categoryid} 三个条件下的 {@code size()}。 *
* 口径注意:{@code categoryid} 为 {@code null} 时不拼该条件(与原文一致)。 */ int countSvyTaskTemplateScripts(@Param("templateID") Long templateID, @Param("orgid") String orgid, @Param("categoryid") Long categoryid); /** * 统计某任务下指定发送状态的子任务数量。 *
* 对应原实现 {@code ServiceSubtaskMapper.selectServiceSubtaskBySendstate} * 在 {@code taskid + sendstates(3,5,6)} 两个条件下的 {@code size()}。 * 原调用没有设置 {@code orgid},故本方法也不含该条件。 *
* 口径注意:含 {@code del_flag = 0};{@code sendstates} 为 {@code null} 时不拼 IN 条件。 */ int countSubtaskBySendstates(@Param("taskid") Long taskid, @Param("sendstates") List sendstates); /** * 统计某任务下的满意度明细数量。 * * 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 * * 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }
* 对应原实现 {@code ServiceSubtaskDetailMapper.selectServiceSubtaskDetailList} * 在 {@code taskid + categoryid + orgid} 三个条件下的 {@code size()}。 *
* 口径注意:原文没有 {@code del_flag} 条件,本查询同样不加; * {@code categoryid} 为 {@code null} 时不拼该条件(保留原文的"按任务类型决定是否设 categoryid"行为)。 */ int countSubtaskDetail(@Param("taskid") Long taskid, @Param("categoryid") Long categoryid, @Param("orgid") String orgid); }