Explorar o código

发货单查询优化

hu %!s(int64=2) %!d(string=hai) anos
pai
achega
3c005392cd

+ 1 - 1
src/custom/restcontroller/webmanage/sale/dispatch/SQL/商品发货数量汇总.sql

@@ -3,4 +3,4 @@ SELECT  t3.itemno,
 FROM sa_dispatch_items t1
 FROM sa_dispatch_items t1
          inner join sa_dispatch t2 on t1.siteid = t2.siteid and t1.sa_dispatchid = t2.sa_dispatchid
          inner join sa_dispatch t2 on t1.siteid = t2.siteid and t1.sa_dispatchid = t2.sa_dispatchid
          inner join plm_item t3 on t1.siteid = t3.siteid and t1.itemid = t3.itemid
          inner join plm_item t3 on t1.siteid = t3.siteid and t1.itemid = t3.itemid
-WHERE t2.STATUS in ('审核','复核') and t1.siteid=$siteid$ group by t3.itemno
+WHERE t2.STATUS in ('审核','复核') and t1.siteid=$siteid$ and t3.itemno in $itemno$ group by t3.itemno

+ 2 - 0
src/custom/restcontroller/webmanage/sale/dispatch/dispatchItems.java

@@ -238,6 +238,7 @@ public class dispatchItems extends Controller {
         }
         }
         SQLFactory sqlFactory1 = new SQLFactory(this, "商品发货数量汇总");
         SQLFactory sqlFactory1 = new SQLFactory(this, "商品发货数量汇总");
         sqlFactory1.addParameter("siteid", siteid);
         sqlFactory1.addParameter("siteid", siteid);
+        sqlFactory1.addParameter_in("itemno", rows.toArrayList("itemno",new ArrayList<>()));
         Rows sumQtyRows = dbConnect.runSqlQuery(sqlFactory1);
         Rows sumQtyRows = dbConnect.runSqlQuery(sqlFactory1);
         RowsMap sumQtyRowsMap = sumQtyRows.toRowsMap("itemno");
         RowsMap sumQtyRowsMap = sumQtyRows.toRowsMap("itemno");
 
 
@@ -339,6 +340,7 @@ public class dispatchItems extends Controller {
         }
         }
         SQLFactory sqlFactory1 = new SQLFactory(this, "商品发货数量汇总");
         SQLFactory sqlFactory1 = new SQLFactory(this, "商品发货数量汇总");
         sqlFactory1.addParameter("siteid", siteid);
         sqlFactory1.addParameter("siteid", siteid);
+        sqlFactory1.addParameter_in("itemno", rows.toArrayList("itemno",new ArrayList<>()));
         Rows sumQtyRows = dbConnect.runSqlQuery(sqlFactory1);
         Rows sumQtyRows = dbConnect.runSqlQuery(sqlFactory1);
         RowsMap sumQtyRowsMap = sumQtyRows.toRowsMap("itemno");
         RowsMap sumQtyRowsMap = sumQtyRows.toRowsMap("itemno");