diff --git a/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java index 955f63f..ef3f345 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/AntExChuQuery.java @@ -153,19 +153,10 @@ public class AntExChuQuery extends BaseQuery implements IConvertToNativeQuery { } } - if(null!=gteModified){ - if (null != c) { - c = c.where("modified").gte(gteModified); - } else { - c = Criteria.where("modified").gte(gteModified); - } - } - if(null!=gteCreated){ - if (null != c) { - c = c.where("created").gte(gteCreated); - } else { - c = Criteria.where("created").gte(gteCreated); - } + if (null != gteModified && null != gteCreated) { + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); } if (null != c) { diff --git a/platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java index 39b1325..630b740 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/AntExQuery.java @@ -135,19 +135,10 @@ public class AntExQuery extends BaseQuery implements IConvertToNativeQuery { } isAddStart = Boolean.TRUE; } - if(null!=gteModified){ - if (null != c) { - c = c.where("modified").gte(gteModified); - } else { - c = Criteria.where("modified").gte(gteModified); - } - } - if(null!=gteCreated){ - if (null != c) { - c = c.where("created").gte(gteCreated); - } else { - c = Criteria.where("created").gte(gteCreated); - } + if (null != gteModified && null != gteCreated) { + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); } diff --git a/platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java index 7172d71..790b4b2 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/BabyCheckModelQuery.java @@ -29,6 +29,8 @@ public class BabyCheckModelQuery extends BaseQuery implements IConvertToNativeQu //建档IDs private String[] buildIds; + private String hospitalId; + @Override public MongoQuery convertToQuery() { MongoCondition condition = MongoCondition.newInstance(); @@ -42,6 +44,9 @@ public class BabyCheckModelQuery extends BaseQuery implements IConvertToNativeQu if(null!=buildId){ condition=condition.and("buildId", buildId, MongoOper.IS); } + if(null!=hospitalId){ + condition=condition.and("hospitalId",hospitalId,MongoOper.IS); + } if(null!=buildIds && buildIds.length > 0){ Criteria c = Criteria.where("buildId").in(Arrays.asList(buildIds)); condition.andCondition( new MongoCondition(c)); @@ -49,6 +54,14 @@ public class BabyCheckModelQuery extends BaseQuery implements IConvertToNativeQu return condition.toMongoQuery(); } + public String getHospitalId() { + return hospitalId; + } + + public void setHospitalId(String hospitalId) { + this.hospitalId = hospitalId; + } + public String getId() { return id; } 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 bf89d97..d1ea938 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 @@ -35,6 +35,28 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { private Integer[] orServiceStatus; + //大于修改时间 + private Date gteModified; + //大于创建时间 + //大于创建时间 + private Date gteCreated; + + public Date getGteModified() { + return gteModified; + } + + public void setGteModified(Date gteModified) { + this.gteModified = gteModified; + } + + public Date getGteCreated() { + return gteCreated; + } + + public void setGteCreated(Date gteCreated) { + this.gteCreated = gteCreated; + } + public Integer getBuildType() { return buildType; } @@ -460,6 +482,12 @@ public class BabyModelQuery extends BaseQuery implements IConvertToNativeQuery { } + if (null != gteModified && null != gteCreated) { + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); + } + if (null != birthEnd) { if (isAddStart) { c = c.lte(birthEnd); diff --git a/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java b/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java index b204434..17011a2 100644 --- a/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java +++ b/platform-dal/src/main/java/com/lyms/platform/query/PatientsQuery.java @@ -608,7 +608,7 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { } Criteria c1 = null; if (fmDateStart != null && fmDateEnd != null) { - c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd); + c1 = Criteria.where("fmDate").gte(fmDateStart).lte(fmDateEnd); } if (null != serviceType) { @@ -651,14 +651,14 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { } if (null != lastRhTimeStart) { - if(null!=c1){ + if (null != c1) { c1 = c1.and("lastRhTime").gte(lastRhTimeStart); - }else { + } else { c1 = Criteria.where("lastRhTime").gte(lastRhTimeStart); } } if (null != lastRhTimeEnd) { - if (null!=c1) { + if (null != c1) { c1 = c1.lte(lastRhTimeEnd); } else { c1 = Criteria.where("lastRhTime").lte(lastRhTimeEnd); @@ -666,14 +666,14 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { } if (null != hScoreStart) { if (null != hScoreStart) { - if(null!=c1){ + if (null != c1) { c1 = c1.and("riskScore").gte(hScoreStart); - }else{ + } else { c1 = Criteria.where("riskScore").gte(hScoreStart); } } if (null != hScoreEnd) { - if (null!=c1) { + if (null != c1) { c1 = c1.lte(hScoreEnd); } else { c1 = Criteria.where("riskScore").lte(hScoreEnd); @@ -684,53 +684,34 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { } if (null != bookbuildingDateStart) { - if(c1!=null){ + if (c1 != null) { c1 = c1.and("bookbuildingDate").gte(bookbuildingDateStart); - }else{ + } else { c1 = Criteria.where("bookbuildingDate").gte(bookbuildingDateStart); } } if (null != bookbuildingDateEnd) { - if (null!=c1) { + if (null != c1) { c1 = c1.lte(bookbuildingDateEnd); } else { c1 = Criteria.where("bookbuildingDate").lte(bookbuildingDateEnd); } } - - if (null != gteModified) { - if (null!=c1) { - c1 = c1.where("modified").gte(gteModified); - } else { - c1 = Criteria.where("modified").gte(gteModified); - } + if (null != gteModified && null != gteCreated) { + MongoCondition mongoCondition = new MongoCondition("modified", gteModified, MongoOper.GTE); + MongoCondition condition2 = new MongoCondition("created", gteCreated, MongoOper.GTE); + condition = condition.orCondition(new MongoCondition[]{mongoCondition, condition2}); } - if(null!=gteCreated){ - if (null != c1) { - c1 = c1.where("created").gte(gteCreated); - } else { - c1 = Criteria.where("created").gte(gteCreated); - } - } - -// Criteria cr1 = Criteria.where("bookbuildingDate").gte(bookbuildingDateStart).lte(bookbuildingDateEnd); -// Criteria cr = cr1.where("lastMenses").gte(lastMensesStart).lte(lastMensesEnd); - - /*if(null!=c1){ - return new MongoCondition(condition.getCriteria().andOperator(new Criteria[]{c1})).toMongoQuery(); - }*/ - /**/ -// Criteria c = null; if (null != lastMensesStart) { - if(null!=c1){ + if (null != c1) { c1 = c1.and("lastMenses").gte(lastMensesStart); - }else{ + } else { c1 = Criteria.where("lastMenses").gte(lastMensesStart); } } if (null != lastMensesEnd) { - if (c1!=null) { + if (c1 != null) { c1 = c1.lte(lastMensesEnd); } else { c1 = Criteria.where("lastMenses").lte(lastMensesEnd); @@ -738,7 +719,7 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { } if (null != lastMensesNeEnd) { - if (c1!=null) { + if (c1 != null) { c1 = c1.lt(lastMensesNeEnd); } else { c1 = Criteria.where("lastMenses").lt(lastMensesNeEnd); @@ -746,29 +727,29 @@ public class PatientsQuery extends BaseQuery implements IConvertToNativeQuery { } if (null != dueDateStart) { - if(null!=c1){ + if (null != c1) { c1 = c1.and("dueDate").gte(dueDateStart); - }else{ + } else { c1 = Criteria.where("dueDate").gte(dueDateStart); } } if (null != dueDateEnd) { - if (null!=c1) { + if (null != c1) { c1 = c1.lte(dueDateEnd); } else { c1 = Criteria.where("dueDate").lte(dueDateEnd); } } if (null != birthStart) { - if (null!=c1) { + if (null != c1) { c1 = c1.and("birth").gte(birthStart); - }else { + } else { c1 = Criteria.where("birth").gte(birthStart); } } if (null != birthEnd) { - if (null!=c1) { + if (null != c1) { c1 = c1.lte(birthEnd); } else { c1 = Criteria.where("birth").lte(birthEnd);