Commit d2281cf9956fabf2574fe65ac4afd26890179e81
Exists in
master
and in
1 other branch
Merge remote-tracking branch 'origin/master'
Showing 11 changed files
- platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExAddRequest.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntenatalExaminationResult.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexChuResult.java
- platform-reportData/src/main/java/com/lymsh/platform/reportdata/dao/StatisticsMapper.java
- platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/StatisticsService.java
- platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/impl/StatisticsServiceImpl.java
- platform-reportData/src/main/resources/reportOrm/StatisticsMapper.xml
- platform-reportData/src/test/sql.txt
platform-dal/src/main/java/com/lyms/platform/pojo/AntenatalExaminationModel.java
View file @
d2281cf
| ... | ... | @@ -85,7 +85,7 @@ |
| 85 | 85 | //产检日期 |
| 86 | 86 | private String checkDate; |
| 87 | 87 | //下次产检日期 |
| 88 | - private String nextCheckDate; | |
| 88 | + private String nextCheckTime; | |
| 89 | 89 | private Integer yn; |
| 90 | 90 | private Date created; |
| 91 | 91 | |
| 92 | 92 | |
| ... | ... | @@ -225,12 +225,12 @@ |
| 225 | 225 | this.id = id; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | - public String getNextCheckDate() { | |
| 229 | - return nextCheckDate; | |
| 228 | + public String getNextCheckTime() { | |
| 229 | + return nextCheckTime; | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | - public void setNextCheckDate(String nextCheckDate) { | |
| 233 | - this.nextCheckDate = nextCheckDate; | |
| 232 | + public void setNextCheckTime(String nextCheckTime) { | |
| 233 | + this.nextCheckTime = nextCheckTime; | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | public String getOtherRisk() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/StatisticsController.java
View file @
d2281cf
| ... | ... | @@ -74,7 +74,7 @@ |
| 74 | 74 | Map<String, Integer> mapsData = new HashMap<>(); |
| 75 | 75 | Map<String, String> riskColorMap = new HashMap<>(); |
| 76 | 76 | |
| 77 | - Option areaBarOption = buildBarOption("建档&高危人数", null); | |
| 77 | + Option areaBarOption = buildyBarOption("建档&高危人数", null); | |
| 78 | 78 | areaBarOption.getLegend().getData().add("近30天建档人数"); |
| 79 | 79 | areaBarOption.getLegend().getData().add("当前高危总人数"); |
| 80 | 80 | areaBarOption.getLegend().setOrient("horizontal"); |
| ... | ... | @@ -148,7 +148,7 @@ |
| 148 | 148 | |
| 149 | 149 | // 高危数据 |
| 150 | 150 | List<AreaData> currentRiskList = statisticsService.queryRisks(new AreaDataQuery()); |
| 151 | - Option groupRiskOption = buildBarOption("当前高危人数", null); | |
| 151 | + Option groupRiskOption = buildyBarOption("当前高危人数", null); | |
| 152 | 152 | groupRiskOption.getTooltip().setShow(true); |
| 153 | 153 | List<Object> groupRiskSeriesList = new ArrayList<>(); |
| 154 | 154 | Series groupRiskSeries = new Series(); |
| 155 | 155 | |
| ... | ... | @@ -240,9 +240,9 @@ |
| 240 | 240 | firstmap.put(month, areaData.getVal()); |
| 241 | 241 | } |
| 242 | 242 | if (secondmap.containsKey(month)) { |
| 243 | - secondmap.put(month, secondmap.get(month) + areaData.getVal()); | |
| 243 | + secondmap.put(month, secondmap.get(month) + areaData.getVal2()); | |
| 244 | 244 | } else { |
| 245 | - secondmap.put(month, areaData.getVal()); | |
| 245 | + secondmap.put(month, areaData.getVal2()); | |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | reportMonthMap.put("初诊人数", firstmap); |
| 249 | 249 | |
| ... | ... | @@ -250,7 +250,25 @@ |
| 250 | 250 | Option reportMonthOption = buildLineOption("初诊&复诊人数", null, reportMonthMap, buildDefaultMonth(12)); |
| 251 | 251 | |
| 252 | 252 | |
| 253 | + // 近6个月高危数据(按颜色分组) | |
| 254 | + Map<String, Map<String, Integer>> groupRiskMonthMap = new HashMap<>(); | |
| 255 | + for (AreaData areaData:riskMonthList) { | |
| 256 | + String groupName = areaData.getGroupName().replace("预警", ""); | |
| 257 | + Map<String, Integer> grmap = groupRiskMonthMap.get(groupName); | |
| 258 | + if (grmap == null) { | |
| 259 | + grmap = new HashMap<>(); | |
| 260 | + groupRiskMonthMap.put(groupName, grmap); | |
| 261 | + } | |
| 262 | + String month = buildMonth(areaData.getYear()); | |
| 263 | + if (grmap.containsKey(month)) { | |
| 264 | + grmap.put(month, grmap.get(month) + areaData.getVal()); | |
| 265 | + } else { | |
| 266 | + grmap.put(month, areaData.getVal()); | |
| 267 | + } | |
| 268 | + } | |
| 269 | + Option groupRiskMonthOption = buildxBarOption("高危历史人数", null, groupRiskMonthMap, buildDefaultMonth(6), colormap); | |
| 253 | 270 | |
| 271 | + | |
| 254 | 272 | result.put("type", 1); |
| 255 | 273 | result.put("kvData", kvData); |
| 256 | 274 | result.put("mapsOption", option); |
| ... | ... | @@ -258,6 +276,7 @@ |
| 258 | 276 | result.put("riskOption", groupRiskOption); |
| 259 | 277 | result.put("patientMonthOption", patientMonthOption); |
| 260 | 278 | result.put("reportMonthOption", reportMonthOption); |
| 279 | + result.put("groupRiskMonthOption", groupRiskMonthOption); | |
| 261 | 280 | ResultUtils.buildSuccessResultAndWrite(response, result); |
| 262 | 281 | } |
| 263 | 282 | |
| ... | ... | @@ -362,7 +381,7 @@ |
| 362 | 381 | return option; |
| 363 | 382 | } |
| 364 | 383 | |
| 365 | - private Option buildBarOption(String titleText, String subTitle) { | |
| 384 | + private Option buildyBarOption(String titleText, String subTitle) { | |
| 366 | 385 | Option option = new Option(); |
| 367 | 386 | Title title = new Title(); |
| 368 | 387 | title.setText(titleText); |
| ... | ... | @@ -397,6 +416,67 @@ |
| 397 | 416 | List<Object> dataList = new ArrayList<Object>(); |
| 398 | 417 | yAxis.setData(dataList); |
| 399 | 418 | option.setyAxis(yAxis); |
| 419 | + return option; | |
| 420 | + } | |
| 421 | + | |
| 422 | + private Option buildxBarOption(String titleText, String subTitle, Map<String, Map<String, Integer>> map, List<Object> xData, Map<String, String> colormap) { | |
| 423 | + Option option = new Option(); | |
| 424 | + Title title = new Title(); | |
| 425 | + title.setText(titleText); | |
| 426 | + title.setSubtext(subTitle); | |
| 427 | + option.setTitle(title); | |
| 428 | + Tooltip tooltip = new Tooltip(); | |
| 429 | + tooltip.setTrigger("axis"); | |
| 430 | + AxisPointer axisPointer = new AxisPointer(); | |
| 431 | + axisPointer.setType("shadow"); | |
| 432 | + tooltip.setAxisPointer(axisPointer); | |
| 433 | + option.setTooltip(tooltip); | |
| 434 | + Legend legend = new Legend(); | |
| 435 | + List<Object> tempList = new ArrayList<Object>(); | |
| 436 | + legend.setData(tempList); | |
| 437 | + option.setLegend(legend); | |
| 438 | + Grid grid = new Grid(); | |
| 439 | + grid.setContainLabel(true); | |
| 440 | + grid.setTop("55px"); | |
| 441 | + grid.setLeft("3%"); | |
| 442 | + grid.setRight("3%"); | |
| 443 | + grid.setBottom("3%"); | |
| 444 | + option.setGrid(grid); | |
| 445 | + AxisPointer xAxis = new AxisPointer(); | |
| 446 | + xAxis.setType("value"); | |
| 447 | + List<Object> gapList = new ArrayList<Object>(); | |
| 448 | + gapList.add(0); | |
| 449 | + gapList.add(0.1); | |
| 450 | + xAxis.setBoundaryGap(gapList); | |
| 451 | + option.setyAxis(xAxis); | |
| 452 | + List<Object> seriesList = new ArrayList<>(); | |
| 453 | + option.setSeries(seriesList); | |
| 454 | + for (String groupName:map.keySet()) { | |
| 455 | + tempList.add(groupName); | |
| 456 | + Map<String, Integer> sub = map.get(groupName); | |
| 457 | + Series series = new Series(); | |
| 458 | + series.setName(groupName); | |
| 459 | + series.setType("bar"); | |
| 460 | + List<Object> list = new ArrayList<>(); | |
| 461 | + series.setData(list); | |
| 462 | + for (Object o:xData) { | |
| 463 | + if (sub.get(o) == null) { | |
| 464 | + list.add(0); | |
| 465 | + } else if (colormap.containsKey(groupName)) { | |
| 466 | + Data data = new Data(); | |
| 467 | + data.setValue(sub.get(o)); | |
| 468 | + data.setItemStyle(new ItemStyle(new Normal(true,colormap.get(groupName)),null)); | |
| 469 | + list.add(data); | |
| 470 | + } else { | |
| 471 | + list.add(sub.get(o)); | |
| 472 | + } | |
| 473 | + } | |
| 474 | + seriesList.add(series); | |
| 475 | + } | |
| 476 | + AxisPointer yAxis = new AxisPointer(); | |
| 477 | + yAxis.setType("category"); | |
| 478 | + yAxis.setData(xData); | |
| 479 | + option.setxAxis(yAxis); | |
| 400 | 480 | return option; |
| 401 | 481 | } |
| 402 | 482 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AntenatalExaminationFacade.java
View file @
d2281cf
| ... | ... | @@ -115,13 +115,13 @@ |
| 115 | 115 | patientsQuery.setCardNo(exListQueryRequest.getCardNo()); |
| 116 | 116 | patientsQuery.setYn(YnEnums.YES.getId()); |
| 117 | 117 | patientsQuery.setPhone(exListQueryRequest.getPhone()); |
| 118 | - AntexListResult antexListResult=new AntexListResult(); | |
| 118 | + AntexListResult antexListResult = new AntexListResult(); | |
| 119 | 119 | //获取所有的建档记录 |
| 120 | 120 | List<Patients> list = patientsService.queryPatient(patientsQuery); |
| 121 | - List listDate = new ArrayList(); | |
| 121 | + List listDate = new ArrayList(); | |
| 122 | 122 | int i = 0; |
| 123 | 123 | if (CollectionUtils.isNotEmpty(list)) { |
| 124 | - antexListResult.convertToResult(null,list.get(0),null); | |
| 124 | + antexListResult.convertToResult(null, list.get(0), null); | |
| 125 | 125 | for (Patients patients : list) { |
| 126 | 126 | List<AntData> data = new ArrayList<>(); |
| 127 | 127 | MatDeliverQuery matDeliverQuery = new MatDeliverQuery(); |
| 128 | 128 | |
| ... | ... | @@ -173,12 +173,12 @@ |
| 173 | 173 | i++; |
| 174 | 174 | //分娩记录 |
| 175 | 175 | if (CollectionUtils.isNotEmpty(modelList)) { |
| 176 | - data.add(new AntData(modelList.get(0),patients.getLastMenses())); | |
| 176 | + data.add(new AntData(modelList.get(0), patients.getLastMenses())); | |
| 177 | 177 | } |
| 178 | 178 | //产后复查记录 |
| 179 | - List<PostReviewModel> reviewModels=postReviewService.findWithList(postReviewQuery); | |
| 180 | - if(CollectionUtils.isNotEmpty(reviewModels)){ | |
| 181 | - for(PostReviewModel postReviewModel:reviewModels){ | |
| 179 | + List<PostReviewModel> reviewModels = postReviewService.findWithList(postReviewQuery); | |
| 180 | + if (CollectionUtils.isNotEmpty(reviewModels)) { | |
| 181 | + for (PostReviewModel postReviewModel : reviewModels) { | |
| 182 | 182 | data.add(new AntData(postReviewModel)); |
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
| ... | ... | @@ -318,9 +318,14 @@ |
| 318 | 318 | antenatalExaminationResult.convertToResult(examinationModel); |
| 319 | 319 | try { |
| 320 | 320 | List list1 = JsonUtil.toList(examinationModel.getRiskFactor(), List.class); |
| 321 | - antenatalExaminationResult.setRiskFactor(list1); | |
| 321 | + antenatalExaminationResult.setRiskFactor(queryRisk(list1)); | |
| 322 | 322 | } catch (Exception e) { |
| 323 | 323 | } |
| 324 | + try { | |
| 325 | + List list = JsonUtil.toList(examinationModel.getDiagnosis(), List.class); | |
| 326 | + antenatalExaminationResult.setDiagnosis(queryRisk(list)); | |
| 327 | + } catch (Exception e) { | |
| 328 | + } | |
| 324 | 329 | object = antenatalExaminationResult; |
| 325 | 330 | } else { |
| 326 | 331 | //查询初诊数据 |
| 327 | 332 | |
| ... | ... | @@ -334,10 +339,42 @@ |
| 334 | 339 | antExChuModel = antExChuModels.get(0); |
| 335 | 340 | } |
| 336 | 341 | antexChuResult.convertToResult(antExChuModel); |
| 342 | + try { | |
| 343 | + List list = JsonUtil.toList(antExChuModel.getDiagnosis(), List.class); | |
| 344 | + antexChuResult.setDiagnosis(queryRisk(list)); | |
| 345 | + } catch (Exception e) { | |
| 346 | + } | |
| 347 | + try { | |
| 348 | + List list1 = JsonUtil.toList(antExChuModel.getHighrisk(), List.class); | |
| 349 | + antexChuResult.setHighrisk(queryRisk(list1)); | |
| 350 | + } catch (Exception e) { | |
| 351 | + | |
| 352 | + } | |
| 337 | 353 | object = antexChuResult; |
| 338 | 354 | } |
| 339 | 355 | |
| 340 | 356 | return new BaseObjectResponse().setData(object).setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 357 | + } | |
| 358 | + | |
| 359 | + private List queryRisk(List<String> id) { | |
| 360 | + BasicConfigQuery | |
| 361 | + basicConfigQuery = new BasicConfigQuery(); | |
| 362 | + List data = new ArrayList(); | |
| 363 | + if (CollectionUtils.isNotEmpty(id)) { | |
| 364 | + for (String i : id) { | |
| 365 | + basicConfigQuery.setId(i); | |
| 366 | + List<BasicConfig> basicConfigs = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 367 | + if (CollectionUtils.isNotEmpty(basicConfigs)) { | |
| 368 | + for (BasicConfig basicConfig : basicConfigs) { | |
| 369 | + Map<String, Object> map = new HashMap<>(); | |
| 370 | + map.put("id", basicConfig.getId()); | |
| 371 | + map.put("name", basicConfig.getName()); | |
| 372 | + data.add(map); | |
| 373 | + } | |
| 374 | + } | |
| 375 | + } | |
| 376 | + } | |
| 377 | + return data; | |
| 341 | 378 | } |
| 342 | 379 | |
| 343 | 380 | public BaseResponse getEnums() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/request/AntExAddRequest.java
View file @
d2281cf
| ... | ... | @@ -69,7 +69,7 @@ |
| 69 | 69 | //产检日期 |
| 70 | 70 | private String checkDate; |
| 71 | 71 | //下次产检日期 |
| 72 | - private String nextCheckDate; | |
| 72 | + private String nextCheckTime; | |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | |
| ... | ... | @@ -109,7 +109,7 @@ |
| 109 | 109 | examinationModel.setGuide(guide); |
| 110 | 110 | examinationModel.setCheckDoctor(checkDoctor); |
| 111 | 111 | examinationModel.setCheckDate(checkDate); |
| 112 | - examinationModel.setNextCheckDate(nextCheckDate); | |
| 112 | + examinationModel.setNextCheckTime(nextCheckTime); | |
| 113 | 113 | |
| 114 | 114 | return examinationModel; |
| 115 | 115 | } |
| 116 | 116 | |
| ... | ... | @@ -226,12 +226,12 @@ |
| 226 | 226 | this.id = id; |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | - public String getNextCheckDate() { | |
| 230 | - return nextCheckDate; | |
| 229 | + public String getNextCheckTime() { | |
| 230 | + return nextCheckTime; | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - public void setNextCheckDate(String nextCheckDate) { | |
| 234 | - this.nextCheckDate = nextCheckDate; | |
| 233 | + public void setNextCheckTime(String nextCheckTime) { | |
| 234 | + this.nextCheckTime = nextCheckTime; | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | public Map getOtherRisk() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntenatalExaminationResult.java
View file @
d2281cf
| ... | ... | @@ -54,7 +54,7 @@ |
| 54 | 54 | //其他高危 |
| 55 | 55 | private Map otherRisk; |
| 56 | 56 | //诊断 |
| 57 | - private String diagnosis; | |
| 57 | + private List diagnosis; | |
| 58 | 58 | //分类 |
| 59 | 59 | private String type; |
| 60 | 60 | //异常 |
| ... | ... | @@ -72,7 +72,6 @@ |
| 72 | 72 | |
| 73 | 73 | @Override |
| 74 | 74 | public AntenatalExaminationResult convertToResult(AntenatalExaminationModel destModel) { |
| 75 | - setDiagnosis(destModel.getDiagnosis()); | |
| 76 | 75 | setEdema(destModel.getEdema()); |
| 77 | 76 | setParentId(destModel.getParentId()); |
| 78 | 77 | setNextCheckDate(destModel.getNextCheckDate()); |
| 79 | 78 | |
| ... | ... | @@ -179,11 +178,11 @@ |
| 179 | 178 | this.currentDueDate = currentDueDate; |
| 180 | 179 | } |
| 181 | 180 | |
| 182 | - public String getDiagnosis() { | |
| 181 | + public List getDiagnosis() { | |
| 183 | 182 | return diagnosis; |
| 184 | 183 | } |
| 185 | 184 | |
| 186 | - public void setDiagnosis(String diagnosis) { | |
| 185 | + public void setDiagnosis(List diagnosis) { | |
| 187 | 186 | this.diagnosis = diagnosis; |
| 188 | 187 | } |
| 189 | 188 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/AntexChuResult.java
View file @
d2281cf
| ... | ... | @@ -123,7 +123,7 @@ |
| 123 | 123 | // 其他高危 |
| 124 | 124 | private Map otherHighRisk; |
| 125 | 125 | // 诊断 |
| 126 | - private String diagnosis; | |
| 126 | + private List diagnosis; | |
| 127 | 127 | //处理意见 |
| 128 | 128 | private String treatOpinion; |
| 129 | 129 | //指导意见 |
| 130 | 130 | |
| ... | ... | @@ -346,12 +346,11 @@ |
| 346 | 346 | this.chgOther = chgOther; |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | - | |
| 350 | - public String getDiagnosis() { | |
| 349 | + public List getDiagnosis() { | |
| 351 | 350 | return diagnosis; |
| 352 | 351 | } |
| 353 | 352 | |
| 354 | - public void setDiagnosis(String diagnosis) { | |
| 353 | + public void setDiagnosis(List diagnosis) { | |
| 355 | 354 | this.diagnosis = diagnosis; |
| 356 | 355 | } |
| 357 | 356 | |
| ... | ... | @@ -869,7 +868,7 @@ |
| 869 | 868 | setPlacentas(antExChuModel.getPlacentas()); |
| 870 | 869 | setHighriskSocre(antExChuModel.getHighriskSocre()); |
| 871 | 870 | setOtherHighRisk(JsonUtil.str2Obj(antExChuModel.getOtherHighRisk(), Map.class)); |
| 872 | - setDiagnosis(antExChuModel.getDiagnosis()); | |
| 871 | +// setDiagnosis(antExChuModel.getDiagnosis()); | |
| 873 | 872 | setTreatOpinion(antExChuModel.getTreatOpinion()); |
| 874 | 873 | setDirOpinion(antExChuModel.getDirOpinion()); |
| 875 | 874 | setProdDoctor(antExChuModel.getProdDoctor()); |
platform-reportData/src/main/java/com/lymsh/platform/reportdata/dao/StatisticsMapper.java
View file @
d2281cf
platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/StatisticsService.java
View file @
d2281cf
platform-reportData/src/main/java/com/lymsh/platform/reportdata/service/impl/StatisticsServiceImpl.java
View file @
d2281cf
| ... | ... | @@ -87,5 +87,10 @@ |
| 87 | 87 | public List<AreaData> queryHrefYearRisks(AreaDataQuery query) { |
| 88 | 88 | return statisticsMapper.queryHrefYearRisks(query); |
| 89 | 89 | } |
| 90 | + | |
| 91 | + @Override | |
| 92 | + public List<AreaData> queryDaysRisks(AreaDataQuery query) { | |
| 93 | + return statisticsMapper.queryDaysRisks(query); | |
| 94 | + } | |
| 90 | 95 | } |
platform-reportData/src/main/resources/reportOrm/StatisticsMapper.xml
View file @
d2281cf
| ... | ... | @@ -574,5 +574,64 @@ |
| 574 | 574 | ORDER BY F.HIGH_RISK_GROUP,E.YEAR_MONTH |
| 575 | 575 | </select> |
| 576 | 576 | |
| 577 | + <!--6.1. 按省或市或地区查询区域内近30天每天产检中历史高危人数(按颜色分组)--> | |
| 578 | + <select id="queryDaysRisks" resultMap="AreaDataResultMap" | |
| 579 | + parameterType="com.lymsh.platform.reportdata.model.AreaDataQuery"> | |
| 580 | + SELECT D.PROVINCE_ID as province_id, | |
| 581 | + D.PROVINCE as province_name, | |
| 582 | + <if test="provinceId != null and provinceId != ''"> | |
| 583 | + D.CITY_ID as city_id, | |
| 584 | + D.CITY as city_name, | |
| 585 | + </if> | |
| 586 | + <if test="cityId != null and cityId != ''"> | |
| 587 | + D.CITY_ID as city_id, | |
| 588 | + D.CITY as city_name, | |
| 589 | + D.AREA_COUNTY_ID as area_id, | |
| 590 | + D.AREA_COUNTY as area_name, | |
| 591 | + </if> | |
| 592 | + F.HIGH_RISK_GROUP as group_name, | |
| 593 | + E.DATE_2 as year, | |
| 594 | + COUNT(A.RECORD_ID) AS val | |
| 595 | + FROM ODS_F_GRAVIDA_RECORD A, | |
| 596 | + ODS_F_EXAMINE_HISTORY B, | |
| 597 | + ODS_D_HOSPITAL C, | |
| 598 | + ODS_D_AREA_COUNTY D, | |
| 599 | + ODS_D_DIM_DATE E, | |
| 600 | + ODS_F_HIGH_RISK_VALUE F | |
| 601 | + WHERE A.RECORD_ID=B.RECORD_ID | |
| 602 | + AND A.HOSPITAL_NO=C.HOSPITAL_NO | |
| 603 | + AND C.AREA_COUNTY_ID=D.AREA_COUNTY_ID | |
| 604 | + AND B.INSERT_DATE=E.DATE_1 | |
| 605 | + AND B.EXAMINE_ID=F.EXAMINE_ID | |
| 606 | + <![CDATA[ | |
| 607 | + AND F.HIGH_RISK_CONTENT<>'健康' | |
| 608 | + AND F.HIGH_RISK_GROUP<>'其他' | |
| 609 | + AND B.EXAMINE_HISTORY_NUM=1 | |
| 610 | + AND B.INSERT_DATE<=TRUNC(SYSDATE) | |
| 611 | + AND B.INSERT_DATE>=(TRUNC(SYSDATE)-${days}) | |
| 612 | + ]]> | |
| 613 | + <if test="provinceId != null and provinceId != ''"> | |
| 614 | + AND D.PROVINCE_ID=#{provinceId} | |
| 615 | + </if> | |
| 616 | + <if test="cityId != null and cityId != ''"> | |
| 617 | + AND D.CITY_ID=#{cityId} | |
| 618 | + </if> | |
| 619 | + GROUP BY D.PROVINCE_ID, | |
| 620 | + D.PROVINCE, | |
| 621 | + <if test="provinceId != null and provinceId != ''"> | |
| 622 | + D.CITY_ID, | |
| 623 | + D.CITY, | |
| 624 | + </if> | |
| 625 | + <if test="cityId != null and cityId != ''"> | |
| 626 | + D.CITY_ID, | |
| 627 | + D.CITY, | |
| 628 | + D.AREA_COUNTY_ID, | |
| 629 | + D.AREA_COUNTY, | |
| 630 | + </if> | |
| 631 | + F.HIGH_RISK_GROUP, | |
| 632 | + E.DATE_2 | |
| 633 | + ORDER BY F.HIGH_RISK_GROUP,E.DATE_2; | |
| 634 | + </select> | |
| 635 | + | |
| 577 | 636 | </mapper> |
platform-reportData/src/test/sql.txt
View file @
d2281cf
| ... | ... | @@ -508,4 +508,44 @@ |
| 508 | 508 | F.HIGH_RISK_GROUP, |
| 509 | 509 | E.YEAR_MONTH |
| 510 | 510 | ORDER BY F.HIGH_RISK_GROUP,E.YEAR_MONTH |
| 511 | + | |
| 512 | +------------------------------------------------------- | |
| 513 | +6.1. 按省或市或地区查询区域内近30天每天产检中历史高危人数(按颜色分组) | |
| 514 | +SELECT D.PROVINCE_ID as province_id, | |
| 515 | + D.PROVINCE as province_name, | |
| 516 | + D.CITY_ID as city_id, | |
| 517 | + D.CITY as city_name, | |
| 518 | + D.AREA_COUNTY_ID as area_id, | |
| 519 | + D.AREA_COUNTY as area_name, | |
| 520 | + F.HIGH_RISK_GROUP as group_name, | |
| 521 | + E.DATE_2 as year, | |
| 522 | + COUNT(A.RECORD_ID) AS val | |
| 523 | +FROM ODS_F_GRAVIDA_RECORD A, | |
| 524 | + ODS_F_EXAMINE_HISTORY B, | |
| 525 | + ODS_D_HOSPITAL C, | |
| 526 | + ODS_D_AREA_COUNTY D, | |
| 527 | + ODS_D_DIM_DATE E, | |
| 528 | + ODS_F_HIGH_RISK_VALUE F | |
| 529 | +WHERE A.RECORD_ID=B.RECORD_ID | |
| 530 | + AND A.HOSPITAL_NO=C.HOSPITAL_NO | |
| 531 | + AND C.AREA_COUNTY_ID=D.AREA_COUNTY_ID | |
| 532 | + AND B.INSERT_DATE=E.DATE_1 | |
| 533 | + AND B.EXAMINE_ID=F.EXAMINE_ID | |
| 534 | + AND F.HIGH_RISK_CONTENT<>'健康' | |
| 535 | + AND F.HIGH_RISK_GROUP<>'其他' | |
| 536 | + AND B.EXAMINE_HISTORY_NUM=1 | |
| 537 | + AND B.INSERT_DATE<=TRUNC(SYSDATE) | |
| 538 | + AND B.INSERT_DATE>=(TRUNC(SYSDATE)-30) | |
| 539 | + AND D.PROVINCE_ID=130000 | |
| 540 | + AND D.CITY_ID=130300 | |
| 541 | + AND D.AREA_COUNTY_ID=130302 | |
| 542 | +GROUP BY D.PROVINCE_ID, | |
| 543 | + D.PROVINCE, | |
| 544 | + D.CITY_ID, | |
| 545 | + D.CITY, | |
| 546 | + D.AREA_COUNTY_ID, | |
| 547 | + D.AREA_COUNTY, | |
| 548 | + F.HIGH_RISK_GROUP, | |
| 549 | + E.DATE_2 | |
| 550 | +ORDER BY F.HIGH_RISK_GROUP,E.DATE_2; |