Explorar el Código

2021-11-15 13:48 bgj

sjw hace 4 años
padre
commit
ecc9455c90

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

@@ -30,17 +30,12 @@ public class AgentTitem extends Controller {
         if(where!=null){
         if(where!=null){
             DBConnect dbConnect=new DBConnect();
             DBConnect dbConnect=new DBConnect();
             if(where.containsKey("fitemname")&&!StringUtils.isBlank(where.getString("fitemname"))){
             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")){
             if(where.containsKey("fisused")&&where.getString("fisused").equals("true")){
                 wherestr+=" and t.fisused=1";
                 wherestr+=" and t.fisused=1";
             }
             }