Browse Source

资源供需bug

LH 4 years ago
parent
commit
f1b1fad84d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/main/java/com/izouma/jmrh/web/BaseController.java

+ 2 - 2
src/main/java/com/izouma/jmrh/web/BaseController.java

@@ -282,7 +282,7 @@ public class BaseController {
                             String strItem = item.trim();
                             String name = strItem.substring(strItem.indexOf(":") + 1, strItem.indexOf(","));
                             String strValue = strItem.substring(strItem.indexOf("value:") + 6);
-                            if (StringUtils.isNotEmpty(strValue) && strValue.equals('0')) {
+                            if (StringUtils.isNotEmpty(strValue) && !strValue.equals('0')) {
                                 and.add(criteriaBuilder.equal(join.get("name"), name));
                                 and.add(criteriaBuilder.equal(join.get("value"), strValue));
                             }
@@ -314,7 +314,7 @@ public class BaseController {
                 }
                 and.add(criteriaBuilder.or(or.toArray(new Predicate[0])));
             }
-
+            criteriaQuery.distinct(true);
             return criteriaBuilder.and(and.toArray(new Predicate[0]));
         };
     }