| | |
| | | |
| | | /** |
| | | * 查询单一任务(随访)列表 |
| | | * <p> |
| | | * 入参 soonTimeout=1 且 soonTimeoutHours=N 时,仅返回“尚未超时、且将在 N 小时内超时”的数据, |
| | | * 截止时间口径与 getCurrentUserServiceSubtaskCount 的 soonTimeoutCount 一致。 |
| | | * |
| | | * @param serviceSubtaskVO 单一任务(随访) |
| | | * @return 单一任务(随访)集合 |
| | | */ |
| | | public List<ServiceSubtask> selectServiceSubtaskList(ServiceSubtaskEntity serviceSubtaskVO); |
| | | |
| | | /** |
| | | * 分页第一阶段:只取当前页的子任务 id。 |
| | | * <p> |
| | | * where / order 与 {@link #selectServiceSubtaskList} 共用同一份 XML 片段 |
| | | * ({@code serviceSubtaskWhere} / {@code serviceSubtaskOrderByPaged}), |
| | | * 保证两条语句口径一致,不会出现「第一阶段选出行、第二阶段又被过滤掉」。 |
| | | * <p> |
| | | * 之所以要单独一条:列表语句 select 约 100 列,深翻页时被 offset 跳过的每一行 |
| | | * 都要回表读整行;而只取 id 的语句可以走覆盖索引并提前截断。 |
| | | * |
| | | * @param serviceSubtaskVO 查询条件(pageNum 是 offset、pageSize 是每页条数,由调用方算好) |
| | | * @return 当前页的子任务 id,已按排序规则排好序 |
| | | */ |
| | | public List<Long> selectServiceSubtaskIdsPage(ServiceSubtaskEntity serviceSubtaskVO); |
| | | |
| | | |
| | | |
| | |
| | | public int deleteServiceSubtaskByCondition(@Param("taskid") Long id, @Param("patid") Long patid); |
| | | |
| | | /** |
| | | * 删除患者出院记录对应的未完成随访任务 |
| | | * |
| | | * @param patid 患者ID |
| | | * @param inhospids 出院记录ID集合 |
| | | * @param sendstates 未完成状态集合 |
| | | * @return 删除条数 |
| | | */ |
| | | public int deleteUnfinishedServiceSubtaskByInhospids(@Param("patid") Long patid, |
| | | @Param("inhospids") List<Long> inhospids, |
| | | @Param("sendstates") List<Long> sendstates); |
| | | |
| | | /** |
| | | * 统计患者指定任务下未完成的随访任务数量(用于人工随访重复校验) |
| | | * |
| | | * @param patid 患者ID |
| | | * @param taskid 任务ID |
| | | * @param sendstates 未完成状态集合 |
| | | * @return 未完成任务数量 |
| | | */ |
| | | int countUnfinishedServiceSubtaskByPatidAndTaskid(@Param("patid") Long patid, |
| | | @Param("taskid") Long taskid, |
| | | @Param("sendstates") List<Long> sendstates); |
| | | |
| | | /** |
| | | * 删除单一任务(随访) |
| | | * |
| | | * @return 结果 |
| | |
| | | public List<ServiceSubtaskCount> getSfFzInfoEveryMonth(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceSubtask> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | /** |
| | | * 随访分类统计:按分组(groupKey=drcode / leaveldeptcode / leavehospitaldistrictcode)在库里聚合。 |
| | | * <p> |
| | | * 用于替代“把 getSfStatistics 命中的全部明细行捞回内存再逐行累加”的老做法, |
| | | * 只返回分组数(几十行)的结果;统计口径与 {@code getStatisticCategory} 完全一致。 |
| | | * |
| | | * @param serviceSubtaskCountReq 查询条件(必须已设置 groupKey / groupKeyList) |
| | | * @return 每个分组的聚合统计 |
| | | */ |
| | | public List<ServiceSubtaskStatistic> getSfStatisticsScriptSum(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | /** |
| | | * 随访分类统计:满意度题目量按分组聚合(替代 getSfStatisticsCategory 的 IN 大列表 + 内存过滤)。 |
| | | * |
| | | * @param serviceSubtaskCountReq 查询条件(必须已设置 groupKey / groupKeyList / configValue) |
| | | * @return 每行包含 groupCode、joyAllCount、joyCount 三个键 |
| | | */ |
| | | public List<Map<String, Object>> getSfStatisticsScriptJoySum(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceSubtaskStatistic> getSpecialSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | |
| | | * ywc: 已完成数量 sendstate = 6L |
| | | * dfs: 待发送数量 sendstate = 1L, 3L, 4L, 5L, 6L, 7L |
| | | * yfs: 已发送数量 sendstate = 2L |
| | | * cs: 超时数量 sendstate = 7L |
| | | * yc: 异常数量 excep = '1' |
| | | * yc: 警告数量 excep = '2' |
| | | */ |
| | |
| | | * failedVisitCount: 当前登录人随访任务失败总量 |
| | | * abnormalVisitVount: 当前登录人随访任务异常总量 |
| | | * allVisitCount: 当前登录人随访任务总量 |
| | | * soonTimeoutCount: 当前登录人即将超时数量(超时截止时间在 soonTimeoutHours 小时内,仅统计尚未超时的数据) |
| | | */ |
| | | public Map<String, Object> getCurrentUserServiceSubtaskCount(ServiceSubtaskEntity serviceSubtaskVO); |
| | | |
| | | /** |
| | | * 当前登录人待处理随访任务,按出院年月分组统计 |
| | | * <p> |
| | | * 统计口径:出院随访/门诊随访(service_type in 2,3)+ 人工(current_preachform = '1') |
| | | * + 待随访状态(sendstate in 1,2,3,5,7)+ 出院时间早于等于今天 - 7 天。 |
| | | * |
| | | * @param serviceSubtaskVO 查询条件(orgid、科室、病区) |
| | | * @return 每行包含 month(yyyy-MM)与 cnt(数量),数量为 0 的月份不会返回 |
| | | */ |
| | | public List<Map<String, Object>> countPendingManualTaskByMonth(ServiceSubtaskEntity serviceSubtaskVO); |
| | | |
| | | /** |
| | | * 获取门诊随访人数 |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 条件更新原任务的“是否再次随访”标识,用于二次随访幂等控制。 |
| | | * 仅当当前值不是目标值时才更新,返回受影响行数。 |
| | | * |
| | | * @param id 子任务 ID |
| | | * @param isVisitAgain 目标值(2-已再次随访) |
| | | * @return 受影响行数,1 表示抢到生成权,0 表示已被其他请求处理 |
| | | */ |
| | | int updateIsVisitAgainById(@Param("id") Long id, @Param("isVisitAgain") Integer isVisitAgain); |
| | | |
| | | } |