ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceSubtaskController.java
@@ -1,6 +1,9 @@ package com.ruoyi.web.controller.smartor; import com.alibaba.fastjson.JSON; import com.github.pagehelper.ISelect; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.ruoyi.common.annotation.AddOrgId; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.constant.HttpStatus; @@ -89,6 +92,9 @@ @Value("${spring.profiles.active}") private String active; @Value("${isAdmin}") private List<Long> isAdmin; @Autowired private RedisCache redisCache; @@ -546,6 +552,33 @@ Integer offset = PageUtils.getOffset(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); serviceSubtaskCountReq.setPageNum(offset); Integer statisticaltype = serviceSubtaskCountReq.getStatisticaltype(); if(ObjectUtils.isNotEmpty(statisticaltype)){ SysUser user = getLoginUser().getUser(); if(!isAdmin.contains(user.getUserId())){ if(statisticaltype==1){ if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getLeavehospitaldistrictcodes())){ //全部病区 String deptInfo = user.getDeptInfo(); List<String> leavehospitaldistrictcodes = JSON.parseArray(deptInfo) .stream() .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); serviceSubtaskCountReq.setLeavehospitaldistrictcodes(leavehospitaldistrictcodes); } }else if(statisticaltype==2){ if(CollectionUtils.isEmpty(serviceSubtaskCountReq.getDeptcodes())){ //全部科室 String hospInfo = user.getHospInfo(); List<String> deptCodes = JSON.parseArray(hospInfo) .stream() .map(item -> (String) ((List<?>) item).get(0)).collect(Collectors.toList()); serviceSubtaskCountReq.setDeptcodes(deptCodes); } } } } String followUpCountStyle = configService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid()); if (ObjectUtils.isNotEmpty(followUpCountStyle)) { serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle); @@ -559,6 +592,31 @@ } /** * 获取专病随访统计比例 */ @ApiOperation("获取专病随访统计比例") @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") @PostMapping("/getSpecialSfStatistics") public Map<String, Object> getSpecialSfStatistics(@RequestBody ServiceSubtaskCountReq serviceSubtaskCountReq) { if (CollectionUtils.isEmpty(serviceSubtaskCountReq.getServiceType())) { return error("服务类型不能为空"); } Integer offset = PageUtils.getOffset(serviceSubtaskCountReq.getPageNum(), serviceSubtaskCountReq.getPageSize()); serviceSubtaskCountReq.setPageNum(offset); String followUpCountStyle = configService.selectConfigByKey("followUpCountStyle", serviceSubtaskCountReq.getOrgid()); if (ObjectUtils.isNotEmpty(followUpCountStyle)) { serviceSubtaskCountReq.setFollowUpCountStyle(followUpCountStyle); } else { serviceSubtaskCountReq.setFollowUpCountStyle("1"); } serviceSubtaskCountReq.setPageNum(null); serviceSubtaskCountReq.setPageSize(null); List<ServiceSubtaskStatistic> sfStatistics = serviceSubtaskService.getSpecialSfStatistics(serviceSubtaskCountReq); return getDataTable4(CollectionUtils.isEmpty(sfStatistics) ? sfStatistics.size() : 0, serviceSubtaskService.getSpecialSfStatistics(serviceSubtaskCountReq)); } /** * 获取随访统计比例 */ @ApiOperation("获取随访满意度统计") smartor/src/main/java/com/smartor/domain/ServiceSubtask.java
@@ -680,4 +680,11 @@ @ApiModelProperty(value = "手术记录id 对应pat_med_operation_item.id") private Long operationItemId; /** * 疾病病种 */ @ApiModelProperty(value = "疾病病种") @Excel(name = " 疾病病种") private String diagType; } smartor/src/main/java/com/smartor/domain/ServiceSubtaskCountReq.java
@@ -57,7 +57,7 @@ @ApiModelProperty(value = "子任务Id集合") private List<Long> subTaskIds; @ApiModelProperty(value = "科室病区:1,病区统计 2,科室统计") @ApiModelProperty(value = "科室病区:1,病区统计 2,科室统计 3. 病种统计") private Integer statisticaltype; private String visitDeptCode; @@ -182,6 +182,24 @@ @ApiModelProperty(value = "超链接统计列表类型") private String hyperLinkInfoType; @ApiModelProperty(value = "任务ID", required = true) private Long taskId; @ApiModelProperty(value = "taskIds集合") private List<Long> taskIds; @ApiModelProperty(value = "任务名称") private String taskName; @ApiModelProperty(value = "taskNamee集合") private List<String> taskNames; @ApiModelProperty(value = "疾病病种") private String diagType; @ApiModelProperty(value = "diagType集合") private List<String> diagTypes; /** * pageNum */ smartor/src/main/java/com/smartor/domain/ServiceSubtaskStatistic.java
@@ -266,6 +266,16 @@ @ApiModelProperty(value = "科室病区") private Integer statisticaltype; @ApiModelProperty(value = "任务ID", required = true) private Long taskId; @Excel(name = "任务名称") @ApiModelProperty(value = "任务名称") private String taskName; @ApiModelProperty(value = "疾病病种") private String diagType; @ApiModelProperty(value = "医生编码") private String drcode; smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -126,6 +126,8 @@ public List<ServiceSubtask> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceSubtaskStatistic> getSpecialSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceSubtask> getSfStatisticsHyperlink(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<String> getSfStatisticsGroupKey(ServiceSubtaskCountReq serviceSubtaskCountReq); smartor/src/main/java/com/smartor/service/IServiceSubtaskService.java
@@ -141,6 +141,8 @@ public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); public List<ServiceSubtaskStatistic> getSpecialSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); //导出随访 public List<ServiceSubtaskStatistic> getSfStatisticsExport(ServiceSubtaskCountReq serviceSubtaskCountReq); smartor/src/main/java/com/smartor/service/impl/PatMedInhospServiceImpl.java
@@ -702,6 +702,7 @@ //说明该患者是被过滤的,不用再执行了 serviceSubtask.setCreateBy(serviceTask.getCreateBy()); serviceSubtask.setCreateTime(new Date()); serviceSubtask.setSendstate(4L); i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); } else { if (StringUtils.isEmpty(serviceSubtask.getPhone())) { @@ -848,6 +849,7 @@ //说明该患者是被过滤的,不用再执行了 serviceSubtask.setCreateBy(serviceTask.getCreateBy()); serviceSubtask.setCreateTime(new Date()); serviceSubtask.setSendstate(4L); i = serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); } else { if (StringUtils.isEmpty(serviceSubtask.getPhone())) { @@ -1204,7 +1206,7 @@ e.printStackTrace(); log.error("人员手术处理出异常了:{}", e.getMessage()); opItem.setOpercheckFlag("2"); opItem.setLongTaskReason("人员手术处理异常:" + e.getMessage()); opItem.setLongTaskReason("人员手术处理异常"); patMedOperationItemMapper.updatePatMedOperationItem(opItem); } } @@ -1295,7 +1297,7 @@ e.printStackTrace(); log.error("人员疾病处理出异常了:{}", e.getMessage()); pmiJB.setDiagcheckFlag("2"); pmiJB.setLongTaskReason("人员疾病处理异常:" + e.getMessage()); pmiJB.setLongTaskReason("人员疾病处理异常"); patMedInhospMapper.updatePatMedInhosp(pmiJB); } } @@ -1364,7 +1366,7 @@ e.printStackTrace(); log.error("人员病区处理出异常了:{}", e.getMessage()); pmiBQ1.setWardcheckFlag("2"); pmiBQ1.setLongTaskReason("人员病区处理异常:" + e.getMessage()); pmiBQ1.setLongTaskReason("人员病区处理异常"); patMedInhospMapper.updatePatMedInhosp(pmiBQ1); } } @@ -1424,7 +1426,7 @@ e.printStackTrace(); log.error("人员科室处理出异常了:{}", e.getMessage()); patMedInhosp1.setDeptcheckFlag("2"); patMedInhosp1.setLongTaskReason("人员科室处理异常:" + e.getMessage()); patMedInhosp1.setLongTaskReason("人员科室处理异常"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } } @@ -1629,7 +1631,7 @@ e.printStackTrace(); log.error("【基于规则】患者{}处理异常:{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setDeptcheckFlag("2"); patMedInhosp1.setLongTaskReason("基于规则处理异常:" + e.getMessage()); patMedInhosp1.setLongTaskReason("基于规则处理异常"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } } @@ -1669,7 +1671,7 @@ e.printStackTrace(); log.error("【科室任务】患者{}处理异常:{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setDeptcheckFlag("2"); patMedInhosp1.setLongTaskReason("科室任务处理异常:" + e.getMessage()); patMedInhosp1.setLongTaskReason("科室任务处理异常"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } return generatedCount; @@ -1717,7 +1719,7 @@ e.printStackTrace(); log.error("【病区任务】患者{}处理异常:{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setWardcheckFlag("2"); patMedInhosp1.setLongTaskReason("病区任务处理异常:" + e.getMessage()); patMedInhosp1.setLongTaskReason("病区任务处理异常"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } return generatedCount; @@ -1783,7 +1785,7 @@ e.printStackTrace(); log.error("【疾病任务】患者{}处理异常:{}", patMedInhosp1.getInhospid(), e.getMessage()); patMedInhosp1.setDiagcheckFlag("2"); patMedInhosp1.setLongTaskReason("疾病任务处理异常:" + e.getMessage()); patMedInhosp1.setLongTaskReason("疾病任务处理异常"); patMedInhospMapper.updatePatMedInhosp(patMedInhosp1); } return generatedCount; smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -329,18 +329,41 @@ } //获取该患者所有的执行状态 List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = serviceSubtaskPreachformLists.stream().filter((item -> item.getSubid().equals(serviceSubtask1.getId()) && item.getTaskid().equals(serviceTask.getTaskid()))).collect(Collectors.toList()); List<Map<String, Object>> resultList = serviceSubtaskPreachformList.stream().map(item -> { Map<String, Object> map = new HashMap<>(); map.put("sort", item.getSort()); map.put("preachform", item.getPreachform()); map.put("compensateTime", item.getCompensateTime()); return map; }).collect(Collectors.toList()); serviceTaskVO.setPreachformList(resultList); // List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = serviceSubtaskPreachformLists.stream().filter((item -> item.getSubid().equals(serviceSubtask1.getId()) && item.getTaskid().equals(serviceTask.getTaskid()))).collect(Collectors.toList()); // List<Map<String, Object>> resultList = serviceSubtaskPreachformList.stream().map(item -> { // Map<String, Object> map = new HashMap<>(); // map.put("sort", item.getSort()); // map.put("preachform", item.getPreachform()); // map.put("compensateTime", item.getCompensateTime()); // return map; // }).collect(Collectors.toList()); // serviceTaskVO.setPreachformList(resultList); // String result = resultList.stream().map(mapList1 -> mapList1.get("preachform")).map(String::valueOf).collect(Collectors.joining(",")); // serviceTaskVO.setPreachform(result); } if(StringUtils.isNotEmpty(serviceTaskVO.getPreachformDesc())){ //直接通过PreachformDesc生成List返回 try { List<Map<String, Object>> mapList = objectMapper.readValue(serviceTaskVO.getPreachformDesc(), List.class); serviceTaskVO.setPreachformList(mapList); }catch (Exception e) { } }else { if(CollectionUtils.isNotEmpty(list)){ //获取该患者所有的执行状态 List<ServiceSubtaskPreachform> serviceSubtaskPreachformList = serviceSubtaskPreachformLists.stream() .filter((item -> item.getSubid().equals(list.get(0).getId()) && item.getTaskid().equals(serviceTask.getTaskid()))).collect(Collectors.toList()); List<Map<String, Object>> resultList = serviceSubtaskPreachformList.stream().map(item -> { Map<String, Object> map = new HashMap<>(); map.put("sort", item.getSort()); map.put("preachform", item.getPreachform()); map.put("compensateTime", item.getCompensateTime()); return map; }).collect(Collectors.toList()); serviceTaskVO.setPreachformList(resultList); } } serviceTaskVO.setPatTaskRelevances(patTaskRelevances); return serviceTaskVO; @@ -493,6 +516,7 @@ if (patMedInhospList.size() > 0) { serviceSubtask1.setIsVisitAgain(2); serviceSubtask1.setRemark(StringUtils.isNotEmpty(serviceSubtask.getRemark()) ? serviceSubtask.getRemark() + ";患者再入院了" : "患者再入院了"); serviceSubtask1.setSendstate(4L); serviceSubtaskMapper.updateServiceSubtask(serviceSubtask1); return "无需再次随访,患者再入院了"; } else if (serviceSubtask1.getSendstate() == 4L) { @@ -754,8 +778,8 @@ serviceSubtask.setInhospid(patTaskRelevance.getHospid()); //新建完成就是待发送状态 serviceSubtask.setSendstate(2L); serviceSubtask.setDeptcode(patTaskRelevance.getDeptcode()); serviceSubtask.setDeptname(patTaskRelevance.getDeptName()); serviceSubtask.setDeptcode(StringUtils.isNotEmpty(patTaskRelevance.getDeptcode())?patTaskRelevance.getDeptcode():serviceTaskVO.getDeptcode()); serviceSubtask.setDeptname(StringUtils.isNotEmpty(patTaskRelevance.getDeptName())?patTaskRelevance.getDeptName():serviceTaskVO.getDeptname()); serviceSubtask.setLeavehospitaldistrictcode(patTaskRelevance.getLeavehospitaldistrictcode()); serviceSubtask.setLeavehospitaldistrictname(patTaskRelevance.getLeavehospitaldistrictname()); serviceSubtask.setType(serviceTaskVO.getType()); @@ -776,9 +800,13 @@ serviceSubtask.setContinueTimeNow(patTaskRelevance.getContinueTimeNow()); serviceSubtask.setCreateBy(serviceTask.getCreateBy()); serviceSubtask.setUpdateBy(serviceTask.getCreateBy()); serviceSubtask.setVisitTime(patTaskRelevance.getVisittime()); if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1) serviceSubtask.setVisitTime(DateUtils.parseDate(serviceTaskVO.getShowTimeMorn())); //如果立即执行,时间就是当前时间 if(serviceTaskVO.getSendType()!=null&&serviceTaskVO.getSendType()==2) serviceSubtask.setVisitTime(new Date()); if (serviceTaskVO.getLongTask() != null && serviceTaskVO.getLongTask() == 1) { serviceSubtask.setLongSendTime(patTaskRelevance.getLongSendTime()); serviceSubtask.setVisitTime(patTaskRelevance.getVisittime()); } serviceSubtaskMapper.insertServiceSubtask(serviceSubtask); serviceSubtask.getId().intValue(); @@ -929,8 +957,10 @@ if (StringUtils.isNotEmpty(serviceTaskVO.getIcd10code())) { String[] icd10codes = serviceTaskVO.getIcd10code().split(","); String[] icd10names = serviceTaskVO.getIcd10name().split(","); if (icd10codes.length != icd10names.length) { throw new BaseException("疾病编码和疾病名称数量不一致"); if(!active.equals("nhfy")&&!active.equals("druid")){ if (icd10codes.length != icd10names.length) { throw new BaseException("疾病编码和疾病名称数量不一致"); } } for (int i = 0; i < icd10codes.length; i++) { //先查询一下是否存在 @@ -2521,6 +2551,29 @@ } /** * 获取专病随访统计比例 * * @param serviceSubtaskCountReq * @return */ @Override // @Cacheable(value = "specialSfStatistics", key = "T(org.springframework.util.DigestUtils).md5DigestAsHex(#serviceSubtaskCountReq.toString().getBytes())", unless = "#result == null or #result.isEmpty()") public List<ServiceSubtaskStatistic> getSpecialSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq) { log.info("getSpecialSfStatistics的入参为:{}", serviceSubtaskCountReq); String groupKey = "drcode"; if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { groupKey = "drcode"; } else { groupKey = "task_name"; } List<ServiceSubtaskStatistic> serviceSubtaskStatistics = new ArrayList<>(); serviceSubtaskCountReq.setGroupKey(groupKey); serviceSubtaskStatistics = serviceSubtaskMapper.getSpecialSfStatistics(serviceSubtaskCountReq); return serviceSubtaskStatistics; } /** * 随访统计-及时率统计 * * @param serviceSubtaskCountReq @@ -2996,7 +3049,6 @@ } return serviceSubtaskStatistic; } /** * 首次随访统计 * smartor/src/main/resources/mapper/smartor/IvrLibaTemplateScriptMapper.xml
@@ -186,6 +186,7 @@ #{dimension} </foreach> </if> <if test="dimensionList == null ">and dimension IS NOT NULL </if> </where> </select> smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -121,6 +121,28 @@ <result property="options" column="options"/> </resultMap> <resultMap type="com.smartor.domain.ServiceSubtaskStatistic" id="ServiceSubtaskStatisticResult"> <result property="taskName" column="task_name"/> <result property="drcode" column="drcode"/> <result property="drname" column="drname"/> <result property="dischargeCount" column="discharge_count"/> <result property="nonFollowUp" column="non_follow_up"/> <result property="filterCount" column="filter_count"/> <result property="followUpNeeded" column="follow_up_needed"/> <result property="needFollowUp" column="need_follow_up"/> <result property="pendingFollowUp" column="pending_follow_up"/> <result property="followUpFail" column="follow_up_fail"/> <result property="manual" column="manual"/> <result property="voice" column="voice"/> <result property="sms" column="sms"/> <result property="weChat" column="we_chat"/> <result property="taskSituation1" column="task_situation1"/> <result property="taskSituation2" column="task_situation2"/> <result property="taskSituation3" column="task_situation3"/> <result property="taskSituation4" column="task_situation4"/> <result property="taskSituation5" column="task_situation5"/> <result property="taskSituation6" column="task_situation6"/> </resultMap> <sql id="selectServiceSubtaskVo"> select id, hosp_type, @@ -1485,6 +1507,123 @@ </foreach> </if> </select> <select id="getSpecialSfStatistics" parameterType="com.smartor.domain.ServiceSubtaskCountReq" resultMap="ServiceSubtaskStatisticResult"> select <if test="groupKey != null and groupKey == 'task_name'"> a.task_name, </if> <if test="groupKey != null and groupKey == 'drcode'"> b.drcode, b.drname, </if> COUNT(1) AS discharge_count, SUM(CASE WHEN b.sendstate = 4 THEN 1 ELSE 0 END) AS non_follow_up, SUM(CASE WHEN b.sendstate = 4 and b.task_situation = 6 THEN 1 ELSE 0 END) AS filter_count, SUM(CASE WHEN b.sendstate != 4 THEN 1 ELSE 0 END) AS follow_up_needed, SUM(CASE WHEN b.sendstate != 4 THEN 1 ELSE 0 END) AS need_follow_up, SUM(CASE WHEN b.sendstate = 2 THEN 1 ELSE 0 END) AS pending_follow_up, SUM(CASE WHEN b.sendstate = 5 or b.sendstate = 7 THEN 1 ELSE 0 END) AS follow_up_fail, SUM(CASE WHEN b.current_preachform = '1' THEN 1 ELSE 0 END) AS manual, SUM(CASE WHEN b.current_preachform = '3' THEN 1 ELSE 0 END) AS voice, SUM(CASE WHEN b.current_preachform = '4' THEN 1 ELSE 0 END) AS sms, SUM(CASE WHEN b.current_preachform = '5' THEN 1 ELSE 0 END) AS we_chat, SUM(CASE WHEN b.task_situation = 1 THEN 1 ELSE 0 END) AS task_situation1, SUM(CASE WHEN b.task_situation = 2 THEN 1 ELSE 0 END) AS task_situation2, SUM(CASE WHEN b.task_situation = 3 THEN 1 ELSE 0 END) AS task_situation3, SUM(CASE WHEN b.task_situation = 4 THEN 1 ELSE 0 END) AS task_situation4, SUM(CASE WHEN b.task_situation = 5 THEN 1 ELSE 0 END) AS task_situation5, SUM(CASE WHEN b.task_situation = 7 THEN 1 ELSE 0 END) AS task_situation7 from service_task a JOIN service_subtask b on a.taskid = b.taskid where 1=1 and a.del_flag = '0' and b.del_flag = '0' and a.appltype = '3' <if test="orgid != null and orgid != ''"> and a.orgid = #{orgid} </if> <if test="taskId != null"> and a.task_id = #{taskId} </if> <if test="taskName != null and taskName != ''"> and a.task_name like concat('%', #{taskName}, '%') </if> <if test="diagType != null and diagType != ''"> and a.diag_type = #{diagType} </if> <if test="taskIds != null and taskIds.size() > 0"> AND a.task_id IN <foreach collection="taskIds" item="taskIdItem" open="(" separator="," close=")"> #{taskIdItem} </foreach> </if> <if test="taskNames != null and taskNames.size() > 0"> AND a.task_name IN <foreach collection="taskNames" item="taskNameItem" open="(" separator="," close=")"> #{taskNameItem} </foreach> </if> <if test="diagTypes != null and diagTypes.size() > 0"> AND a.diag_type IN <foreach collection="diagTypes" item="diagTypeItem" open="(" separator="," close=")"> #{diagTypeItem} </foreach> </if> <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> AND b.leavehospitaldistrictcode IN <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> #{leavehospitaldistrictcode} </foreach> </if> <if test="deptcodes != null and deptcodes.size() > 0"> AND b.deptcode IN <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> #{deptcode} </foreach> </if> <if test="serviceType != null and serviceType.size() > 0"> AND b.service_type IN <foreach collection="serviceType" item="serviceType" open="(" separator="," close=")"> #{serviceType} </foreach> </if> <if test="startTime != null and endTime!=null"> AND b.visit_time >= DATE(#{startTime}) AND b.visit_time < DATE_ADD(DATE(#{endTime}), INTERVAL 1 DAY) </if> <if test="visitDeptCode != null">and b.visit_dept_code = #{visitDeptCode}</if> <if test="visitDeptName != null">and b.visit_dept_name = #{visitDeptName}</if> <if test="isabnormal != null">and b.isabnormal = #{isabnormal}</if> <if test="continueFlag != null ">and b.continue_flag = #{continueFlag}</if> <if test="continueTimeNow != null ">and b.continue_time_now = #{continueTimeNow,jdbcType=TIMESTAMP}</if> <if test="continueCount != null ">and b.continue_count = #{continueCount}</if> <if test="continueTimeNext != null ">and b.continue_time_next = #{continueTimeNext,jdbcType=TIMESTAMP}</if> <!-- 目前只统计语音和问卷 --> <if test="type != null"> and b.type = #{type} </if> <if test="visitCount != null and visitCount == 1"> AND b.visit_count = 1 </if> <if test="visitCount != null and visitCount > 1"> AND b.visit_count > 1 </if> <if test="groupKey != null and groupKey == 'task_name'"> GROUP BY a.task_name </if> <if test="groupKey != null and groupKey == 'drcode'"> GROUP BY b.drcode, b.drname </if> </select> <select id="getSfStatisticsGroupKey" parameterType="com.smartor.domain.ServiceSubtaskCountReq" resultType="String"> select @@ -2111,8 +2250,10 @@ SELECT deptname, count(1) AS rc FROM service_subtask WHERE DATE_FORMAT(finishtime, '%Y-%m-%d') >= #{startDate} AND DATE_FORMAT(finishtime, '%Y-%m-%d') <= #{endDate} WHERE DATE_FORMAT(visit_time, '%Y-%m-%d') >= #{startDate} AND DATE_FORMAT(visit_time, '%Y-%m-%d') <= #{endDate} AND service_type IN (2, 13) AND del_flag = '0' <if test="orgid != null"> AND orgid = #{orgid} </if> @@ -2154,6 +2295,7 @@ FROM service_subtask WHERE del_flag = '0' AND service_type IN (2, 13) <if test="startDate != null and endDate != null"> AND visit_time >= #{startDate} AND visit_time <= DATE_ADD(#{endDate}, INTERVAL 1 DAY) @@ -2215,7 +2357,6 @@ AND endtime >= #{startDate} AND endtime <= DATE_ADD(#{endDate}, INTERVAL 1 DAY) </if> AND inhospstate=1 <if test="orgid != null"> AND orgid = #{orgid} smartor/src/main/resources/mapper/smartor/SvyLibTemplateScriptMapper.xml
@@ -180,6 +180,7 @@ #{dimension} </foreach> </if> <if test="dimensionList == null ">and dimension IS NOT NULL </if> </where> </select>