Commit 4cc811d6a8dd7b8d7abe75c02007d2332e395968
1 parent
028a9875e1
Exists in
fengning2023-06-06
update 调整月龄查询
Showing 1 changed file with 18 additions and 0 deletions
platform-dal/src/main/java/com/lyms/platform/query/MedicineArticleQuery.java
View file @
4cc811d
| ... | ... | @@ -61,6 +61,20 @@ |
| 61 | 61 | * 月龄范围结束 |
| 62 | 62 | */ |
| 63 | 63 | private Integer monthAgeEnd; |
| 64 | + | |
| 65 | + /** | |
| 66 | + * 月龄 | |
| 67 | + */ | |
| 68 | + private Integer monthAge; | |
| 69 | + | |
| 70 | + public Integer getMonthAge() { | |
| 71 | + return monthAge; | |
| 72 | + } | |
| 73 | + | |
| 74 | + public void setMonthAge(Integer monthAge) { | |
| 75 | + this.monthAge = monthAge; | |
| 76 | + } | |
| 77 | + | |
| 64 | 78 | @Override |
| 65 | 79 | public MongoQuery convertToQuery() { |
| 66 | 80 | MongoCondition condition = MongoCondition.newInstance(); |
| ... | ... | @@ -90,6 +104,10 @@ |
| 90 | 104 | condition = condition.and("monthAgeEnd", monthAgeEnd, MongoOper.IS); |
| 91 | 105 | } |
| 92 | 106 | |
| 107 | + if (null != monthAge){ | |
| 108 | + condition = condition.and("monthAgeStart", monthAge, MongoOper.GTE); | |
| 109 | + condition = condition.and("monthAgeEnd", monthAge, MongoOper.LTE); | |
| 110 | + } | |
| 93 | 111 | Criteria c = null; |
| 94 | 112 | |
| 95 | 113 | if (null != createdStart && createdEnd != null) { |