Commit 1c20ecc623ddafe5e381b795d26bf38971e69432

Authored by jiangjiazhi
1 parent b27b0c3653

修改新电子病历

Showing 4 changed files with 86 additions and 93 deletions

platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java View file @ 1c20ecc
... ... @@ -93,50 +93,50 @@
93 93  
94 94 @Override
95 95 public MongoQuery convertToQuery() {
96   - MongoCondition condition=MongoCondition.newInstance();
97   - if(null!=parentId){
98   - condition= condition.and("parentId",parentId, MongoOper.IS);
  96 + MongoCondition condition = MongoCondition.newInstance();
  97 + if (null != parentId) {
  98 + condition = condition.and("parentId", parentId, MongoOper.IS);
99 99 }
100   - if(null!=yn){
101   - condition= condition.and("yn",yn, MongoOper.IS);
  100 + if (null != yn) {
  101 + condition = condition.and("yn", yn, MongoOper.IS);
102 102 }
103   - if(null!=id){
104   - condition= condition.and("id",id, MongoOper.IS);
  103 + if (null != id) {
  104 + condition = condition.and("id", id, MongoOper.IS);
105 105 }
106   - if(null!=nextCheckTime){
107   - condition= condition.and("nextCheckTime",nextCheckTime, MongoOper.GTE);
  106 + if (null != nextCheckTime) {
  107 + condition = condition.and("nextCheckTime", nextCheckTime, MongoOper.GTE);
108 108 }
109 109  
110   - if(null!=hospitalId){
111   - condition=condition.and("hospitalId",hospitalId,MongoOper.IS);
  110 + if (null != hospitalId) {
  111 + condition = condition.and("hospitalId", hospitalId, MongoOper.IS);
112 112 }
113   - if(null!=pid){
114   - condition=condition.and("pid",pid,MongoOper.IS);
  113 + if (null != pid) {
  114 + condition = condition.and("pid", pid, MongoOper.IS);
115 115 }
116 116  
117   - boolean isAddStart = Boolean.FALSE;
118 117 Criteria c = null;
119 118 if (null != start) {
120 119 c = Criteria.where("checkTime").gte(start);
121   - isAddStart = Boolean.TRUE;
122 120 }
123 121  
124 122 if (null != end) {
125   - if (isAddStart) {
126   - c=c.lte(end);
  123 + if (null != c) {
  124 + c = c.lte(end);
127 125 } else {
128 126 c = Criteria.where("checkTime").lte(end);
129 127 }
130   - isAddStart = Boolean.TRUE;
131 128 }
132 129  
133 130 if (null != nextCheckTimeStart && nextCheckTimeEnd != null) {
134   - Criteria nc = Criteria.where("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd);
135   - condition= condition.andCondition(new MongoCondition(nc));
  131 + if (null != c) {
  132 + c = c.where("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd);
  133 + } else {
  134 + c = Criteria.where("nextCheckTime").gte(nextCheckTimeStart).lte(nextCheckTimeEnd);
  135 + }
136 136 }
137 137  
138   - if (isAddStart) {
139   - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery();
  138 + if (null != c) {
  139 + condition = condition.andCondition(new MongoCondition(c));
140 140 }
141 141 return condition.toMongoQuery();
142 142 }
platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java View file @ 1c20ecc
... ... @@ -100,9 +100,17 @@
100 100 Criteria c = null;
101 101 if (null != start) {
102 102 if(neStart){
103   - c = Criteria.where("checkDate").gt(start);
  103 + if(null!=c){
  104 + c = c.where("checkDate").gt(start);
  105 + }else{
  106 + c = Criteria.where("checkDate").gt(start);
  107 + }
104 108 }else{
105   - c = Criteria.where("checkDate").gte(start);
  109 + if(null!=c){
  110 + c = c.where("checkDate").gt(start);
  111 + }else{
  112 + c = Criteria.where("checkDate").gte(start);
  113 + }
106 114 }
107 115 isAddStart = Boolean.TRUE;
108 116 }
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java View file @ 1c20ecc
... ... @@ -331,58 +331,47 @@
331 331 if (null != rLevel) {
332 332 condition = condition.and("rLevel", rLevel, MongoOper.IS);
333 333 }
334   - boolean isAddStart = Boolean.FALSE;
335 334  
336 335 Criteria c = null;
337 336 if (null != scoreStart) {
338 337 c = Criteria.where("score").gte(scoreStart);
339   - isAddStart = Boolean.TRUE;
340 338 }
341 339 if (null != scoreEnd) {
342   - if (isAddStart) {
  340 + if (null != c) {
343 341 c = c.lte(scoreEnd);
344 342 } else {
345 343 c = Criteria.where("score").lte(scoreEnd);
346 344 }
347 345 }
348   - if (null != c) {
349   - condition = condition.andCondition(new MongoCondition(c));
350   - }
351   - Criteria c1 = null;
352   - isAddStart = Boolean.FALSE;
353 346 if (null != revicedStart) {
354   - c1 = Criteria.where("received").gte(revicedStart);
355   - isAddStart = Boolean.TRUE;
  347 + if (null != c) {
  348 + c = c.where("received").gte(revicedStart);
  349 + } else {
  350 + c = Criteria.where("received").gte(revicedStart);
  351 + }
356 352 }
357 353 if (null != revicedEnd) {
358   - if (isAddStart) {
359   - c1 = c1.lte(revicedEnd);
  354 + if (c != null) {
  355 + c = c.lte(revicedEnd);
360 356 } else {
361   - c1 = Criteria.where("received").lte(revicedEnd);
  357 + c = Criteria.where("received").lte(revicedEnd);
362 358 }
363   - isAddStart = Boolean.TRUE;
364 359 }
365   - if (null != c1) {
366   - condition = condition.andCondition(new MongoCondition(c1));
367   - }
368   - Criteria c2 = null;
369   - isAddStart = Boolean.FALSE;
370 360 if (null != transferredStart) {
371   - c2 = Criteria.where("created").gte(transferredStart);
372   - isAddStart = Boolean.TRUE;
  361 + if (c != null) {
  362 + c = c.where("created").gte(transferredStart);
  363 + } else {
  364 + c = Criteria.where("created").gte(transferredStart);
  365 + }
373 366 }
374 367  
375 368 if (null != transferredEnd) {
376   - if (isAddStart) {
377   - c2 = c2.lte(transferredEnd);
  369 + if (c != null) {
  370 + c = c.lte(transferredEnd);
378 371 } else {
379   - c2 = Criteria.where("created").lte(transferredEnd);
  372 + c = Criteria.where("created").lte(transferredEnd);
380 373 }
381   - isAddStart = Boolean.TRUE;
382 374 }
383   - if (null != c2) {
384   - condition = condition.andCondition(new MongoCondition(c2));
385   - }
386 375  
387 376  
388 377 if (StringUtils.isNotEmpty(riskFactor)) {
389 378  
390 379  
391 380  
392 381  
393 382  
394 383  
395 384  
396 385  
397 386  
398 387  
399 388  
400 389  
401 390  
... ... @@ -412,55 +401,52 @@
412 401 MongoCondition mongoCondition1 = MongoCondition.newInstance("transferredHospital", list, MongoOper.IN);
413 402 condition = condition.andCondition(mongoCondition1);
414 403 }
415   - Criteria c24 = null;
416   - isAddStart = Boolean.FALSE;
417 404  
418 405 if (null != dueDateStart) {
419   - c24 = Criteria.where("days").gte(dueDateStart);
420   - isAddStart = Boolean.TRUE;
  406 + if (null != c) {
  407 + c = c.where("days").gte(dueDateStart);
  408 + } else {
  409 + c = Criteria.where("days").gte(dueDateStart);
  410 + }
421 411 }
422 412 if (null != dueDateEnd) {
423   - if (isAddStart) {
424   - c24 = c.lte(dueDateEnd);
  413 + if (c != null) {
  414 + c = c.lte(dueDateEnd);
425 415 } else {
426   - c24 = Criteria.where("days").lte(dueDateEnd);
  416 + c = Criteria.where("days").lte(dueDateEnd);
427 417 }
428 418 }
429   - if(null!=c24){
430   - condition=condition.andCondition(new MongoCondition(c24));
431   - }
432 419  
433   - Criteria c3 = null;
434   - isAddStart = Boolean.FALSE;
435 420 if (null != lastMensesStart) {
436   - c3 = Criteria.where("lastMenses").gte(lastMensesStart);
437   - isAddStart = Boolean.TRUE;
  421 + if (null != c) {
  422 + c = c.where("lastMenses").gte(lastMensesStart);
  423 + } else {
  424 + c = Criteria.where("lastMenses").gte(lastMensesStart);
  425 + }
438 426 }
439 427 if (null != lastMensesEnd) {
440   - if (isAddStart) {
441   - c3 = c3.lte(lastMensesEnd);
  428 + if (c != null) {
  429 + c = c.lte(lastMensesEnd);
442 430 } else {
443   - c3 = Criteria.where("lastMenses").lte(lastMensesEnd);
  431 + c = Criteria.where("lastMenses").lte(lastMensesEnd);
444 432 }
445 433 }
446   - if (null != c3) {
447   - condition = condition.andCondition(new MongoCondition(c3));
448   - }
449   - Criteria c4 = null;
450   - isAddStart = Boolean.FALSE;
451 434 if (null != birthStart) {
452   - c4 = Criteria.where("birth").gte(birthStart);
453   - isAddStart = Boolean.TRUE;
  435 + if (null != c) {
  436 + c = c.where("birth").gte(birthStart);
  437 + } else {
  438 + c = Criteria.where("birth").gte(birthStart);
  439 + }
454 440 }
455 441 if (null != birthEnd) {
456   - if (isAddStart) {
457   - c4 = c4.lte(birthEnd);
  442 + if (null != c) {
  443 + c = c.lte(birthEnd);
458 444 } else {
459   - c4 = Criteria.where("birth").lte(birthEnd);
  445 + c = Criteria.where("birth").lte(birthEnd);
460 446 }
461 447 }
462   - if (null != c4) {
463   - condition = condition.andCondition(new MongoCondition(c4));
  448 + if (null != c) {
  449 + condition = condition.andCondition(new MongoCondition(c));
464 450 }
465 451 return condition.toMongoQuery();
466 452 }
platform-dal/src/main/java/com/lyms/platform/query/SieveQuery.java View file @ 1c20ecc
... ... @@ -192,32 +192,31 @@
192 192 isAddStart = Boolean.TRUE;
193 193 }
194 194 if (null != dueWeekEnd) {
195   - if (isAddStart) {
  195 + if (c!=null) {
196 196 c = c.lte(dueWeekEnd);
197 197 } else {
198 198 c = Criteria.where("dueWeek").lte(dueWeekEnd);
199 199 }
200 200 }
201 201  
202   - if (null!=c) {
203   - condition=condition.andCondition(new MongoCondition(c));
204   - }
205 202  
206   - Criteria c1 = null;
207   - isAddStart = Boolean.FALSE;
208 203 if (null != lastMensesStart) {
209   - c1 = Criteria.where("lastMenses").gte(lastMensesStart);
  204 + if(c!=null){
  205 + c = c.where("lastMenses").gte(lastMensesStart);
  206 + }else {
  207 + c = Criteria.where("lastMenses").gte(lastMensesStart);
  208 + }
210 209 isAddStart = Boolean.TRUE;
211 210 }
212 211 if (null != lastMensesEnd) {
213   - if (isAddStart) {
214   - c1 = c1.lte(lastMensesEnd);
  212 + if (c!=null) {
  213 + c = c.lte(lastMensesEnd);
215 214 } else {
216   - c1 = Criteria.where("lastMenses").lte(lastMensesEnd);
  215 + c = Criteria.where("lastMenses").lte(lastMensesEnd);
217 216 }
218 217 }
219   - if (null!=c1) {
220   - condition=condition.andCondition(new MongoCondition(c1));
  218 + if (null!=c) {
  219 + condition=condition.andCondition(new MongoCondition(c));
221 220 }
222 221 return condition.toMongoQuery();
223 222 }