diff --git a/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java index d580c5b..f484c7e 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java @@ -1064,7 +1064,6 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { condition = condition.and("sieveStatus", sieveStatusList2, MongoOper.IN); } - Criteria c = null; if (null != birthStart) { c = Criteria.where("birth").gte(birthStart); @@ -1087,7 +1086,7 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } }*/ - if (null != startAge) { + /* if (null != startAge) { c = Criteria.where("mbirth").lte(startAge); } @@ -1097,7 +1096,7 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } else { c = Criteria.where("mbirth").gte(endAge); } - } + }*/ if (-1 != yn) { condition = condition.and("yn", yn, MongoOper.IS); @@ -1114,8 +1113,7 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } } - if (fmDataStatu != null && fmDataStatu == true) - { + if (fmDataStatu != null && fmDataStatu == true) { condition = condition.and("dataStatus", 1, MongoOper.IS); condition = condition.and("yn", 0, MongoOper.IS); } @@ -1136,6 +1134,21 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } } + if (null != startAge && null != endAge) { + if (null != c) { + c.and("mbirth").lte(startAge).gte(endAge); + } else { + c = Criteria.where("mbirth").lte(startAge); + } + } + + /*if (null != endAge) { + if (null != c) { + c = c.gte(endAge); + } else { + c = Criteria.where("mbirth").gte(endAge); + } + }*/ if (null != asphyxiaMStart) { if (null != c) {