Commit a1ca68e470c6282e7147d45a7fe7e07bc67d7fef
1 parent
0e9b903ad1
Exists in
master
and in
1 other branch
122
Showing 5 changed files with 73 additions and 69 deletions
- platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
- platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java
View file @
a1ca68e
| ... | ... | @@ -153,19 +153,10 @@ |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if(null!=gteModified){ | |
| 157 | - if (null != c) { | |
| 158 | - c = c.where("modified").gte(gteModified); | |
| 159 | - } else { | |
| 160 | - c = Criteria.where("modified").gte(gteModified); | |
| 161 | - } | |
| 162 | - } | |
| 163 | - if(null!=gteCreated){ | |
| 164 | - if (null != c) { | |
| 165 | - c = c.where("created").gte(gteCreated); | |
| 166 | - } else { | |
| 167 | - c = Criteria.where("created").gte(gteCreated); | |
| 168 | - } | |
| 156 | + if (null != gteModified && null != gteCreated) { | |
| 157 | + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); | |
| 158 | + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); | |
| 159 | + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); | |
| 169 | 160 | } |
| 170 | 161 | |
| 171 | 162 | if (null != c) { |
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java
View file @
a1ca68e
| ... | ... | @@ -135,19 +135,10 @@ |
| 135 | 135 | } |
| 136 | 136 | isAddStart = Boolean.TRUE; |
| 137 | 137 | } |
| 138 | - if(null!=gteModified){ | |
| 139 | - if (null != c) { | |
| 140 | - c = c.where("modified").gte(gteModified); | |
| 141 | - } else { | |
| 142 | - c = Criteria.where("modified").gte(gteModified); | |
| 143 | - } | |
| 144 | - } | |
| 145 | - if(null!=gteCreated){ | |
| 146 | - if (null != c) { | |
| 147 | - c = c.where("created").gte(gteCreated); | |
| 148 | - } else { | |
| 149 | - c = Criteria.where("created").gte(gteCreated); | |
| 150 | - } | |
| 138 | + if (null != gteModified && null != gteCreated) { | |
| 139 | + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); | |
| 140 | + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); | |
| 141 | + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); | |
| 151 | 142 | } |
| 152 | 143 | |
| 153 | 144 |
platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java
View file @
a1ca68e
| ... | ... | @@ -29,6 +29,8 @@ |
| 29 | 29 | //建档IDs |
| 30 | 30 | private String[] buildIds; |
| 31 | 31 | |
| 32 | + private String hospitalId; | |
| 33 | + | |
| 32 | 34 | @Override |
| 33 | 35 | public MongoQuery convertToQuery() { |
| 34 | 36 | MongoCondition condition = MongoCondition.newInstance(); |
| 35 | 37 | |
| ... | ... | @@ -42,11 +44,22 @@ |
| 42 | 44 | if(null!=buildId){ |
| 43 | 45 | condition=condition.and("buildId", buildId, MongoOper.IS); |
| 44 | 46 | } |
| 47 | + if(null!=hospitalId){ | |
| 48 | + condition=condition.and("hospitalId",hospitalId,MongoOper.IS); | |
| 49 | + } | |
| 45 | 50 | if(null!=buildIds && buildIds.length > 0){ |
| 46 | 51 | Criteria c = Criteria.where("buildId").in(Arrays.asList(buildIds)); |
| 47 | 52 | condition.andCondition( new MongoCondition(c)); |
| 48 | 53 | } |
| 49 | 54 | return condition.toMongoQuery(); |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getHospitalId() { | |
| 58 | + return hospitalId; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setHospitalId(String hospitalId) { | |
| 62 | + this.hospitalId = hospitalId; | |
| 50 | 63 | } |
| 51 | 64 | |
| 52 | 65 | public String getId() { |
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
a1ca68e
| ... | ... | @@ -35,6 +35,28 @@ |
| 35 | 35 | |
| 36 | 36 | private Integer[] orServiceStatus; |
| 37 | 37 | |
| 38 | + //大于修改时间 | |
| 39 | + private Date gteModified; | |
| 40 | + //大于创建时间 | |
| 41 | + //大于创建时间 | |
| 42 | + private Date gteCreated; | |
| 43 | + | |
| 44 | + public Date getGteModified() { | |
| 45 | + return gteModified; | |
| 46 | + } | |
| 47 | + | |
| 48 | + public void setGteModified(Date gteModified) { | |
| 49 | + this.gteModified = gteModified; | |
| 50 | + } | |
| 51 | + | |
| 52 | + public Date getGteCreated() { | |
| 53 | + return gteCreated; | |
| 54 | + } | |
| 55 | + | |
| 56 | + public void setGteCreated(Date gteCreated) { | |
| 57 | + this.gteCreated = gteCreated; | |
| 58 | + } | |
| 59 | + | |
| 38 | 60 | public Integer getBuildType() { |
| 39 | 61 | return buildType; |
| 40 | 62 | } |
| ... | ... | @@ -458,6 +480,12 @@ |
| 458 | 480 | Criteria cr = Criteria.where("nextDate").gte(nextDateStart).lte(nextDateEnd); |
| 459 | 481 | condition.andCondition(new MongoCondition(cr)); |
| 460 | 482 | |
| 483 | + } | |
| 484 | + | |
| 485 | + if (null != gteModified && null != gteCreated) { | |
| 486 | + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); | |
| 487 | + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); | |
| 488 | + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); | |
| 461 | 489 | } |
| 462 | 490 | |
| 463 | 491 | if (null != birthEnd) { |
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
a1ca68e
| ... | ... | @@ -608,7 +608,7 @@ |
| 608 | 608 | } |
| 609 | 609 | Criteria c1 = null; |
| 610 | 610 | if (fmDateStart != null && fmDateEnd != null) { |
| 611 | - c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd); | |
| 611 | + c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd); | |
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | if (null != serviceType) { |
| 615 | 615 | |
| 616 | 616 | |
| ... | ... | @@ -651,14 +651,14 @@ |
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | if (null != lastRhTimeStart) { |
| 654 | - if(null!=c1){ | |
| 654 | + if (null != c1) { | |
| 655 | 655 | c1 = c1.and("lastRhTime").gte(lastRhTimeStart); |
| 656 | - }else { | |
| 656 | + } else { | |
| 657 | 657 | c1 = Criteria.where("lastRhTime").gte(lastRhTimeStart); |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | 660 | if (null != lastRhTimeEnd) { |
| 661 | - if (null!=c1) { | |
| 661 | + if (null != c1) { | |
| 662 | 662 | c1 = c1.lte(lastRhTimeEnd); |
| 663 | 663 | } else { |
| 664 | 664 | c1 = Criteria.where("lastRhTime").lte(lastRhTimeEnd); |
| 665 | 665 | |
| 666 | 666 | |
| ... | ... | @@ -666,14 +666,14 @@ |
| 666 | 666 | } |
| 667 | 667 | if (null != hScoreStart) { |
| 668 | 668 | if (null != hScoreStart) { |
| 669 | - if(null!=c1){ | |
| 669 | + if (null != c1) { | |
| 670 | 670 | c1 = c1.and("riskScore").gte(hScoreStart); |
| 671 | - }else{ | |
| 671 | + } else { | |
| 672 | 672 | c1 = Criteria.where("riskScore").gte(hScoreStart); |
| 673 | 673 | } |
| 674 | 674 | } |
| 675 | 675 | if (null != hScoreEnd) { |
| 676 | - if (null!=c1) { | |
| 676 | + if (null != c1) { | |
| 677 | 677 | c1 = c1.lte(hScoreEnd); |
| 678 | 678 | } else { |
| 679 | 679 | c1 = Criteria.where("riskScore").lte(hScoreEnd); |
| 680 | 680 | |
| 681 | 681 | |
| 682 | 682 | |
| 683 | 683 | |
| 684 | 684 | |
| 685 | 685 | |
| 686 | 686 | |
| ... | ... | @@ -684,53 +684,34 @@ |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | if (null != bookbuildingDateStart) { |
| 687 | - if(c1!=null){ | |
| 687 | + if (c1 != null) { | |
| 688 | 688 | c1 = c1.and("bookbuildingDate").gte(bookbuildingDateStart); |
| 689 | - }else{ | |
| 689 | + } else { | |
| 690 | 690 | c1 = Criteria.where("bookbuildingDate").gte(bookbuildingDateStart); |
| 691 | 691 | } |
| 692 | 692 | } |
| 693 | 693 | if (null != bookbuildingDateEnd) { |
| 694 | - if (null!=c1) { | |
| 694 | + if (null != c1) { | |
| 695 | 695 | c1 = c1.lte(bookbuildingDateEnd); |
| 696 | 696 | } else { |
| 697 | 697 | c1 = Criteria.where("bookbuildingDate").lte(bookbuildingDateEnd); |
| 698 | 698 | } |
| 699 | 699 | } |
| 700 | - | |
| 701 | - if (null != gteModified) { | |
| 702 | - if (null!=c1) { | |
| 703 | - c1 = c1.where("modified").gte(gteModified); | |
| 704 | - } else { | |
| 705 | - c1 = Criteria.where("modified").gte(gteModified); | |
| 706 | - } | |
| 700 | + if (null != gteModified && null != gteCreated) { | |
| 701 | + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); | |
| 702 | + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); | |
| 703 | + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); | |
| 707 | 704 | } |
| 708 | 705 | |
| 709 | - if(null!=gteCreated){ | |
| 710 | - if (null != c1) { | |
| 711 | - c1 = c1.where("created").gte(gteCreated); | |
| 712 | - } else { | |
| 713 | - c1 = Criteria.where("created").gte(gteCreated); | |
| 714 | - } | |
| 715 | - } | |
| 716 | - | |
| 717 | -// Criteria cr1 = Criteria.where("bookbuildingDate").gte(bookbuildingDateStart).lte(bookbuildingDateEnd); | |
| 718 | -// Criteria cr = cr1.where("lastMenses").gte(lastMensesStart).lte(lastMensesEnd); | |
| 719 | - | |
| 720 | - /*if(null!=c1){ | |
| 721 | - return new MongoCondition(condition.getCriteria().andOperator(new Criteria[]{c1})).toMongoQuery(); | |
| 722 | - }*/ | |
| 723 | - /**/ | |
| 724 | -// Criteria c = null; | |
| 725 | 706 | if (null != lastMensesStart) { |
| 726 | - if(null!=c1){ | |
| 707 | + if (null != c1) { | |
| 727 | 708 | c1 = c1.and("lastMenses").gte(lastMensesStart); |
| 728 | - }else{ | |
| 709 | + } else { | |
| 729 | 710 | c1 = Criteria.where("lastMenses").gte(lastMensesStart); |
| 730 | 711 | } |
| 731 | 712 | } |
| 732 | 713 | if (null != lastMensesEnd) { |
| 733 | - if (c1!=null) { | |
| 714 | + if (c1 != null) { | |
| 734 | 715 | c1 = c1.lte(lastMensesEnd); |
| 735 | 716 | } else { |
| 736 | 717 | c1 = Criteria.where("lastMenses").lte(lastMensesEnd); |
| ... | ... | @@ -738,7 +719,7 @@ |
| 738 | 719 | } |
| 739 | 720 | |
| 740 | 721 | if (null != lastMensesNeEnd) { |
| 741 | - if (c1!=null) { | |
| 722 | + if (c1 != null) { | |
| 742 | 723 | c1 = c1.lt(lastMensesNeEnd); |
| 743 | 724 | } else { |
| 744 | 725 | c1 = Criteria.where("lastMenses").lt(lastMensesNeEnd); |
| 745 | 726 | |
| 746 | 727 | |
| 747 | 728 | |
| 748 | 729 | |
| 749 | 730 | |
| ... | ... | @@ -746,29 +727,29 @@ |
| 746 | 727 | } |
| 747 | 728 | |
| 748 | 729 | if (null != dueDateStart) { |
| 749 | - if(null!=c1){ | |
| 730 | + if (null != c1) { | |
| 750 | 731 | c1 = c1.and("dueDate").gte(dueDateStart); |
| 751 | - }else{ | |
| 732 | + } else { | |
| 752 | 733 | c1 = Criteria.where("dueDate").gte(dueDateStart); |
| 753 | 734 | } |
| 754 | 735 | } |
| 755 | 736 | if (null != dueDateEnd) { |
| 756 | - if (null!=c1) { | |
| 737 | + if (null != c1) { | |
| 757 | 738 | c1 = c1.lte(dueDateEnd); |
| 758 | 739 | } else { |
| 759 | 740 | c1 = Criteria.where("dueDate").lte(dueDateEnd); |
| 760 | 741 | } |
| 761 | 742 | } |
| 762 | 743 | if (null != birthStart) { |
| 763 | - if (null!=c1) { | |
| 744 | + if (null != c1) { | |
| 764 | 745 | c1 = c1.and("birth").gte(birthStart); |
| 765 | - }else { | |
| 746 | + } else { | |
| 766 | 747 | c1 = Criteria.where("birth").gte(birthStart); |
| 767 | 748 | } |
| 768 | 749 | } |
| 769 | 750 | |
| 770 | 751 | if (null != birthEnd) { |
| 771 | - if (null!=c1) { | |
| 752 | + if (null != c1) { | |
| 772 | 753 | c1 = c1.lte(birthEnd); |
| 773 | 754 | } else { |
| 774 | 755 | c1 = Criteria.where("birth").lte(birthEnd); |