| | |
| | | util.exportExcel(response, sfStatistics, "é访ç»è®¡å¯¼åº"); |
| | | } |
| | | |
| | | /** |
| | | * é访ç»è®¡å¯¼åº |
| | | */ |
| | | @ApiOperation("æå¡ç»è®¡æ¥è¯¢-ææ¶é´ç»´åº¦ç»è®¡åºé¢/é¨è¯éè®¿æ°æ®") |
| | | @PostMapping("/getServiceStatistics") |
| | | public AjaxResult getServiceStatistics(@RequestBody ServiceStatisticsRequest serviceStatisticsRequest) { |
| | | List<ServiceStatisticsResponse> serviceStatistics = serviceSubtaskService.getServiceStatistics(serviceStatisticsRequest); |
| | | return success(serviceStatistics); |
| | | } |
| | | |
| | | } |
| | |
| | | # password: Smartor.2023 |
| | | # driverClassName: com.mysql.cj.jdbc.Driver |
| | | |
| | | # å
¬å¸äº |
| | | url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: hxsoft |
| | | password: Hxerp2000 |
| | | # # å
¬å¸äº |
| | | # url: jdbc:mysql://116.62.18.175:6002/smartor_lisui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | # username: hxsoft |
| | | # password: Hxerp2000 |
| | | # driverClassName: com.mysql.cj.jdbc.Driver |
| | | # å
¬å¸æ¬å° |
| | | url: jdbc:mysql://192.168.100.10:3306/smartor_lishui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: smartor |
| | | password: Smartor.2023 |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | |
| | | # # 髿¯æ°æ®åºé
ç½® |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration> |
| | | <!-- æ¥å¿åæ¾è·¯å¾ 8095--> |
| | | <property name="log.path" value="E:/health/logs"/> |
| | | <property name="log.path" value="D:/health/logs"/> |
| | | <!-- æ¥å¿åæ¾è·¯å¾ 8096--> |
| | | <!-- <property name="log.path" value="D:/lihu/logs"/>--> |
| | | <!-- 丽水æ¥å¿åæ¾è·¯å¾ --> |
| | |
| | | @ApiModelProperty(value = "è系人信æ¯") |
| | | List<ExternalInHospPatientLiaisonInfo> externalInHospPatientLiaisonInfos; |
| | | |
| | | @ApiModelProperty(value = "ç»ç®¡å»çID") |
| | | private String JingGuanYSID; |
| | | |
| | | @ApiModelProperty(value = "ç»ç®¡å»çå§å") |
| | | private String JingGuanYSXM; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("è¯ä»¶å·ç ") |
| | | @Excel(name = " è¯ä»¶å·ç ") |
| | | private String idcardno; |
| | | |
| | | /** |
| | | * ç»ç®¡å»ç |
| | | */ |
| | | @ApiModelProperty("ç»ç®¡å»ç") |
| | | @Excel(name = " ç»ç®¡å»ç ") |
| | | private String managementDoctor; |
| | | |
| | | /** |
| | | * ç»ç®¡å»ç |
| | | */ |
| | | @ApiModelProperty("ç»ç®¡å»ç") |
| | | @Excel(name = " ç»ç®¡å»ç ") |
| | | private String managementDoctorCode; |
| | | } |
| | |
| | | */ |
| | | @ApiModelProperty(value = "ç»æå
¥é¢æ¥æ") |
| | | private Date endInHospTime; |
| | | |
| | | /** |
| | | * ç»ç®¡å»ç |
| | | */ |
| | | @ApiModelProperty("ç»ç®¡å»ç") |
| | | @Excel(name = " ç»ç®¡å»ç ") |
| | | private String managementDoctor; |
| | | |
| | | /** |
| | | * ç»ç®¡å»ç |
| | | */ |
| | | @ApiModelProperty("ç»ç®¡å»ç") |
| | | @Excel(name = " ç»ç®¡å»ç ") |
| | | private String managementDoctorCode; |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * æå¡ç»è®¡è¯·æ±åæ° |
| | | * |
| | | * @author smartor |
| | | * @date 2025-01-14 |
| | | */ |
| | | @ApiModel(value = "ServiceStatisticsRequest", description = "æå¡ç»è®¡è¯·æ±åæ°") |
| | | @Data |
| | | public class ServiceStatisticsRequest { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¥æ", required = true, example = "2025-08-01") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ", required = true, example = "2025-08-05") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "ç»è®¡ç»´åº¦ï¼day-æå¤©, month-ææ, year-æå¹´", example = "day") |
| | | private String timeType = "day"; |
| | | |
| | | @ApiModelProperty(value = "æºæIDï¼ä¸ºç©ºåæ¥è¯¢ææ") |
| | | private Long orgid; |
| | | |
| | | @ApiModelProperty(value = "ç§å®¤ç¼ç å表ï¼ä¸ºç©ºåæ¥è¯¢ææ") |
| | | private List<String> deptcodes; |
| | | |
| | | @ApiModelProperty(value = "ç
åºç¼ç å表ï¼ä¸ºç©ºåæ¥è¯¢ææ") |
| | | private List<String> leavehospitaldistrictcodes; |
| | | |
| | | @ApiModelProperty(value = "æå¡ç±»åå表ï¼ä¸ºç©ºåæ¥è¯¢ææ (2-åºé¢é访, 3-é¨è¯é访)") |
| | | private List<String> serviceTypes; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * æå¡ç»è®¡ååºç»æ |
| | | * |
| | | * @author smartor |
| | | * @date 2025-01-14 |
| | | */ |
| | | @ApiModel(value = "ServiceStatisticsResponse", description = "æå¡ç»è®¡ååºç»æ") |
| | | @Data |
| | | public class ServiceStatisticsResponse { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | @ApiModelProperty(value = "æ¶é´å¨æ") |
| | | @Excel(name = "æ¶é´å¨æ") |
| | | private String timePeriod; |
| | | |
| | | @ApiModelProperty(value = "åºé¢é访é") |
| | | @Excel(name = "åºé¢é访é") |
| | | private Long dischargeFollowCount = 0L; |
| | | |
| | | @ApiModelProperty(value = "é¨è¯é访é") |
| | | @Excel(name = "é¨è¯é访é") |
| | | private Long outpatientFollowCount = 0L; |
| | | |
| | | |
| | | @ApiModelProperty(value = "åºé¢äººæ¬¡") |
| | | @Excel(name = "åºé¢äººæ¬¡") |
| | | private Long pmiCount = 0L; |
| | | |
| | | @ApiModelProperty(value = "é¨è¯äººæ¬¡") |
| | | @Excel(name = "é¨è¯äººæ¬¡") |
| | | private Long pmoCount = 0L; |
| | | } |
| | |
| | | @Excel(name = "ps") |
| | | @ApiModelProperty(value = "ps") |
| | | private Integer ps; |
| | | |
| | | |
| | | /** |
| | | * æ£è
æ¥æº |
| | | */ |
| | | @ApiModelProperty(value = "ç»ç®¡å»çç¼ç ") |
| | | private String managementDoctorCode; |
| | | |
| | | /** |
| | | * æ£è
æ¥æº |
| | | */ |
| | | @ApiModelProperty(value = "ç»ç®¡å»ç") |
| | | private String managementDoctor; |
| | | } |
| | |
| | | private String patfrom; |
| | | |
| | | /** |
| | | * æ£è
æ¥æº |
| | | */ |
| | | @ApiModelProperty(value = "ç»ç®¡å»çç¼ç ") |
| | | private String managementDoctorCode; |
| | | |
| | | /** |
| | | * æ£è
æ¥æº |
| | | */ |
| | | @ApiModelProperty(value = "ç»ç®¡å»ç") |
| | | private String managementDoctor; |
| | | |
| | | /** |
| | | * å¼å§åºé¢æ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "å¼å§åºé¢æ¥æ") |
| | |
| | | |
| | | public List<PatMedRes> getDeptRanking(PatMedReq patMedReq); |
| | | |
| | | public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest serviceStatisticsRequest); |
| | | |
| | | } |
| | |
| | | * æ¥è¯¢æ£è
éè®¿ä¿¡æ¯ |
| | | */ |
| | | public List<ServiceSubtask> patItem(ServiceSubtaskVO serviceSubtaskVO); |
| | | |
| | | public List<ServiceSubtask> patItem2(ServiceSubtaskVO serviceSubtaskVO); |
| | | |
| | | public Map<String, Object> patItemCount(ServiceSubtaskVO serviceSubtaskVO); |
| | |
| | | public List<ServiceSubtaskCount> getSfFzInfoEveryMonth(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq); |
| | | |
| | | public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest request); |
| | | } |
| | |
| | | externalInHospPatientInfo.setZhuZhiYSID(externalInDeptPatientInfo.getZhuZhiYSID()); |
| | | externalInHospPatientInfo.setZhuZhiYSXM(externalInDeptPatientInfo.getZhuZhiYSXM()); |
| | | externalInHospPatientInfo.setRuYuanSJ(externalInDeptPatientInfo.getRuYuanSJ()); |
| | | externalInHospPatientInfo.setJingGuanYSID(externalInDeptPatientInfo.getJingGuanYSID()); |
| | | externalInHospPatientInfo.setJingGuanYSXM(externalInDeptPatientInfo.getJingGuanYSXM()); |
| | | externalInHospPatientInfo.setLianXiDH(ObjectUtils.isNotEmpty(BingRenXX.get("LianXiDH")) ? BingRenXX.get("LianXiDH").toString() : null); |
| | | externalInHospPatientInfo.setDangQianCWID(ObjectUtils.isNotEmpty(BingRenXX.get("DangQianCWID")) ? BingRenXX.get("DangQianCWID").toString() : null); |
| | | externalInHospPatientInfo.setDangQianCWMC(ObjectUtils.isNotEmpty(BingRenXX.get("DangQianCWMC")) ? BingRenXX.get("DangQianCWMC").toString() : null); |
| | |
| | | patMedOuthosp.setAdmitdate(externalJZInfo.getJiuZhenRQ()); |
| | | patMedOuthosp.setOrgid(FaSongJGID); |
| | | patMedOuthosp.setHospitalname(FaSongJGMC); |
| | | patMedOuthosp.setIdcardno(patArchive.getIdcardno()); |
| | | |
| | | //è¿ä¸ªéè¦çHISé£è¾¹åè¯ååªä¸ªå段ï¼ç°å¨è¿æ¯ä¸å¯¹ç |
| | | patMedOuthosp.setFudate(externalJZInfo.getSfrq()); |
| | |
| | | } |
| | | |
| | | //å
éè¿èº«ä»½è¯åç§å®¤æ¥è¯¢è¯¥æ£è
æ¯å¦æéè¦é访ç(æ¯å®æåºæ¥ç) |
| | | if (patMedOuthosp.getOrgid().equals("47255004333112711A1001")) { |
| | | if (patMedOuthosp.getOrgid().equals("47255004333112711A1001") && StringUtils.isNotEmpty(patMedOuthosp.getIdcardno()) && StringUtils.isNotEmpty(patMedOuthosp.getDeptcode())) { |
| | | ServiceSubtaskVO serviceSubtaskVO = new ServiceSubtaskVO(); |
| | | serviceSubtaskVO.setSfzh(patMedOuthosp.getIdcardno()); |
| | | serviceSubtaskVO.setDeptcode(patMedOuthosp.getDeptcode()); |
| | |
| | | for (ServiceSubtask serviceSubtask : serviceSubtaskList) { |
| | | serviceSubtask.setSendstate(6L); |
| | | serviceSubtask.setRemark("æ£è
å·²ç»åæ¥å¤è¯"); |
| | | serviceSubtask.setUpdateTime(new Date()); |
| | | serviceSubtaskMapper.updateServiceSubtask(serviceSubtask); |
| | | } |
| | | } |
| | |
| | | patMedInhosp.setDrcode(externalInHospPatientInfo.getZhuZhiYSID()); |
| | | patMedInhosp.setNurseId(externalInHospPatientInfo.getZeRenHSID()); |
| | | patMedInhosp.setNurseName(externalInHospPatientInfo.getZeRenHSXM()); |
| | | patMedInhosp.setManagementDoctor(externalInHospPatientInfo.getJingGuanYSXM()); |
| | | patMedInhosp.setManagementDoctorCode(externalInHospPatientInfo.getJingGuanYSID()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(externalInHospPatientDiagnoseInfo)) { |
| | | // patMedInhosp.setIcd10code(StringUtils.isNotEmpty(patMedInhosp.getIcd10code()) ? patMedInhosp.getIcd10code() + "," + externalInHospPatientDiagnoseInfo.getZhenDuanID() : externalInHospPatientDiagnoseInfo.getZhenDuanID()); |
| | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.data.redis.core.ListOperations; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.text.DecimalFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Duration; |
| | |
| | | //æä¸ä¸é¢ |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); |
| | | IvrTaskTemplateScriptVO nextQuestion = getNextQuestion(IvrTaskTemplateScriptVOs, nowQuestion); |
| | | // é®é¢ï¼ å»è°ç¨âttsåæåææ¾âæ¥å£ |
| | | // é®é¢ï¼ å»è°ç¨"ttsåæåææ¾"æ¥å£ |
| | | String date = simpleDateFormat1.format(new Date()); |
| | | log.info("å»è°ç¨ttsåæåææ¾æ¥å£: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); |
| | | phoneUtils.ttsPlayback(nowQuestion.getIvrtext(), phoneCallBackVO.getUuid()); |
| | |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES); |
| | | //è°ç¨ivrLibaTemplateScriptVOä¸çslienceText(éé»è¯æ¯) |
| | | String slienceText = nowQuestion.getSlienceText(); |
| | | //éé»è¯æ¯ + é®é¢ï¼ å»è°ç¨âttsåæåææ¾âæ¥å£ |
| | | //éé»è¯æ¯ + é®é¢ï¼ å»è°ç¨"ttsåæåææ¾"æ¥å£ |
| | | String date = simpleDateFormat1.format(new Date()); |
| | | log.info("éé»è¯æ¯ + é®é¢,å»è°ç¨ttsåæåææ¾æ¥å£: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); |
| | | phoneUtils.ttsPlayback(slienceText + nowQuestion.getIvrtext(), phoneCallBackVO.getUuid()); |
| | |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "returnQues", questionMessage, 120, TimeUnit.MINUTES); |
| | | redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES); |
| | | } |
| | | //è°ç¨â15ãttsåæåææ¾ï¼ tts_playbackâå°ç»æä¼ å |
| | | //è°ç¨"15ãttsåæåææ¾ï¼ tts_playback"å°ç»æä¼ å |
| | | String date = simpleDateFormat1.format(new Date()); |
| | | log.info("è°ç¨â15ãttsåæåææ¾------: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); |
| | | log.info("è°ç¨ttsåæåææ¾------: {},uuid为ï¼{}", date, phoneCallBackVO.getUuid()); |
| | | phoneUtils.ttsPlayback(nowQuestion.getIvrtext() + ivrTaskTemplateScriptVO.getSubmoduleText(), phoneCallBackVO.getUuid()); |
| | | } |
| | | break; |
| | |
| | | if ("AsrCallback".equals(phoneCallReqYQVO.getOperate()) && phoneCallReqYQVO.getEnd_time() != null && phoneCallReqYQVO.getEnd_time() != -1) { |
| | | //å¤çææ |
| | | if (phoneCallReqYQVO.getAsrtext().contains("æ¨å«çç¨æ·æ£å¿")) { |
| | | //夿 recordAccept-hungup æ¯å¦æå¼ï¼å¦ææï¼å说æä¸ç¨å¤çäºï¼ä¹åå·²ç»å¤çè¿äºï¼recordAccept-hungupè¿ä¸ªä¸»è¦æ¯ç»âéè¯è®°å½ç¨çï¼âï¼ |
| | | //夿 recordAccept-hungup æ¯å¦æå¼ï¼å¦ææï¼å说æä¸ç¨å¤çäºï¼ä¹åå·²ç»å¤çè¿äºï¼recordAccept-hungupè¿ä¸ªä¸»è¦æ¯ç»"éè¯è®°å½ç¨çï¼"ï¼ |
| | | Object cacheObject = redisCache.getCacheObject(phoneCallReqYQVO.getTaskid() + "recordAccept-hungup"); |
| | | if (ObjectUtils.isNotEmpty(cacheObject) && String.valueOf(cacheObject).equals("1")) { |
| | | return new PhoneCallBackYQVO(); |
| | |
| | | // //æä¸ä¸é¢ |
| | | // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", 0, 120, TimeUnit.MINUTES); |
| | | // IvrLibaTemplateScriptVO nextQuestion = getNextQuestion(ivrLibaTemplateScriptVOs, nowQuestion); |
| | | // // é®é¢ï¼ å»è°ç¨âttsåæåææ¾âæ¥å£ |
| | | // // é®é¢ï¼ å»è°ç¨"ttsåæåææ¾"æ¥å£ |
| | | // phoneUtils.ttsPlayback(nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); |
| | | // } |
| | | // } else { |
| | | // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "noVoice", noVoice + 1, 120, TimeUnit.MINUTES); |
| | | // //è°ç¨ivrLibaTemplateScriptVOä¸çslienceText(éé»è¯æ¯) |
| | | // String slienceText = nowQuestion.getSlienceText(); |
| | | // //éé»è¯æ¯ + é®é¢ï¼ å»è°ç¨âttsåæåææ¾âæ¥å£ |
| | | // //éé»è¯æ¯ + é®é¢ï¼ å»è°ç¨"ttsåæåææ¾"æ¥å£ |
| | | // phoneUtils.ttsPlayback(slienceText + nowQuestion.getQuestionText(), phoneCallBackVO.getUuid()); |
| | | // return new PhoneCallBackVO(); |
| | | // } |
| | |
| | | // redisCache.setCacheObject(phoneCallBackVO.getUuid() + "isOver", 1, 120, TimeUnit.MINUTES); |
| | | // } |
| | | // |
| | | // //è°ç¨â15ãttsåæåææ¾ï¼ tts_playbackâå°ç»æä¼ å |
| | | // //è°ç¨"15ãttsåæåææ¾ï¼ tts_playback"å°ç»æä¼ å |
| | | // |
| | | // |
| | | // } |
| | |
| | | } |
| | | |
| | | /** |
| | | * æå¡ç»è®¡æ¥è¯¢ - ææ¶é´ç»´åº¦ç»è®¡åºé¢/é¨è¯éè®¿æ°æ® |
| | | * |
| | | * @param request ç»è®¡è¯·æ±åæ° |
| | | * @return ç»è®¡ç»æå表 |
| | | */ |
| | | @Override |
| | | public List<ServiceStatisticsResponse> getServiceStatistics(ServiceStatisticsRequest request) { |
| | | log.info("getServiceStatisticsçå
¥å为ï¼{}", request); |
| | | |
| | | // åæ°æ ¡éª |
| | | if (request.getStartDate() == null || request.getEndDate() == null) { |
| | | throw new IllegalArgumentException("å¼å§æ¥æåç»ææ¥æä¸è½ä¸ºç©º"); |
| | | } |
| | | |
| | | if (request.getStartDate().after(request.getEndDate())) { |
| | | throw new IllegalArgumentException("å¼å§æ¥æä¸è½æäºç»ææ¥æ"); |
| | | } |
| | | |
| | | // 妿timeType为空ï¼é»è®¤æå¤©ç»è®¡ |
| | | if (StringUtils.isEmpty(request.getTimeType())) { |
| | | request.setTimeType("day"); |
| | | } |
| | | |
| | | List<ServiceStatisticsResponse> result = serviceSubtaskMapper.getServiceStatistics(request); |
| | | |
| | | |
| | | log.info("getServiceStatisticsè¿åç»ææ°éï¼{}", result.size()); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * è·åé访ç»è®¡æ¯ä¾ |
| | | * |
| | | * @param serviceSubtaskCountReq |
| | |
| | | <result property="futypedesc" column="futypedesc"/> |
| | | <result property="fuadvice" column="fuadvice"/> |
| | | <result property="fuspecialadvice" column="fuspecialadvice"/> |
| | | <result property="managementDoctor" column="management_doctor"/> |
| | | <result property="managementDoctorCode" column="management_doctor_code"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectPatMedInhospVo"> |
| | | select inhospid, |
| | | patname, |
| | | fuflag, |
| | | management_doctor, |
| | | management_doctor_code, |
| | | fudate, |
| | | fuperiod, |
| | | futypecode, |
| | |
| | | b.nurse_id, |
| | | b.nurse_name, |
| | | b.patname, |
| | | b.management_doctor, |
| | | b.management_doctor_code, |
| | | b.out_way_id, |
| | | b.out_way_name, |
| | | b.deptcheck_flag, |
| | |
| | | a.del_flag = 0 |
| | | AND b.del_flag = 0 |
| | | AND a.idcardno IS NOT NULL |
| | | <!--<if test="startOutHospTime != null"> |
| | | AND STR_TO_DATE(b.endtime,'%Y-%m-%d') >= STR_TO_DATE(#{startOutHospTime},'%Y-%m-%d') |
| | | </if> |
| | | <if test="endOutHospTime != null"> |
| | | AND STR_TO_DATE(b.endtime,'%Y-%m-%d') <= STR_TO_DATE(#{endOutHospTime},'%Y-%m-%d') |
| | | </if> |
| | | <if test="tagname != null and tagname != ''">and c.tagname like concat('%', #{tagname}, '%')</if> |
| | | |
| | | <if test="startInHospTime != null"> |
| | | AND STR_TO_DATE(b.starttime, '%Y-%m-%d') >= STR_TO_DATE(#{startInHospTime}, '%Y-%m-%d') |
| | | </if> |
| | | <if test="endInHospTime != null"> |
| | | AND STR_TO_DATE(b.starttime, '%Y-%m-%d') <= STR_TO_DATE(#{startInHospTime}, '%Y-%m-%d') |
| | | </if>--> |
| | | <if test="startOutHospTime != null ">and date_format(b.endtime,'%y%m%d') >= |
| | | date_format(#{startOutHospTime},'%y%m%d') |
| | | </if> |
| | |
| | | concat('%', #{hospitaldistrictname}, '%') |
| | | </if> |
| | | <if test="endtime != null ">and b.endtime = #{endtime}</if> |
| | | <if test="managementDoctor != null ">and b.management_doctor = #{managementDoctor}</if> |
| | | <if test="managementDoctorCode != null ">and b.management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="inhospno != null ">and b.inhospno = #{inhospno}</if> |
| | | <if test="fuflag != null ">and b.fuflag = #{fuflag}</if> |
| | | <if test="serialnum != null ">and b.serialnum = #{serialnum}</if> |
| | |
| | | select CONCAT( a.age, a.age_unit ) AS age, |
| | | a.telcode as telcode, |
| | | b.inhospid, |
| | | b.management_doctor, |
| | | b.management_doctor_code, |
| | | b.patname, |
| | | b.operator_id, |
| | | b.operator, |
| | |
| | | <if test="hospitalname != null and hospitalname != ''">and hospitalname like concat('%', #{hospitalname}, |
| | | '%') |
| | | </if> |
| | | <if test="managementDoctor != null ">and b.management_doctor = #{managementDoctor}</if> |
| | | <if test="managementDoctorCode != null ">and b.management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="patname != null and patname != ''">and patname like concat('%', #{patname}, '%')</if> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''">and hospitaldistrictname like |
| | | concat('%', #{hospitaldistrictname}, '%') |
| | |
| | | <include refid="selectPatMedInhospVo"/> |
| | | where inhospid = #{inhospid} |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <insert id="insertPatMedInhosp" parameterType="com.smartor.domain.PatMedInhosp" useGeneratedKeys="true" |
| | |
| | | <if test="futypedesc != null ">futypedesc,</if> |
| | | <if test="fuadvice != null ">fuadvice,</if> |
| | | <if test="fuspecialadvice != null ">fuspecialadvice,</if> |
| | | <if test="managementDoctor != null ">management_doctor,</if> |
| | | <if test="managementDoctorCode != null ">management_doctor_code,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="serialnum != null">#{serialnum},</if> |
| | |
| | | <if test="futypedesc != null ">#{futypedesc},</if> |
| | | <if test="fuadvice != null ">#{fuadvice},</if> |
| | | <if test="fuspecialadvice != null ">#{fuspecialadvice},</if> |
| | | <if test="managementDoctor != null ">#{managementDoctor},</if> |
| | | <if test="managementDoctorCode != null ">#{managementDoctorCode},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | |
| | | <insert id="insertPatMedInhospBatch" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="item.inhospid"> |
| | | <insert id="insertPatMedInhospBatch" parameterType="java.util.List" useGeneratedKeys="true" |
| | | keyProperty="item.inhospid"> |
| | | insert into pat_med_inhosp ( |
| | | serialnum, hospitalname, hospitalcode, hospitaldistrictcode, hospitaldistrictname, |
| | | icd10code, diagname, starttime, endtime, deptcode, deptname, roomno, bed_no, |
| | |
| | | deptcheck_flag, wardcheck_flag, diagcheck_flag, long_task_reason, |
| | | nurse_id, nurse_name, out_way_id, out_way_name, guid, |
| | | operator, operator_id, inhospno, remark, |
| | | fuflag, fudate, fuperiod, futypecode, futypedesc, fuadvice, fuspecialadvice |
| | | fuflag, fudate, fuperiod, futypecode, futypedesc, fuadvice, fuspecialadvice, management_doctor, management_doctor_doctor |
| | | ) |
| | | values |
| | | <foreach collection="list" item="item" separator=","> |
| | | ( |
| | | #{item.serialnum}, #{item.hospitalname}, #{item.hospitalcode}, #{item.hospitaldistrictcode}, #{item.hospitaldistrictname}, |
| | | #{item.icd10code}, #{item.diagname}, #{item.starttime}, #{item.endtime}, #{item.deptcode}, #{item.deptname}, #{item.roomno}, #{item.bedNo}, |
| | | #{item.orgid}, #{item.delFlag}, #{item.updateBy}, #{item.updateTime}, #{item.createBy}, #{item.createTime}, #{item.isupload}, |
| | | #{item.uploadTime}, #{item.patid}, #{item.leavediagname}, #{item.leaveicd10code}, #{item.drcode}, #{item.drname}, |
| | | #{item.schemestatus}, #{item.generalschemestatus}, #{item.leaveldeptcode}, #{item.leaveldeptname}, #{item.hospitaldistrictid}, |
| | | #{item.serialnum}, #{item.hospitalname}, #{item.hospitalcode}, #{item.hospitaldistrictcode}, |
| | | #{item.hospitaldistrictname}, |
| | | #{item.icd10code}, #{item.diagname}, #{item.starttime}, #{item.endtime}, #{item.deptcode}, #{item.deptname}, |
| | | #{item.roomno}, #{item.bedNo}, |
| | | #{item.orgid}, #{item.delFlag}, #{item.updateBy}, #{item.updateTime}, #{item.createBy}, #{item.createTime}, |
| | | #{item.isupload}, |
| | | #{item.uploadTime}, #{item.patid}, #{item.leavediagname}, #{item.leaveicd10code}, #{item.drcode}, |
| | | #{item.drname}, |
| | | #{item.schemestatus}, #{item.generalschemestatus}, #{item.leaveldeptcode}, #{item.leaveldeptname}, |
| | | #{item.hospitaldistrictid}, |
| | | #{item.leavehospitaldistrictcode}, #{item.leavehospitaldistrictname}, #{item.leavehospitaldistrictid}, |
| | | #{item.deptid}, #{item.leaveldeptid}, #{item.schemetime}, #{item.patname}, #{item.patno}, #{item.inhospstate}, |
| | | #{item.deptid}, #{item.leaveldeptid}, #{item.schemetime}, #{item.patname}, #{item.patno}, |
| | | #{item.inhospstate}, |
| | | #{item.deptcheckFlag}, #{item.wardcheckFlag}, #{item.diagcheckFlag}, #{item.longTaskReason}, |
| | | #{item.nurseId}, #{item.nurseName}, #{item.outWayId}, #{item.outWayName}, #{item.guid}, |
| | | #{item.operator}, #{item.operatorId}, #{item.inhospno}, #{item.remark}, |
| | | #{item.fuflag}, #{item.fudate}, #{item.fuperiod}, #{item.futypecode}, #{item.futypedesc}, #{item.fuadvice}, #{item.fuspecialadvice} |
| | | #{item.fuflag}, #{item.fudate}, #{item.fuperiod}, #{item.futypecode}, #{item.futypedesc}, #{item.fuadvice}, |
| | | #{item.fuspecialadvice}, #{item.managementDoctor}, #{item.managementDoctorCode} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | |
| | | <if test="futypedesc != null ">futypedesc = #{futypedesc},</if> |
| | | <if test="fuadvice != null ">fuadvice = #{fuadvice},</if> |
| | | <if test="fuspecialadvice != null ">fuspecialadvice = #{fuspecialadvice},</if> |
| | | <if test="managementDoctor != null ">management_doctor = #{managementDoctor},</if> |
| | | <if test="managementDoctorCode != null ">management_doctor_code = #{managementDoctorCode}</if> |
| | | |
| | | </trim> |
| | | where inhospid = #{inhospid} |
| | | </update> |
| | |
| | | <result property="visitTime" column="visit_time"/> |
| | | <result property="visitDeptName" column="visit_dept_name"/> |
| | | <result property="visitDeptCode" column="visit_dept_code"/> |
| | | <result property="managementDoctor" column="management_doctor"/> |
| | | <result property="managementDoctorCode" column="management_doctor_code"/> |
| | | </resultMap> |
| | | |
| | | <resultMap type="com.smartor.domain.ServiceSubtaskCount" id="ServiceSubtaskResult2"> |
| | |
| | | hosp_type, |
| | | task_guid, |
| | | patfrom, |
| | | management_doctor, |
| | | management_doctor_code, |
| | | upid, |
| | | visit_dept_name, |
| | | visit_dept_code, |
| | |
| | | <if test="leavediagname != null and leavediagname != ''">and leavediagname like concat('%', |
| | | #{leavediagname}, '%') |
| | | </if> |
| | | <if test="managementDoctor != null and managementDoctor != ''">and management_doctor like concat('%', |
| | | #{managementDoctor}, '%') |
| | | </if> |
| | | <if test="sex != null and sex != ''">and sex = #{sex}</if> |
| | | <if test="age != null ">and age = #{age}</if> |
| | | <if test="patguid != null ">and patguid = #{patguid}</if> |
| | | <if test="subId != null ">and id = #{subId}</if> |
| | | <if test="inhospid != null ">and inhospid = #{inhospid}</if> |
| | | <if test="managementDoctorCode != null ">and management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="submit != null ">and submit = #{submit}</if> |
| | | <if test="upid != null ">and upid = #{upid}</if> |
| | | <if test="patfrom != null ">and patfrom = #{patfrom}</if> |
| | |
| | | <if test="isVisitAgain != null ">and is_visit_again = #{isVisitAgain}</if> |
| | | <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> |
| | | <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="managementDoctor != null">and management_doctor = #{managementDoctor}</if> |
| | | </where> |
| | | |
| | | </select> |
| | |
| | | <if test="visitTime != null ">and visit_time = #{visitTime}</if> |
| | | <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> |
| | | <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> |
| | | <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if> |
| | | </where> |
| | | |
| | | </select> |
| | |
| | | <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''">and |
| | | leavehospitaldistrictname = #{leavehospitaldistrictname} |
| | | </if> |
| | | <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if> |
| | | ) a |
| | | </select> |
| | | |
| | |
| | | <if test="leavehospitaldistrictname != null and leavehospitaldistrictname != ''">and |
| | | leavehospitaldistrictname = #{leavehospitaldistrictname} |
| | | </if> |
| | | |
| | | <if test="managementDoctorCode != null">and management_doctor_code = #{managementDoctorCode}</if> |
| | | <if test="managementDoctor != null">and management_doctor like concat('%',#{managementDoctor}, '%')</if> |
| | | ) a where a.finished =1) |
| | | </where> |
| | | </select> |
| | |
| | | <if test="visitTime != null ">visit_Time,</if> |
| | | <if test="visitDeptCode != null">visit_dept_code,</if> |
| | | <if test="visitDeptName != null">visit_dept_name,</if> |
| | | <if test="managementDoctorCode != null">management_doctor_code,</if> |
| | | <if test="managementDoctor != null">management_doctor,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="sendname != null">#{sendname},</if> |
| | |
| | | <if test="visitTime != null ">#{visitTime},</if> |
| | | <if test="visitDeptCode != null">#{visitDeptCode},</if> |
| | | <if test="visitDeptName != null">#{visitDeptName},</if> |
| | | <if test="managementDoctorCode != null">#{managementDoctorCode},</if> |
| | | <if test="managementDoctor != null">#{managementDoctor},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="visitTime != null ">visit_time=#{visitTime},</if> |
| | | <if test="visitDeptCode != null">visit_dept_code = #{visitDeptCode},</if> |
| | | <if test="visitDeptName != null">visit_dept_name = #{visitDeptName},</if> |
| | | <if test="managementDoctorCode != null">management_doctor_code = #{managementDoctorCode},</if> |
| | | <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | |
| | | <if test="visitTime != null ">visit_time=#{visitTime},</if> |
| | | <if test="visitDeptCode != null">visit_dept_code = #{visitDeptCode},</if> |
| | | <if test="visitDeptName != null">visit_dept_name = #{visitDeptName},</if> |
| | | <if test="managementDoctorCode != null">management_doctor_code = #{managementDoctorCode},</if> |
| | | <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if> |
| | | </trim> |
| | | <where> |
| | | <if test="patid != null ">and patid = #{patid}</if> |
| | |
| | | <if test="visitTime != null ">visit_time=#{visitTime},</if> |
| | | <if test="visitDeptCode != null">visit_dept_code = #{visitDeptCode},</if> |
| | | <if test="visitDeptName != null">visit_dept_name = #{visitDeptName},</if> |
| | | <if test="managementDoctorCode != null">management_doctor_code = #{managementDoctorCode},</if> |
| | | <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if> |
| | | </trim> |
| | | where patid = #{patid} and taskid = #{taskid} |
| | | </update> |
| | |
| | | <if test="visitTime != null ">visit_time=#{visitTime},</if> |
| | | <if test="visitDeptCode != null">visit_dept_code = #{visitDeptCode},</if> |
| | | <if test="visitDeptName != null">visit_dept_name = #{visitDeptName},</if> |
| | | <if test="managementDoctorCode != null">management_doctor_code = #{managementDoctorCode},</if> |
| | | <if test="managementDoctor != null">management_doctor=#{managementDoctor},</if> |
| | | </trim> |
| | | where task_guid = #{taskGuid} and task_name = #{taskName} |
| | | </update> |
| | |
| | | patguid, |
| | | visitDeptCode, |
| | | visitDeptName, |
| | | management_doctor_code, |
| | | management_doctor, |
| | | leaveicd10code |
| | | FROM service_subtask, |
| | | JSON_TABLE(send_time_slot, '$[*]' COLUMNS ( |
| | |
| | | GROUP BY deptname |
| | | </select> |
| | | |
| | | <!-- æå¡ç»è®¡æ¥è¯¢ - ææ¶é´ç»´åº¦ç»è®¡åºé¢/é¨è¯éè®¿æ°æ® --> |
| | | <select id="getServiceStatistics" parameterType="com.smartor.domain.ServiceStatisticsRequest" |
| | | resultType="com.smartor.domain.ServiceStatisticsResponse"> |
| | | SELECT |
| | | timePeriod, |
| | | SUM(dischargeFollowCount) AS dischargeFollowCount, |
| | | SUM(outpatientFollowCount) AS outpatientFollowCount, |
| | | SUM(pmiCount) AS pmiCount, |
| | | SUM(pmoCount) AS pmoCount |
| | | FROM ( |
| | | -- éè®¿æ°æ® |
| | | SELECT |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | DATE_FORMAT(visit_time, '%Y-%m-%d') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | DATE_FORMAT(visit_time, '%Y-%m') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | DATE_FORMAT(visit_time, '%Y') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(visit_time), '-W', LPAD(WEEK(visit_time, 1), 2, '0')) AS timePeriod, |
| | | </when> |
| | | <otherwise> |
| | | DATE_FORMAT(visit_time, '%Y-%m-%d') AS timePeriod, |
| | | </otherwise> |
| | | </choose> |
| | | COUNT(CASE WHEN service_type = '2' THEN 1 END) AS dischargeFollowCount, |
| | | COUNT(CASE WHEN service_type = '3' THEN 1 END) AS outpatientFollowCount, |
| | | 0 AS pmiCount, |
| | | 0 AS pmoCount |
| | | FROM service_subtask |
| | | WHERE visit_time BETWEEN #{startDate} AND #{endDate} |
| | | AND del_flag = '0' |
| | | |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="districtcode" open="(" separator="," close=")"> |
| | | #{districtcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="serviceTypes != null and serviceTypes.size() > 0"> |
| | | AND service_type IN |
| | | <foreach collection="serviceTypes" item="serviceType" open="(" separator="," close=")"> |
| | | #{serviceType} |
| | | </foreach> |
| | | </if> |
| | | |
| | | GROUP BY |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | DATE_FORMAT(visit_time, '%Y-%m-%d') |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | DATE_FORMAT(visit_time, '%Y-%m') |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | DATE_FORMAT(visit_time, '%Y') |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(visit_time), '-W', LPAD(WEEK(visit_time, 1), 2, '0')) |
| | | </when> |
| | | <otherwise> |
| | | DATE_FORMAT(visit_time, '%Y-%m-%d') |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | UNION ALL |
| | | |
| | | -- åºé¢äººæ¬¡æ°æ® |
| | | SELECT |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | DATE_FORMAT(endtime, '%Y-%m-%d') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | DATE_FORMAT(endtime, '%Y-%m') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | DATE_FORMAT(endtime, '%Y') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(endtime), '-W', LPAD(WEEK(endtime, 1), 2, '0')) AS timePeriod, |
| | | </when> |
| | | <otherwise> |
| | | DATE_FORMAT(endtime, '%Y-%m-%d') AS timePeriod, |
| | | </otherwise> |
| | | </choose> |
| | | 0 AS dischargeFollowCount, |
| | | 0 AS outpatientFollowCount, |
| | | COUNT(DISTINCT patid) AS pmiCount, |
| | | 0 AS pmoCount |
| | | FROM pat_med_inhosp |
| | | WHERE endtime BETWEEN #{startDate} AND #{endDate} |
| | | AND del_flag = '0' |
| | | |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | |
| | | <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size() > 0"> |
| | | AND leavehospitaldistrictcode IN |
| | | <foreach collection="leavehospitaldistrictcodes" item="districtcode" open="(" separator="," close=")"> |
| | | #{districtcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND leaveldeptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | GROUP BY |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | DATE_FORMAT(endtime, '%Y-%m-%d') |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | DATE_FORMAT(endtime, '%Y-%m') |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | DATE_FORMAT(endtime, '%Y') |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(endtime), '-W', LPAD(WEEK(endtime, 1), 2, '0')) |
| | | </when> |
| | | <otherwise> |
| | | DATE_FORMAT(endtime, '%Y-%m-%d') |
| | | </otherwise> |
| | | </choose> |
| | | |
| | | UNION ALL |
| | | |
| | | -- é¨è¯äººæ¬¡æ°æ® |
| | | SELECT |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | DATE_FORMAT(admitdate, '%Y-%m-%d') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | DATE_FORMAT(admitdate, '%Y-%m') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | DATE_FORMAT(admitdate, '%Y') AS timePeriod, |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0')) AS timePeriod, |
| | | </when> |
| | | <otherwise> |
| | | DATE_FORMAT(admitdate, '%Y-%m-%d') AS timePeriod, |
| | | </otherwise> |
| | | </choose> |
| | | 0 AS dischargeFollowCount, |
| | | 0 AS outpatientFollowCount, |
| | | 0 AS pmiCount, |
| | | COUNT(DISTINCT patid) AS pmoCount |
| | | FROM pat_med_outhosp |
| | | WHERE admitdate BETWEEN #{startDate} AND #{endDate} |
| | | AND del_flag = '0' |
| | | |
| | | <if test="orgid != null"> |
| | | AND orgid = #{orgid} |
| | | </if> |
| | | |
| | | <if test="deptcodes != null and deptcodes.size() > 0"> |
| | | AND deptcode IN |
| | | <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> |
| | | #{deptcode} |
| | | </foreach> |
| | | </if> |
| | | |
| | | GROUP BY |
| | | <choose> |
| | | <when test="timeType == 'day'"> |
| | | DATE_FORMAT(admitdate, '%Y-%m-%d') |
| | | </when> |
| | | <when test="timeType == 'month'"> |
| | | DATE_FORMAT(admitdate, '%Y-%m') |
| | | </when> |
| | | <when test="timeType == 'year'"> |
| | | DATE_FORMAT(admitdate, '%Y') |
| | | </when> |
| | | <when test="timeType == 'week'"> |
| | | CONCAT(YEAR(admitdate), '-W', LPAD(WEEK(admitdate, 1), 2, '0')) |
| | | </when> |
| | | <otherwise> |
| | | DATE_FORMAT(admitdate, '%Y-%m-%d') |
| | | </otherwise> |
| | | </choose> |
| | | ) AS combined_data |
| | | GROUP BY timePeriod |
| | | ORDER BY timePeriod DESC |
| | | </select> |
| | | |
| | | </mapper> |