Commit 00e0314adcf4d17bac4f4eefff0ae1c3229b51be
1 parent
dbab25522d
Exists in
master
and in
1 other branch
修改新电子病历
Showing 2 changed files with 91 additions and 84 deletions
platform-dal/src/main/java/com/lyms/platform/query/ReferralApplyOrderQuery.java
View file @
00e0314
1 | 1 | package com.lyms.platform.query; |
2 | 2 | |
3 | 3 | import com.lyms.platform.common.base.IConvertToNativeQuery; |
4 | -import com.lyms.platform.common.core.annotation.form.FormParam; | |
5 | 4 | import com.lyms.platform.common.dao.BaseQuery; |
6 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
7 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
... | ... | @@ -23,7 +22,7 @@ |
23 | 22 | private String parentId; |
24 | 23 | private String pid; |
25 | 24 | /** |
26 | - *孕妇名字 | |
25 | + * 孕妇名字 | |
27 | 26 | */ |
28 | 27 | private String name; |
29 | 28 | //母亲的名字 |
30 | 29 | |
31 | 30 | |
32 | 31 | |
33 | 32 | |
34 | 33 | |
35 | 34 | |
36 | 35 | |
37 | 36 | |
38 | 37 | |
39 | 38 | |
40 | 39 | |
41 | 40 | |
... | ... | @@ -289,48 +288,48 @@ |
289 | 288 | |
290 | 289 | @Override |
291 | 290 | public MongoQuery convertToQuery() { |
292 | - MongoCondition condition = MongoCondition.newInstance(); | |
293 | - if(null!=parentId){ | |
294 | - condition=condition.and("parentId",parentId, MongoOper.IS); | |
291 | + MongoCondition condition = MongoCondition.newInstance(); | |
292 | + if (null != parentId) { | |
293 | + condition = condition.and("parentId", parentId, MongoOper.IS); | |
295 | 294 | } |
296 | - if(null!=id){ | |
297 | - condition=condition.and("id",id, MongoOper.IS); | |
295 | + if (null != id) { | |
296 | + condition = condition.and("id", id, MongoOper.IS); | |
298 | 297 | } |
299 | - if(null!=pid){ | |
300 | - condition=condition.and("pid",pid, MongoOper.IS); | |
298 | + if (null != pid) { | |
299 | + condition = condition.and("pid", pid, MongoOper.IS); | |
301 | 300 | } |
302 | - if(StringUtils.isNotEmpty(name)){ | |
303 | - condition=condition.and("name",name, MongoOper.LIKE); | |
301 | + if (StringUtils.isNotEmpty(name)) { | |
302 | + condition = condition.and("name", name, MongoOper.LIKE); | |
304 | 303 | } |
305 | - if(null!=serviceStatus){ | |
306 | - condition=condition.and("serviceStatus",serviceStatus, MongoOper.IS); | |
304 | + if (null != serviceStatus) { | |
305 | + condition = condition.and("serviceStatus", serviceStatus, MongoOper.IS); | |
307 | 306 | } |
308 | - if(null!=status){ | |
309 | - condition=condition.and("status",status, MongoOper.IS); | |
307 | + if (null != status) { | |
308 | + condition = condition.and("status", status, MongoOper.IS); | |
310 | 309 | } |
311 | - if(null!=age){ | |
312 | - condition=condition.and("age",age, MongoOper.IS); | |
310 | + if (null != age) { | |
311 | + condition = condition.and("age", age, MongoOper.IS); | |
313 | 312 | } |
314 | - if(null!=expVip){ | |
315 | - condition=condition.and("expVip",expVip, MongoOper.IS); | |
313 | + if (null != expVip) { | |
314 | + condition = condition.and("expVip", expVip, MongoOper.IS); | |
316 | 315 | } |
317 | - if(null!=serviceType){ | |
318 | - condition=condition.and("serviceType",serviceType, MongoOper.IS); | |
316 | + if (null != serviceType) { | |
317 | + condition = condition.and("serviceType", serviceType, MongoOper.IS); | |
319 | 318 | } |
320 | - if(StringUtils.isNotEmpty(mCardNo)){ | |
321 | - condition=condition.and("mCardNo",mCardNo, MongoOper.IS); | |
319 | + if (StringUtils.isNotEmpty(mCardNo)) { | |
320 | + condition = condition.and("mCardNo", mCardNo, MongoOper.IS); | |
322 | 321 | } |
323 | 322 | |
324 | - if(StringUtils.isNotEmpty(phone)){ | |
325 | - condition=condition.and("phone",phone, MongoOper.IS); | |
323 | + if (StringUtils.isNotEmpty(phone)) { | |
324 | + condition = condition.and("phone", phone, MongoOper.IS); | |
326 | 325 | } |
327 | - if(null!=hospitalId){ | |
328 | - condition=condition.and("hospitalId",hospitalId, MongoOper.IS); | |
326 | + if (null != hospitalId) { | |
327 | + condition = condition.and("hospitalId", hospitalId, MongoOper.IS); | |
329 | 328 | } |
330 | 329 | |
331 | 330 | |
332 | - if(null!=rLevel){ | |
333 | - condition=condition.and("rLevel",rLevel, MongoOper.IS); | |
331 | + if (null != rLevel) { | |
332 | + condition = condition.and("rLevel", rLevel, MongoOper.IS); | |
334 | 333 | } |
335 | 334 | boolean isAddStart = Boolean.FALSE; |
336 | 335 | |
337 | 336 | |
338 | 337 | |
339 | 338 | |
340 | 339 | |
341 | 340 | |
342 | 341 | |
343 | 342 | |
344 | 343 | |
345 | 344 | |
346 | 345 | |
347 | 346 | |
348 | 347 | |
349 | 348 | |
350 | 349 | |
351 | 350 | |
352 | 351 | |
353 | 352 | |
354 | 353 | |
355 | 354 | |
356 | 355 | |
357 | 356 | |
358 | 357 | |
359 | 358 | |
360 | 359 | |
361 | 360 | |
362 | 361 | |
363 | 362 | |
364 | 363 | |
365 | 364 | |
366 | 365 | |
367 | 366 | |
368 | 367 | |
369 | 368 | |
370 | 369 | |
371 | 370 | |
372 | 371 | |
373 | 372 | |
... | ... | @@ -345,114 +344,123 @@ |
345 | 344 | } else { |
346 | 345 | c = Criteria.where("score").lte(scoreEnd); |
347 | 346 | } |
348 | - isAddStart = Boolean.TRUE; | |
349 | 347 | } |
348 | + if (null != c) { | |
349 | + condition = condition.andCondition(new MongoCondition(c)); | |
350 | + } | |
351 | + Criteria c1 = null; | |
352 | + isAddStart = Boolean.FALSE; | |
350 | 353 | if (null != revicedStart) { |
351 | - c = Criteria.where("received").gte(revicedStart); | |
354 | + c1 = Criteria.where("received").gte(revicedStart); | |
352 | 355 | isAddStart = Boolean.TRUE; |
353 | 356 | } |
354 | 357 | if (null != revicedEnd) { |
355 | 358 | if (isAddStart) { |
356 | - c = c.lte(revicedEnd); | |
359 | + c1 = c1.lte(revicedEnd); | |
357 | 360 | } else { |
358 | - c = Criteria.where("received").lte(revicedEnd); | |
361 | + c1 = Criteria.where("received").lte(revicedEnd); | |
359 | 362 | } |
360 | 363 | isAddStart = Boolean.TRUE; |
361 | 364 | } |
365 | + if (null != c1) { | |
366 | + condition = condition.andCondition(new MongoCondition(c1)); | |
367 | + } | |
368 | + Criteria c2 = null; | |
369 | + isAddStart = Boolean.FALSE; | |
362 | 370 | if (null != transferredStart) { |
363 | - c = Criteria.where("created").gte(transferredStart); | |
371 | + c2 = Criteria.where("created").gte(transferredStart); | |
364 | 372 | isAddStart = Boolean.TRUE; |
365 | 373 | } |
366 | 374 | |
367 | 375 | if (null != transferredEnd) { |
368 | 376 | if (isAddStart) { |
369 | - c = c.lte(transferredEnd); | |
377 | + c2 = c2.lte(transferredEnd); | |
370 | 378 | } else { |
371 | - c = Criteria.where("created").lte(transferredEnd); | |
379 | + c2 = Criteria.where("created").lte(transferredEnd); | |
372 | 380 | } |
373 | 381 | isAddStart = Boolean.TRUE; |
374 | 382 | } |
383 | + if (null != c2) { | |
384 | + condition = condition.andCondition(new MongoCondition(c2)); | |
385 | + } | |
375 | 386 | |
376 | 387 | |
377 | - | |
378 | - if(StringUtils.isNotEmpty(riskFactor)){ | |
379 | - condition=condition.and("rRisk",riskFactor, MongoOper.IN); | |
388 | + if (StringUtils.isNotEmpty(riskFactor)) { | |
389 | + condition = condition.and("rRisk", riskFactor, MongoOper.IN); | |
380 | 390 | } |
381 | - if(StringUtils.isNotEmpty(cardNo)){ | |
382 | - condition=condition.and("cardNo",cardNo, MongoOper.IS); | |
391 | + if (StringUtils.isNotEmpty(cardNo)) { | |
392 | + condition = condition.and("cardNo", cardNo, MongoOper.IS); | |
383 | 393 | } |
384 | - if(null!=type){ | |
385 | - condition=condition.and("type",type, MongoOper.IS); | |
394 | + if (null != type) { | |
395 | + condition = condition.and("type", type, MongoOper.IS); | |
386 | 396 | } |
387 | - if(null!=outHospitalId){ | |
397 | + if (null != outHospitalId) { | |
388 | 398 | List<String> list = new ArrayList<>(); |
389 | 399 | list.add(outHospitalId); |
390 | - if(null!=hospitalName){ | |
400 | + if (null != hospitalName) { | |
391 | 401 | list.add(hospitalName); |
392 | 402 | } |
393 | - condition=condition.and("outHospitalId",outHospitalId, MongoOper.IN); | |
403 | + condition = condition.and("outHospitalId", outHospitalId, MongoOper.IN); | |
394 | 404 | } |
395 | 405 | |
396 | - if(null!=transferredHospital){ | |
406 | + if (null != transferredHospital) { | |
397 | 407 | List<String> list = new ArrayList<>(); |
398 | 408 | list.add(transferredHospital); |
399 | - if(null!=hospitalName){ | |
409 | + if (null != hospitalName) { | |
400 | 410 | list.add(hospitalName); |
401 | 411 | } |
402 | - MongoCondition mongoCondition1=MongoCondition.newInstance("transferredHospital", list, MongoOper.IN); | |
403 | - condition=condition.andCondition(mongoCondition1); | |
412 | + MongoCondition mongoCondition1 = MongoCondition.newInstance("transferredHospital", list, MongoOper.IN); | |
413 | + condition = condition.andCondition(mongoCondition1); | |
404 | 414 | } |
405 | - if (isAddStart) { | |
406 | - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
407 | - } | |
415 | + Criteria c24 = null; | |
416 | + isAddStart = Boolean.FALSE; | |
408 | 417 | |
409 | - | |
410 | 418 | if (null != dueDateStart) { |
411 | - c = Criteria.where("days").gte(dueDateStart); | |
419 | + c24 = Criteria.where("days").gte(dueDateStart); | |
412 | 420 | isAddStart = Boolean.TRUE; |
413 | 421 | } |
414 | 422 | if (null != dueDateEnd) { |
415 | 423 | if (isAddStart) { |
416 | - c = c.lte(dueDateEnd); | |
424 | + c24 = c.lte(dueDateEnd); | |
417 | 425 | } else { |
418 | - c = Criteria.where("days").lte(dueDateEnd); | |
426 | + c24 = Criteria.where("days").lte(dueDateEnd); | |
419 | 427 | } |
420 | - isAddStart = Boolean.TRUE; | |
421 | 428 | } |
422 | - if (isAddStart) { | |
423 | - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
429 | + if(null!=c24){ | |
430 | + condition=condition.andCondition(new MongoCondition(c24)); | |
424 | 431 | } |
425 | 432 | |
433 | + Criteria c3 = null; | |
434 | + isAddStart = Boolean.FALSE; | |
426 | 435 | if (null != lastMensesStart) { |
427 | - c = Criteria.where("lastMenses").gte(lastMensesStart); | |
436 | + c3 = Criteria.where("lastMenses").gte(lastMensesStart); | |
428 | 437 | isAddStart = Boolean.TRUE; |
429 | 438 | } |
430 | 439 | if (null != lastMensesEnd) { |
431 | 440 | if (isAddStart) { |
432 | - c = c.lte(lastMensesEnd); | |
441 | + c3 = c3.lte(lastMensesEnd); | |
433 | 442 | } else { |
434 | - c = Criteria.where("lastMenses").lte(lastMensesEnd); | |
443 | + c3 = Criteria.where("lastMenses").lte(lastMensesEnd); | |
435 | 444 | } |
436 | - isAddStart = Boolean.TRUE; | |
437 | 445 | } |
438 | - if (isAddStart) { | |
439 | - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
446 | + if (null != c3) { | |
447 | + condition = condition.andCondition(new MongoCondition(c3)); | |
440 | 448 | } |
441 | - | |
449 | + Criteria c4 = null; | |
450 | + isAddStart = Boolean.FALSE; | |
442 | 451 | if (null != birthStart) { |
443 | - c = Criteria.where("birth").gte(birthStart); | |
452 | + c4 = Criteria.where("birth").gte(birthStart); | |
444 | 453 | isAddStart = Boolean.TRUE; |
445 | 454 | } |
446 | 455 | if (null != birthEnd) { |
447 | 456 | if (isAddStart) { |
448 | - c = c.lte(birthEnd); | |
457 | + c4 = c4.lte(birthEnd); | |
449 | 458 | } else { |
450 | - c = Criteria.where("birth").lte(birthEnd); | |
459 | + c4 = Criteria.where("birth").lte(birthEnd); | |
451 | 460 | } |
452 | - isAddStart = Boolean.TRUE; | |
453 | 461 | } |
454 | - if (isAddStart) { | |
455 | - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
462 | + if (null != c4) { | |
463 | + condition = condition.andCondition(new MongoCondition(c4)); | |
456 | 464 | } |
457 | 465 | return condition.toMongoQuery(); |
458 | 466 | } |
... | ... | @@ -475,7 +483,6 @@ |
475 | 483 | } |
476 | 484 | |
477 | 485 | |
478 | - | |
479 | 486 | public String getName() { |
480 | 487 | return name; |
481 | 488 | } |
... | ... | @@ -499,7 +506,6 @@ |
499 | 506 | public void setrLevel(String rLevel) { |
500 | 507 | this.rLevel = rLevel; |
501 | 508 | } |
502 | - | |
503 | 509 | |
504 | 510 | |
505 | 511 | public String getServiceStatus() { |
platform-dal/src/main/java/com/lyms/platform/query/SieveQuery.java
View file @
00e0314
... | ... | @@ -197,26 +197,27 @@ |
197 | 197 | } else { |
198 | 198 | c = Criteria.where("dueWeek").lte(dueWeekEnd); |
199 | 199 | } |
200 | - isAddStart = Boolean.TRUE; | |
201 | 200 | } |
202 | 201 | |
203 | - if (isAddStart) { | |
204 | - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
202 | + if (null!=c) { | |
203 | + condition=condition.andCondition(new MongoCondition(c)); | |
205 | 204 | } |
205 | + | |
206 | + Criteria c1 = null; | |
207 | + isAddStart = Boolean.FALSE; | |
206 | 208 | if (null != lastMensesStart) { |
207 | - c = Criteria.where("lastMenses").gte(lastMensesStart); | |
209 | + c1 = Criteria.where("lastMenses").gte(lastMensesStart); | |
208 | 210 | isAddStart = Boolean.TRUE; |
209 | 211 | } |
210 | 212 | if (null != lastMensesEnd) { |
211 | 213 | if (isAddStart) { |
212 | - c = c.lte(lastMensesEnd); | |
214 | + c1 = c1.lte(lastMensesEnd); | |
213 | 215 | } else { |
214 | - c = Criteria.where("lastMenses").lte(lastMensesEnd); | |
216 | + c1 = Criteria.where("lastMenses").lte(lastMensesEnd); | |
215 | 217 | } |
216 | - isAddStart = Boolean.TRUE; | |
217 | 218 | } |
218 | - if (isAddStart) { | |
219 | - return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); | |
219 | + if (null!=c1) { | |
220 | + condition=condition.andCondition(new MongoCondition(c1)); | |
220 | 221 | } |
221 | 222 | return condition.toMongoQuery(); |
222 | 223 | } |