sjw 4 лет назад
Родитель
Сommit
ecc9455c90
1 измененных файлов с 5 добавлено и 10 удалено
  1. 5 10
      src/rest/openapi/restcontroller/housekeeper/titem/AgentTitem.java

+ 5 - 10
src/rest/openapi/restcontroller/housekeeper/titem/AgentTitem.java

@@ -30,17 +30,12 @@ public class AgentTitem extends Controller {
         if(where!=null){
             DBConnect dbConnect=new DBConnect();
             if(where.containsKey("fitemname")&&!StringUtils.isBlank(where.getString("fitemname"))){
-                wherestr+=" and t.fitemname like '%"+where.getString("fitemname")+"%'";
-            }
-            if(where.containsKey("fitemno")&&!StringUtils.isBlank(where.getString("fitemno"))){
-                wherestr+=" and t.fitemno like '%"+where.getString("fitemno")+"%'";
-            }
-            if(where.containsKey("fmodel")&&!StringUtils.isBlank(where.getString("fmodel"))){
-                wherestr+=" and t.fmodel like '%"+where.getString("fmodel")+"%'";
-            }
-            if(where.containsKey("fspec")&&!StringUtils.isBlank(where.getString("fspec"))){
-                wherestr+=" and t.fspec like '%"+where.getString("fspec")+"%'";
+                wherestr+=" and (t.fitemname like '%"+where.getString("fitemname")+"%' " +
+                        "or t.fitemno like '%"+where.getString("fitemname")+"%' "+
+                        "or t.fmodel like '%"+where.getString("fitemname")+"%' "+
+                        "or t.fspec like '%"+where.getString("fitemname")+"%' )";
             }
+
             if(where.containsKey("fisused")&&where.getString("fisused").equals("true")){
                 wherestr+=" and t.fisused=1";
             }