Commit 439b70bb0fb94707923800c192c2caa9b427d41d
1 parent
26320d5315
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 47 additions and 23 deletions
platform-dal/src/main/java/com/lyms/platform/query/BabyModelQuery.java
View file @
439b70b
... | ... | @@ -1894,25 +1894,34 @@ |
1894 | 1894 | c = Criteria.where("nextCheckTime").lte(nextCheckTimeEnd); |
1895 | 1895 | } |
1896 | 1896 | } |
1897 | - if (null != nextDateStart && nextDateEnd != null) { | |
1898 | - Criteria cr = Criteria.where("nextDate").gte(nextDateStart).lte(nextDateEnd); | |
1899 | - condition.andCondition(new MongoCondition(cr)); | |
1897 | + | |
1898 | + /***预约时间查询***/ | |
1899 | + if (null != nextDateStart) { | |
1900 | + if (null != c) { | |
1901 | + c = c.and("nextDate").gte(nextDateStart); | |
1902 | + } else { | |
1903 | + c = Criteria.where("nextDate").gte(nextDateStart); | |
1904 | + } | |
1900 | 1905 | } |
1906 | + | |
1907 | + if (null != nextDateEnd) { | |
1908 | + if (null != c) { | |
1909 | + c = c.lte(nextDateEnd); | |
1910 | + } else { | |
1911 | + c = Criteria.where("nextDate").lte(nextDateEnd); | |
1912 | + } | |
1913 | + } | |
1914 | + /***预约时间查询***/ | |
1915 | + //修改如上 | |
1916 | +// if (null != nextDateStart && nextDateEnd != null) { | |
1917 | +// Criteria cr = Criteria.where("nextDate").gte(nextDateStart).lte(nextDateEnd); | |
1918 | +// condition.andCondition(new MongoCondition(cr)); | |
1919 | +// } | |
1901 | 1920 | if (null != endCaseTimeStart && endCaseTimeEnd != null) { |
1902 | 1921 | Criteria cr = Criteria.where("endCaseTime").gte(endCaseTimeStart).lte(endCaseTimeEnd); |
1903 | 1922 | condition.andCondition(new MongoCondition(cr)); |
1904 | 1923 | } |
1905 | 1924 | |
1906 | -// if(null != highRiskAndWeakSon){ //隆化县, 1:高危体弱合并 | |
1907 | -// MongoCondition c1 = MongoCondition.newInstance(); | |
1908 | -// MongoCondition con1 = MongoCondition.newInstance("highRisk", 1, MongoOper.IS); | |
1909 | -// MongoCondition con2 = MongoCondition.newInstance("weakSon", 1, MongoOper.IS); | |
1910 | -// if (c != null) { | |
1911 | -// c = c.andOperator(c1.orCondition(new MongoCondition[]{con1, con2}).getCriteria()); | |
1912 | -// } else { | |
1913 | -// c = c1.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
1914 | -// } | |
1915 | -// } | |
1916 | 1925 | |
1917 | 1926 | if (null != phoneOrcardNo) { |
1918 | 1927 | MongoCondition c1 = MongoCondition.newInstance(); |
1919 | 1928 | |
1920 | 1929 | |
1921 | 1930 | |
... | ... | @@ -1955,11 +1964,26 @@ |
1955 | 1964 | c = Criteria.where("created").gte(createdTimeStart).lte(createdTimeEnd); |
1956 | 1965 | } |
1957 | 1966 | } |
1967 | + Criteria cor=null; | |
1968 | + if(null != highRiskAndWeakSon){ //隆化县, 1:高危体弱合并 | |
1969 | + MongoCondition c1 = MongoCondition.newInstance(); | |
1970 | + MongoCondition con1 = MongoCondition.newInstance("highRisk", 1, MongoOper.IS); | |
1971 | + MongoCondition con2 = MongoCondition.newInstance("weakSon", 1, MongoOper.IS); | |
1972 | + cor=c1.orCondition(new MongoCondition[]{con1, con2}).getCriteria(); | |
1973 | + } | |
1958 | 1974 | |
1959 | - if (c != null) { | |
1975 | + /** | |
1976 | + * 多个orCondition 需要添加Criteria来控制json同级两个and或者or来解决mongodb执行查询问题 | |
1977 | + */ | |
1978 | + if(c!=null&&cor!=null){ | |
1979 | + return new MongoCondition(c.andOperator(condition.getCriteria(), cor)).toMongoQuery(); | |
1980 | + }else if(c!=null){ | |
1960 | 1981 | return new MongoCondition(c.andOperator(condition.getCriteria())).toMongoQuery(); |
1982 | + }else if(cor!=null){ | |
1983 | + return new MongoCondition(cor.andOperator(condition.getCriteria())).toMongoQuery(); | |
1984 | + }else { | |
1985 | + return condition.toMongoQuery(); | |
1961 | 1986 | } |
1962 | - return condition.toMongoQuery(); | |
1963 | 1987 | } |
1964 | 1988 | |
1965 | 1989 | public Boolean getFmDataStatu() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
439b70b
... | ... | @@ -3281,14 +3281,14 @@ |
3281 | 3281 | if (request.getHighRiskType() != null) { |
3282 | 3282 | if (request.getHighRiskType() == 1) {//高危 |
3283 | 3283 | // babyQuery.setLastHighRisk(1); |
3284 | - babyQuery.setHighRisk(1); | |
3285 | -// for (String s : babyQuery.getHospitalIdList()) {//隆化县儿童管理 1:高危页面高危与体弱合并显示 | |
3286 | -// if(Integer.valueOf(s)==2100001605){ | |
3287 | -// babyQuery.setHighRiskAndWeakSon(1); | |
3288 | -// }else{ | |
3289 | -// babyQuery.setHighRisk(1); | |
3290 | -// } | |
3291 | -// } | |
3284 | +// babyQuery.setHighRisk(1); | |
3285 | + for (String s : babyQuery.getHospitalIdList()) { | |
3286 | + if(Integer.valueOf(s)==2100001605){//隆化县儿童管理 1:高危页面高危与体弱合并显示 | |
3287 | + babyQuery.setHighRiskAndWeakSon(1);//BabyModelQuery类 highRiskAndWeakSon自定义标识字段合并查询 | |
3288 | + }else{ | |
3289 | + babyQuery.setHighRisk(1); | |
3290 | + } | |
3291 | + } | |
3292 | 3292 | } else if (request.getHighRiskType() == 3) {//体弱 |
3293 | 3293 | babyQuery.setWeakSon(1); |
3294 | 3294 | } else if (request.getHighRiskType() == 0) { |