From 51776e89446e4aa6757969062c3ffc59bf4e3c70 Mon Sep 17 00:00:00 2001 From: wangbo <184677810@qq.com> Date: Fri, 31 May 2019 11:51:32 +0800 Subject: [PATCH] bug1.1 1.2 --- .../com/lyms/platform/query/BabyModelQuery.java | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) 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) { -- 1.8.3.1