Commit 2fbc1834de6053ca48b9ca95381fef3a254446ae
1 parent
14476f0b5e
Exists in
master
and in
1 other branch
孕产妇区域查询
Showing 2 changed files with 54 additions and 26 deletions
platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java
View file @
2fbc183
... | ... | @@ -1039,7 +1039,9 @@ |
1039 | 1039 | c1 = Criteria.where("dueDate").lte(dueDateEnd); |
1040 | 1040 | } |
1041 | 1041 | } |
1042 | + boolean isBirthStart = false; | |
1042 | 1043 | if (null != birthStart) { |
1044 | + isBirthStart = true; | |
1043 | 1045 | if (null != c1) { |
1044 | 1046 | c1 = c1.and("birth").gte(birthStart); |
1045 | 1047 | } else { |
... | ... | @@ -1049,7 +1051,15 @@ |
1049 | 1051 | |
1050 | 1052 | if (null != birthEnd) { |
1051 | 1053 | if (null != c1) { |
1052 | - c1 = c1.lte(birthEnd); | |
1054 | + if (isBirthStart) | |
1055 | + { | |
1056 | + c1 = c1.lte(birthEnd); | |
1057 | + } | |
1058 | + else | |
1059 | + { | |
1060 | + c1 = c1.and("birth").lte(birthEnd); | |
1061 | + } | |
1062 | + | |
1053 | 1063 | } else { |
1054 | 1064 | c1 = Criteria.where("birth").lte(birthEnd); |
1055 | 1065 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/Test.java
View file @
2fbc183
... | ... | @@ -40,33 +40,51 @@ |
40 | 40 | // |
41 | 41 | // |
42 | 42 | // |
43 | -// patientsQuery1.setBookbuildingDateStart(DateUtil.parseYMD("1999-11-11")); | |
44 | -// patientsQuery1.setBookbuildingDateEnd(DateUtil.parseYMD("2016-12-08")); | |
43 | +// PatientsQuery patientsQuery = new PatientsQuery(); | |
44 | +// patientsQuery1.setYn(YnEnums.YES.getId()); | |
45 | +// | |
46 | +// List buildType = new ArrayList(); | |
47 | +// buildType.add(0); | |
48 | +// buildType.add(2); | |
49 | +// patientsQuery1.setBuildTypeList(buildType); | |
50 | +// | |
51 | +// //1孕妇 | |
52 | +//// patientsQuery.setType(1); | |
53 | +// // 0未终止妊娠 1终止妊娠 | |
54 | +// patientsQuery1.setDueStatus(0); | |
55 | +// | |
56 | +// | |
57 | +// | |
58 | +// | |
59 | +// patientsQuery1.setHospitalId("242"); | |
60 | +// patientsQuery1.setNorFactor(true); | |
61 | +// patientsQuery1.setrLevel("315107bd-91fe-42a1-9237-752f3c046a40"); | |
62 | +// patientsQuery1.setType(1); | |
63 | +// | |
45 | 64 | |
65 | + patientsQuery1.setYn(YnEnums.YES.getId()); | |
66 | + patientsQuery1.setType(1); | |
46 | 67 | |
47 | -// Date yuYueDate = DateUtil.addDay(new Date(), 2); | |
48 | -// if (yuYueDate != null) { | |
49 | -// //把时间格式化成 yyyy_MM_dd 的日期 | |
50 | -// yuYueDate = DateUtil.formatDate(yuYueDate); | |
51 | -// } | |
52 | -// AntExChuQuery antExChuQuery = new AntExChuQuery(); | |
53 | -// antExChuQuery.setYn(YnEnums.YES.getId()); | |
54 | -// antExChuQuery.setNextCheckTimeStart(yuYueDate); | |
55 | -// antExChuQuery.setNextCheckTimeEnd(yuYueDate); | |
56 | -// antExChuQuery.setHospitalId("242"); | |
68 | +// Date end = DateUtil.addDay(new Date(), 0); | |
57 | 69 | |
58 | - patientsQuery1.setHospitalId("242"); | |
59 | - patientsQuery1.setNorFactor(true); | |
60 | - patientsQuery1.setrLevel("49a36aea-c5b6-4162-87d2-9eb3c6ec00c2"); | |
61 | -// patientsQuery1.setType(1); | |
62 | -// | |
63 | -// Date yuYueDate = DateUtil.addDay(new Date(), 2); | |
64 | -// if (yuYueDate != null) { | |
65 | -// //把时间格式化成 yyyy_MM_dd 的日期 | |
66 | -// yuYueDate = DateUtil.formatDate(yuYueDate); | |
67 | -// } | |
68 | -// patientsQuery1.setDueDateStart(yuYueDate); | |
69 | -// patientsQuery1.setDueDateEnd(yuYueDate); | |
70 | + Date start = DateUtil.addDay(new Date(), -100); | |
71 | + | |
72 | + | |
73 | + patientsQuery1.setLastMensesStart(start); | |
74 | +// patientsQuery1.setLastMensesEnd(end); | |
75 | + | |
76 | + | |
77 | + Date date1 = DateUtil.addYear(new Date(), -18); | |
78 | +// patientsQuery1.setBirthEnd(date1); | |
79 | + Date date2 = DateUtil.addYear(new Date(), -30); | |
80 | + date2 = DateUtil.addYear(date2, -1); | |
81 | + | |
82 | + patientsQuery1.setBirthStart(DateUtil.addDay(date2, 1)); | |
83 | + List buildType = new ArrayList(); | |
84 | + buildType.add(0); | |
85 | + buildType.add(2); | |
86 | + patientsQuery1.setBuildTypeList(buildType); | |
87 | + | |
70 | 88 | |
71 | 89 | System.out.println(patientsQuery1.convertToQuery().convertToMongoQuery()); |
72 | 90 |