Commit d546c0a43b7028375760a87792f724d7328410b2
1 parent
e1a76f3c46
Exists in
master
and in
8 other branches
增加设置parentid
Showing 2 changed files with 34 additions and 14 deletions
platform-dal/src/main/java/com/lyms/platform/query/SieveQuery.java
View file @
d546c0a
| ... | ... | @@ -10,9 +10,8 @@ |
| 10 | 10 | import java.util.Date; |
| 11 | 11 | |
| 12 | 12 | /** |
| 13 | - * | |
| 14 | 13 | * 产前筛查 |
| 15 | - * | |
| 14 | + * <p> | |
| 16 | 15 | * Created by Administrator on 2016/7/5 0005. |
| 17 | 16 | */ |
| 18 | 17 | public class SieveQuery extends BaseQuery implements IConvertToNativeQuery { |
| 19 | 18 | |
| ... | ... | @@ -44,9 +43,9 @@ |
| 44 | 43 | private Integer yn; |
| 45 | 44 | |
| 46 | 45 | //孕周开始 |
| 47 | - private Date dueWeekStart; | |
| 46 | + private Integer dueWeekStart; | |
| 48 | 47 | //孕周结束 |
| 49 | - private Date dueWeekEnd; | |
| 48 | + private Integer dueWeekEnd; | |
| 50 | 49 | |
| 51 | 50 | /** |
| 52 | 51 | * 末次月经 |
| 53 | 52 | |
| 54 | 53 | |
| 55 | 54 | |
| ... | ... | @@ -89,19 +88,19 @@ |
| 89 | 88 | this.isNotify = isNotify; |
| 90 | 89 | } |
| 91 | 90 | |
| 92 | - public Date getDueWeekEnd() { | |
| 91 | + public Integer getDueWeekEnd() { | |
| 93 | 92 | return dueWeekEnd; |
| 94 | 93 | } |
| 95 | 94 | |
| 96 | - public void setDueWeekEnd(Date dueWeekEnd) { | |
| 95 | + public void setDueWeekEnd(Integer dueWeekEnd) { | |
| 97 | 96 | this.dueWeekEnd = dueWeekEnd; |
| 98 | 97 | } |
| 99 | 98 | |
| 100 | - public Date getDueWeekStart() { | |
| 99 | + public Integer getDueWeekStart() { | |
| 101 | 100 | return dueWeekStart; |
| 102 | 101 | } |
| 103 | 102 | |
| 104 | - public void setDueWeekStart(Date dueWeekStart) { | |
| 103 | + public void setDueWeekStart(Integer dueWeekStart) { | |
| 105 | 104 | this.dueWeekStart = dueWeekStart; |
| 106 | 105 | } |
| 107 | 106 | |
| ... | ... | @@ -143,8 +142,8 @@ |
| 143 | 142 | if (null != id) { |
| 144 | 143 | condition = condition.and("id", id, MongoOper.IS); |
| 145 | 144 | } |
| 146 | - if(null!=from){ | |
| 147 | - condition=condition.and("from",from,MongoOper.IS); | |
| 145 | + if (null != from) { | |
| 146 | + condition = condition.and("from", from, MongoOper.IS); | |
| 148 | 147 | } |
| 149 | 148 | if (null != hospitalId) { |
| 150 | 149 | condition = condition.and("hospitalId", hospitalId, MongoOper.IS); |
| 151 | 150 | |
| ... | ... | @@ -177,8 +176,25 @@ |
| 177 | 176 | if (null != renShenResult) { |
| 178 | 177 | condition = condition.and("renShenResult", renShenResult, MongoOper.IS); |
| 179 | 178 | } |
| 180 | - boolean isAddStart = Boolean.FALSE; | |
| 179 | + | |
| 181 | 180 | Criteria c = null; |
| 181 | + boolean isAddStart = Boolean.FALSE; | |
| 182 | + if (null != dueWeekStart) { | |
| 183 | + c = Criteria.where("dueWeek").gte(dueWeekStart); | |
| 184 | + isAddStart = Boolean.TRUE; | |
| 185 | + } | |
| 186 | + if (null != dueWeekEnd) { | |
| 187 | + if (isAddStart) { | |
| 188 | + c = c.lte(dueWeekEnd); | |
| 189 | + } else { | |
| 190 | + c = Criteria.where("dueWeek").lte(dueWeekEnd); | |
| 191 | + } | |
| 192 | + isAddStart = Boolean.TRUE; | |
| 193 | + } | |
| 194 | + | |
| 195 | + if (isAddStart) { | |
| 196 | + return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
| 197 | + } | |
| 182 | 198 | if (null != lastMensesStart) { |
| 183 | 199 | c = Criteria.where("lastMenses").gte(lastMensesStart); |
| 184 | 200 | isAddStart = Boolean.TRUE; |
| ... | ... | @@ -258,7 +274,6 @@ |
| 258 | 274 | public void setPhone(String phone) { |
| 259 | 275 | this.phone = phone; |
| 260 | 276 | } |
| 261 | - | |
| 262 | 277 | |
| 263 | 278 | |
| 264 | 279 | public Integer getTireNumber() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SieveFacade.java
View file @
d546c0a
| ... | ... | @@ -28,6 +28,7 @@ |
| 28 | 28 | import org.springframework.stereotype.Component; |
| 29 | 29 | |
| 30 | 30 | import java.util.ArrayList; |
| 31 | +import java.util.Date; | |
| 31 | 32 | import java.util.List; |
| 32 | 33 | |
| 33 | 34 | /** |
| ... | ... | @@ -135,8 +136,12 @@ |
| 135 | 136 | sieveQuery.setRenShenResult(cqSieveQueryRequest.getRenShenResult()); |
| 136 | 137 | sieveQuery.setName(cqSieveQueryRequest.getName()); |
| 137 | 138 | sieveQuery.setCardNo(cqSieveQueryRequest.getCardNo()); |
| 138 | - sieveQuery.setDueWeekStart(DateUtil.parseYMD(cqSieveQueryRequest.getDueWeekStart())); | |
| 139 | - sieveQuery.setDueWeekEnd(DateUtil.parseYMD(cqSieveQueryRequest.getDueWeekEnd())); | |
| 139 | + if(null!=cqSieveQueryRequest.getDueWeekStart()){ | |
| 140 | + sieveQuery.setDueWeekStart(7*Integer.valueOf(cqSieveQueryRequest.getDueWeekStart())); | |
| 141 | + } | |
| 142 | + if(null!=cqSieveQueryRequest.getDueWeekEnd()){ | |
| 143 | + sieveQuery.setDueWeekEnd(7*Integer.valueOf(cqSieveQueryRequest.getDueWeekEnd())); | |
| 144 | + } | |
| 140 | 145 | sieveQuery.setZtfx(cqSieveQueryRequest.getZtfx()); |
| 141 | 146 | sieveQuery.setIsNotify(cqSieveQueryRequest.getIsNotify()); |
| 142 | 147 | sieveQuery.setPage(cqSieveQueryRequest.getPage()); |