Commit 1d1af3056b389f313b4037daa5b77af63117db4f
1 parent
da3783f1b7
Exists in
master
and in
1 other branch
update assconfig table name
Showing 2 changed files with 14 additions and 5 deletions
platform-dal/src/main/java/com/lyms/platform/query/LisCrisisItemQuery.java
View file @
1d1af30
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | 8 | import org.bson.types.ObjectId; |
| 9 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 9 | 10 | |
| 10 | 11 | import java.util.Date; |
| 11 | 12 | |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | |
| ... | ... | @@ -236,14 +237,22 @@ |
| 236 | 237 | if(null!=serviceStatus){ |
| 237 | 238 | condition=condition.and("serviceStatus",serviceStatus,MongoOper.IS); |
| 238 | 239 | } |
| 240 | + if(null!=age){ | |
| 241 | + condition=condition.and("age",age,MongoOper.IS); | |
| 242 | + } | |
| 243 | + Criteria c1 = null; | |
| 239 | 244 | if(null!=startWeek){ |
| 240 | - condition=condition.and("week",startWeek,MongoOper.GTE); | |
| 245 | + c1 = Criteria.where("week").gte(startWeek); | |
| 241 | 246 | } |
| 242 | 247 | if(null!=endWeek){ |
| 243 | - condition=condition.and("week",endWeek,MongoOper.LTE); | |
| 248 | + if (null==c1) { | |
| 249 | + c1 = Criteria.where("week").lte(endWeek); | |
| 250 | + } else { | |
| 251 | + c1 = c1.and("week").lte(endWeek); | |
| 252 | + } | |
| 244 | 253 | } |
| 245 | - if(null!=age){ | |
| 246 | - condition=condition.and("age",age,MongoOper.IS); | |
| 254 | + if (c1!=null) { | |
| 255 | + condition = condition.andCondition(new MongoCondition(c1)); | |
| 247 | 256 | } |
| 248 | 257 | |
| 249 | 258 | return condition.toMongoQuery(); |
platform-dal/src/main/java/com/lyms/platform/query/LisReportQuery.java
View file @
1d1af30
| ... | ... | @@ -62,7 +62,7 @@ |
| 62 | 62 | public MongoQuery convertToQuery() { |
| 63 | 63 | MongoCondition condition = MongoCondition.newInstance(); |
| 64 | 64 | if (null != id) { |
| 65 | - condition = condition.and("id", new ObjectId(id), MongoOper.IS); | |
| 65 | + condition = condition.and("id", id, MongoOper.IS); | |
| 66 | 66 | } |
| 67 | 67 | if (null != status) { |
| 68 | 68 | condition = condition.and("status", status, MongoOper.IS); |