Commit 2ad4c4cb9721228c399fae4e486e5f5db298ce9f
1 parent
1d1af3056b
Exists in
master
and in
8 other branches
add import test
Showing 2 changed files with 19 additions and 17 deletions
platform-dal/src/main/java/com/lyms/platform/query/LisCrisisItemQuery.java
View file @
2ad4c4c
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
8 | +import org.apache.commons.lang.StringUtils; | |
8 | 9 | import org.bson.types.ObjectId; |
9 | 10 | import org.springframework.data.mongodb.core.query.Criteria; |
10 | 11 | |
11 | 12 | |
12 | 13 | |
13 | 14 | |
14 | 15 | |
15 | 16 | |
16 | 17 | |
17 | 18 | |
18 | 19 | |
19 | 20 | |
20 | 21 | |
21 | 22 | |
... | ... | @@ -191,44 +192,44 @@ |
191 | 192 | @Override |
192 | 193 | public MongoQuery convertToQuery() { |
193 | 194 | MongoCondition condition = MongoCondition.newInstance(); |
194 | - if (null != id) { | |
195 | + if (StringUtils.isNotBlank(id)) { | |
195 | 196 | condition = condition.and("id", id, MongoOper.IS); |
196 | 197 | } |
197 | - if (null != name) { | |
198 | + if (StringUtils.isNotBlank(name)) { | |
198 | 199 | condition = condition.and("name", name, MongoOper.IS); |
199 | 200 | } |
200 | - if(null!=itemCode){ | |
201 | + if(StringUtils.isNotBlank(itemCode)){ | |
201 | 202 | condition=condition.and("itemCode",itemCode,MongoOper.IS); |
202 | 203 | } |
203 | - if(null!=itemName){ | |
204 | + if(StringUtils.isNotBlank(itemName)){ | |
204 | 205 | condition=condition.and("itemName",itemName,MongoOper.IS); |
205 | 206 | } |
206 | - if(null!=classify){ | |
207 | + if(StringUtils.isNotBlank(classify)){ | |
207 | 208 | condition=condition.and("classify",classify,MongoOper.IS); |
208 | 209 | } |
209 | - if(null!=classifyName){ | |
210 | + if(StringUtils.isNotBlank(classifyName)){ | |
210 | 211 | condition=condition.and("classifyName",classifyName,MongoOper.IS); |
211 | 212 | } |
212 | - if (null != flag) { | |
213 | + if (StringUtils.isNotBlank(flag)) { | |
213 | 214 | condition = condition.and("flag", flag, MongoOper.IS); |
214 | 215 | } |
215 | - if(null!=applyDoctorCode){ | |
216 | + if(StringUtils.isNotBlank(applyDoctorCode)){ | |
216 | 217 | condition=condition.and("applyDoctorCode",applyDoctorCode,MongoOper.IS); |
217 | 218 | } |
218 | - if(null!=applyDoctorName){ | |
219 | + if(StringUtils.isNotBlank(applyDoctorName)){ | |
219 | 220 | condition=condition.and("applyDoctorName",applyDoctorName,MongoOper.IS); |
220 | 221 | } |
221 | 222 | if(null!=status){ |
222 | 223 | condition=condition.and("status",status,MongoOper.IS); |
223 | 224 | } |
224 | 225 | |
225 | - if(null!=patientName){ | |
226 | + if(StringUtils.isNotBlank(patientName)){ | |
226 | 227 | condition=condition.and("patientName",patientName,MongoOper.IS); |
227 | 228 | } |
228 | - if(null!=cardNo){ | |
229 | + if(StringUtils.isNotBlank(cardNo)){ | |
229 | 230 | condition=condition.and("cardNo",cardNo,MongoOper.IS); |
230 | 231 | } |
231 | - if(null!=phone){ | |
232 | + if(StringUtils.isNotBlank(phone)){ | |
232 | 233 | condition=condition.and("phone",phone,MongoOper.IS); |
233 | 234 | } |
234 | 235 | if(null!=serviceType){ |
... | ... | @@ -248,7 +249,7 @@ |
248 | 249 | if (null==c1) { |
249 | 250 | c1 = Criteria.where("week").lte(endWeek); |
250 | 251 | } else { |
251 | - c1 = c1.and("week").lte(endWeek); | |
252 | + c1 = c1.lte(endWeek); | |
252 | 253 | } |
253 | 254 | } |
254 | 255 | if (c1!=null) { |
platform-dal/src/main/java/com/lyms/platform/query/LisReportQuery.java
View file @
2ad4c4c
... | ... | @@ -5,6 +5,7 @@ |
5 | 5 | import com.lyms.platform.common.dao.operator.MongoCondition; |
6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
8 | +import org.apache.commons.lang.StringUtils; | |
8 | 9 | import org.bson.types.ObjectId; |
9 | 10 | |
10 | 11 | /** |
11 | 12 | |
12 | 13 | |
13 | 14 | |
... | ... | @@ -61,19 +62,19 @@ |
61 | 62 | @Override |
62 | 63 | public MongoQuery convertToQuery() { |
63 | 64 | MongoCondition condition = MongoCondition.newInstance(); |
64 | - if (null != id) { | |
65 | + if (StringUtils.isNotBlank(id)) { | |
65 | 66 | condition = condition.and("id", id, MongoOper.IS); |
66 | 67 | } |
67 | 68 | if (null != status) { |
68 | 69 | condition = condition.and("status", status, MongoOper.IS); |
69 | 70 | } |
70 | - if (null != hospitalId) { | |
71 | + if (StringUtils.isNotBlank(hospitalId)) { | |
71 | 72 | condition = condition.and("hospitalId", hospitalId, MongoOper.IS); |
72 | 73 | } |
73 | - if(null!=vcCardNo){ | |
74 | + if(StringUtils.isNotBlank(vcCardNo)){ | |
74 | 75 | condition=condition.and("vcCardNo",vcCardNo,MongoOper.IS); |
75 | 76 | } |
76 | - if(null!=name){ | |
77 | + if(StringUtils.isNotBlank(name)){ | |
77 | 78 | condition=condition.and("name",name,MongoOper.IS); |
78 | 79 | } |
79 | 80 |