Commit 16f73d8c17047c3ab8111edd9d0b19aea53680f9

Authored by shiyang
1 parent 676ba343c2

滦平孕产、儿童,贫血增加无贫血统计

Showing 4 changed files with 73 additions and 48 deletions

platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java View file @ 16f73d8
... ... @@ -63,16 +63,7 @@
63 63 private String lpXhdbStart;
64 64 private String lpXhdbEnd;
65 65  
66   - private String xhdbXiao;
67 66  
68   - public String getXhdbXiao() {
69   - return xhdbXiao;
70   - }
71   -
72   - public void setXhdbXiao(String xhdbXiao) {
73   - this.xhdbXiao = xhdbXiao;
74   - }
75   -
76 67 public String getXhdb() {
77 68 return xhdb;
78 69 }
79 70  
80 71  
81 72  
82 73  
83 74  
84 75  
... ... @@ -421,32 +412,37 @@
421 412 MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE);
422 413 condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2});
423 414 }
424   - if (null != lpXhdbStart&&null!=lpXhdbEnd) {
  415 +
  416 + Criteria c2=MongoCondition.newInstance().getCriteria();
  417 + if(StringUtils.isNotEmpty(lpXhdbStart)){//大于等于
425 418 //字符串判断大小
426 419 String formatXhdb = String.format("function() {\n" +
427   - " return this.xhdb >= %s &&this.xhdb <= %s \n" +
428   - " }",lpXhdbStart,lpXhdbEnd);
429   - if (null != c) {
430   - c.and("$where").is(formatXhdb).and("xhdb").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据
431   - } else {
432   - c = Criteria.where("$where").is(formatXhdb).and("xhdb").ne("");
  420 + " return this.xhdb >= %s \n" +
  421 + " }",lpXhdbStart);
  422 + if(null != c2){
  423 + c2 = c2.and("$where").is(formatXhdb).and("xhdb").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据
  424 + }else{
  425 + c2 = Criteria.where("$where").is(formatXhdb).and("xhdb").ne("");
433 426 }
434 427 }
435   - if(StringUtils.isNotEmpty(xhdbXiao)){
  428 +
  429 + Criteria c3=MongoCondition.newInstance().getCriteria();
  430 + if(StringUtils.isNotEmpty(lpXhdbEnd)){//小于等于
  431 + //字符串判断大小
436 432 String formatXhdb = String.format("function() {\n" +
437   - " return this.xhdb < %s \n" +
438   - " }",xhdbXiao);
439   - if(null != c){
440   - c = c.and("$where").is(formatXhdb).and("xhdb").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据
  433 + " return this.xhdb <= %s \n" +
  434 + " }",lpXhdbEnd);
  435 + if(null != c3){
  436 + c3 = c3.and("$where").is(formatXhdb).and("xhdb").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据
441 437 }else{
442   - c = Criteria.where("$where").is(formatXhdb).and("xhdb").ne("");
  438 + c3 = Criteria.where("$where").is(formatXhdb).and("xhdb").ne("");
443 439 }
444 440 }
445 441  
446   - if (null != c) {
447   - condition = condition.andCondition(new MongoCondition(c));
  442 + if (c != null) {
  443 + return new MongoCondition(c.andOperator(condition.getCriteria(),c2,c3)).toMongoQuery();
448 444 }
449   - return condition.toMongoQuery();
  445 + return new MongoCondition(c2.andOperator(condition.getCriteria(),c3)).toMongoQuery();
450 446 }
451 447  
452 448 public String getOtherHighRisk() {
platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java View file @ 16f73d8
... ... @@ -260,24 +260,35 @@
260 260 c = Criteria.where("modified").gte(modifiedStart).lte(modifiedEnd);
261 261 }
262 262 }
263   -
264   - if(StringUtils.isNotEmpty(hemoglobinStart) && StringUtils.isNotEmpty(hemoglobinEnd)){
  263 + Criteria c2=MongoCondition.newInstance().getCriteria();
  264 + if(StringUtils.isNotEmpty(hemoglobinStart)){//大于等于
265 265 //字符串判断大小
266 266 String formatXhdb = String.format("function() {\n" +
267   - " return this.hemoglobin >= %s &&this.hemoglobin <= %s \n" +
268   - " }",hemoglobinStart,hemoglobinEnd);
269   - if(null != c){
270   - c = c.and("$where").is(formatXhdb).and("hemoglobin").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据
  267 + " return this.hemoglobin >= %s \n" +
  268 + " }",hemoglobinStart);
  269 + if(null != c2){
  270 + c2 = c2.and("$where").is(formatXhdb).and("hemoglobin").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据
271 271 }else{
272   - c = Criteria.where("$where").is(formatXhdb).and("hemoglobin").ne("");
  272 + c2 = Criteria.where("$where").is(formatXhdb).and("hemoglobin").ne("");
273 273 }
274 274 }
275 275  
  276 + Criteria c3=MongoCondition.newInstance().getCriteria();
  277 + if(StringUtils.isNotEmpty(hemoglobinEnd)){//小于等于
  278 + //字符串判断大小
  279 + String formatXhdb = String.format("function() {\n" +
  280 + " return this.hemoglobin <= %s \n" +
  281 + " }",hemoglobinEnd);
  282 + if(null != c3){
  283 + c3 = c3.and("$where").is(formatXhdb).and("hemoglobin").ne("");//加ne:该字段在mongo中是”“ ,如果表达式有>=0也可查出。可以避免空数据
  284 + }else{
  285 + c3 = Criteria.where("$where").is(formatXhdb).and("hemoglobin").ne("");
  286 + }
  287 + }
276 288 if (c != null) {
277   - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
  289 + return new MongoCondition(c.andOperator(condition.getCriteria(),c2,c3)).toMongoQuery();
278 290 }
279   -
280   - return condition.toMongoQuery();
  291 + return new MongoCondition(c2.andOperator(condition.getCriteria(),c3)).toMongoQuery();
281 292 }
282 293  
283 294 public Integer getCheckMonthStart() {
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java View file @ 16f73d8
... ... @@ -4706,6 +4706,8 @@
4706 4706 mapList.add(map);
4707 4707 break;
4708 4708 }
  4709 +
  4710 + String noHls="0";
4709 4711 String lightHls="0",lightHln="0";
4710 4712 String middleHls="0",middleHln="0";
4711 4713 String matterHls="0",matterHln="0";
4712 4714  
... ... @@ -4715,8 +4717,9 @@
4715 4717 * 1-3个月
4716 4718 */
4717 4719 cms=1;cme=3;
  4720 + noHls="90";
4718 4721 middleHls="60";middleHln="89";
4719   - matterHls="30";matterHln="59";
  4722 + matterHls="0";matterHln="59";
4720 4723 break;
4721 4724 case 2:
4722 4725 /**
4723 4726  
... ... @@ -4724,8 +4727,9 @@
4724 4727 */
4725 4728 cms=4;cme=5;
4726 4729 //(90-100g/l)
  4730 + noHls="101";
4727 4731 lightHls="90";lightHln="100"; middleHls="60";middleHln="89";
4728   - matterHls="30";matterHln="59";
  4732 + matterHls="0";matterHln="59";
4729 4733 break;
4730 4734 case 3:
4731 4735 /**
4732 4736  
... ... @@ -4733,8 +4737,9 @@
4733 4737 */
4734 4738 cms=6;cme=11;
4735 4739 //(90-110g/l)
  4740 + noHls="111";
4736 4741 lightHls="90";lightHln="110"; middleHls="60";middleHln="89";
4737   - matterHls="30";matterHln="59";
  4742 + matterHls="0";matterHln="59";
4738 4743 break;
4739 4744 case 4:
4740 4745 /**
4741 4746  
... ... @@ -4742,8 +4747,9 @@
4742 4747 */
4743 4748 cms=12;cme=17;
4744 4749 //(90-115g/l)
  4750 + noHls="116";
4745 4751 lightHls="90";lightHln="110"; middleHls="60";middleHln="89";
4746   - matterHls="30";matterHln="59";
  4752 + matterHls="0";matterHln="59";
4747 4753 break;
4748 4754 case 5:
4749 4755 /**
4750 4756  
... ... @@ -4751,8 +4757,9 @@
4751 4757 */
4752 4758 cms=18;cme=24;
4753 4759 //(90-120g/l)
  4760 + noHls="121";
4754 4761 lightHls="90";lightHln="110"; middleHls="60";middleHln="89";
4755   - matterHls="30";matterHln="59";
  4762 + matterHls="0";matterHln="59";
4756 4763 break;
4757 4764 case 6:
4758 4765 /**
4759 4766  
... ... @@ -4760,8 +4767,9 @@
4760 4767 */
4761 4768 cms=25;cme=35;
4762 4769 //(90-120g/l)
  4770 + noHls="121";
4763 4771 lightHls="90";lightHln="110"; middleHls="60";middleHln="89";
4764   - matterHls="30";matterHln="59";
  4772 + matterHls="0";matterHln="59";
4765 4773 break;
4766 4774 case 7:
4767 4775 /**
4768 4776  
... ... @@ -4769,8 +4777,9 @@
4769 4777 */
4770 4778 cms=36;cme=72;
4771 4779 //(90-120g/l)
  4780 + noHls="121";
4772 4781 lightHls="90";lightHln="110"; middleHls="60";middleHln="89";
4773   - matterHls="30";matterHln="59";
  4782 + matterHls="0";matterHln="59";
4774 4783 break;
4775 4784 }
4776 4785 query.setCheckMonthStart(cms);
4777 4786  
4778 4787  
... ... @@ -4793,11 +4802,16 @@
4793 4802 query.setHemoglobinEnd(matterHln);
4794 4803 int matter =babyCheckService.queryBabyCheckCount(query);
4795 4804 map.put("matter"+i,matter);
  4805 + //无贫血
  4806 + query.setHemoglobinStart(noHls);
  4807 + query.setHemoglobinEnd(null);
  4808 + int nothing =babyCheckService.queryBabyCheckCount(query);
  4809 + map.put("nothing"+i,nothing);
4796 4810  
4797 4811 //月龄区间总数
4798   - map.put("total"+i,light+middle+matter);
  4812 + map.put("total"+i,light+middle+matter+nothing);
4799 4813 if(cms==1){
4800   - map.put("total"+i,middle+matter);
  4814 + map.put("total"+i,middle+matter+nothing);
4801 4815 }
4802 4816 //汇总总数
4803 4817 total+=Integer.parseInt(map.get("total"+i).toString());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java View file @ 16f73d8
... ... @@ -8858,12 +8858,16 @@
8858 8858 Long matter = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
8859 8859 map.put("matter",matter);
8860 8860 //极重度贫血(<40g/l)
8861   - antExChuQuery.setXhdbXiao("40");
8862 8861 antExChuQuery.setLpXhdbStart(null);
8863   - antExChuQuery.setLpXhdbEnd(null);
  8862 + antExChuQuery.setLpXhdbEnd("41");
8864 8863 Long severity = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
  8864 + //无贫血(>109g/l)
  8865 + antExChuQuery.setLpXhdbStart("110");
  8866 + antExChuQuery.setLpXhdbEnd(null);
  8867 + Long nothing = mongoTemplate.count(antExChuQuery.convertToQuery().convertToMongoQuery(), AntExChuModel.class);
8865 8868 map.put("severity",severity);
8866   - map.put("total",light+middle+matter+severity);
  8869 +
  8870 + map.put("total",light+middle+matter+severity+nothing);
8867 8871 br.setErrorcode(ErrorCodeConstants.SUCCESS);
8868 8872 br.setErrormsg("成功");
8869 8873 br.setObject(map);
... ... @@ -8905,7 +8909,7 @@
8905 8909 break;
8906 8910 case 4:
8907 8911 //极重度贫血(<40g/l)
8908   - antExChuQuery.setXhdbXiao("40");
  8912 + antExChuQuery.setLpXhdbEnd("41");
8909 8913 break;
8910 8914 }
8911 8915 }