فهرست منبع

海盐订单统计优化2021年12月3日14:25:49

hu 4 سال پیش
والد
کامیت
ac5b507e68
1فایلهای تغییر یافته به همراه12 افزوده شده و 22 حذف شده
  1. 12 22
      src/rest/openapi/restcontroller/wechatapp/orderform/orderform.java

+ 12 - 22
src/rest/openapi/restcontroller/wechatapp/orderform/orderform.java

@@ -139,17 +139,11 @@ public class orderform extends Controller {
         String where = " 1=1 ";
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
-            if (whereObject.containsKey("fagentnum") && !"".equals(whereObject.getString("fagentnum"))) {
-                where = where + " and t1.fagentnum like'%" + whereObject.getString("fagentnum") + "%'";
-            }
-            if (whereObject.containsKey("fagentname") && !"".equals(whereObject.getString("fagentname"))) {
-            	where = where + " and fagentname like'%" + whereObject.getString("fagentname") + "%'";
-            }
-            if (whereObject.containsKey("fagentshortname") && !"".equals(whereObject.getString("fagentshortname"))) {
-            	where = where + " and fagentshortname like'%" + whereObject.getString("fagentshortname") + "%'";
-            }
-            if (whereObject.containsKey("displayname") && !"".equals(whereObject.getString("displayname"))) {
-            	where = where + " and pp_hr.displayname like'%" + whereObject.getString("displayname") + "%'";
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where = where + " and (t1.fagentnum like'%" + whereObject.getString("condition") + "%' "
+                		      +"or fagentname like'%" + whereObject.getString("condition") + "%' "
+                		      +"or fagentshortname like'%" + whereObject.getString("condition") + "%' "
+                		      +"or pp_hr.displayname like'%" + whereObject.getString("condition") + "%') ";
             }
         }
 //	        /**
@@ -168,6 +162,7 @@ public class orderform extends Controller {
 			factory.addParameter("fsaler", content.getString("fsaler"));
 			factory.addParameter("siteid", content.getString("siteid"));
 			 factory.addParameter_SQL("where", where);
+			// System.out.println(factory.getSQL());
 			Rows rows = connect.runSqlQuery(factory.getSQL());
 			 return getReturnObject_suc_page(rows, true, 1).toString();
 		} else if (type.equals("隆等羲⑺帤彶遴")) {
@@ -208,17 +203,11 @@ public class orderform extends Controller {
         String where = " 1=1 ";
         if (content.containsKey("where")) {
             JSONObject whereObject = content.getJSONObject("where");
-            if (whereObject.containsKey("fagentnum") && !"".equals(whereObject.getString("fagentnum"))) {
-                where = where + " and t1.fagentnum like'%" + whereObject.getString("fagentnum") + "%'";
-            }
-            if (whereObject.containsKey("fagentname") && !"".equals(whereObject.getString("fagentname"))) {
-            	where = where + " and fagentname like'%" + whereObject.getString("fagentname") + "%'";
-            }
-            if (whereObject.containsKey("fagentshortname") && !"".equals(whereObject.getString("fagentshortname"))) {
-            	where = where + " and fagentshortname like'%" + whereObject.getString("fagentshortname") + "%'";
-            }
-            if (whereObject.containsKey("displayname") && !"".equals(whereObject.getString("displayname"))) {
-            	where = where + " and pp_hr.displayname like'%" + whereObject.getString("displayname") + "%'";
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where = where + " and (t1.fagentnum like'%" + whereObject.getString("condition") + "%' "
+                		      +"or fagentname like'%" + whereObject.getString("condition") + "%' "
+                		      +"or fagentshortname like'%" + whereObject.getString("condition") + "%' "
+                		      +"or pp_hr.displayname like'%" + whereObject.getString("condition") + "%') ";
             }
         }
 //	        /**
@@ -237,6 +226,7 @@ public class orderform extends Controller {
 			factory.addParameter("fagentnum",fagentnum);
 			factory.addParameter("siteid", content.getString("siteid"));
 		    factory.addParameter_SQL("where", where);
+		    System.out.println(factory.getSQL());
 			Rows rows = connect.runSqlQuery(factory.getSQL());
 			 return getReturnObject_suc_page(rows, true, 1).toString();
 		} else if (type.equals("隆等羲⑺帤彶遴")) {