袁少华 il y a 4 ans
Parent
commit
cfaa4063e9

+ 12 - 1
src/main/java/org/jeecg/modules/fbsMomOrder/mapper/xml/FbsMomOrderdetailMapper.xml

@@ -24,7 +24,7 @@
     </select>
 
     <select id="getQualifiedInQtyWeek" resultType="org.jeecg.modules.fbsMomOrder.entity.FbsMomOrderdetail">
-        SELECT
+       <!-- SELECT
 
             i.cInvName,
             sum( QualifiedInQty ) as QualifiedInQty
@@ -34,6 +34,17 @@
             left join mom_morder mm on mo.modid=mm.modid
         WHERE
             datediff( WEEK, mm.DueDate, getdate ( ) ) = 0
+        GROUP BY
+            i.cInvName-->
+        SELECT
+            i.cInvName,
+            sum( iQuantity) as QualifiedInQty
+        FROM
+            RdRecords01 mo
+            LEFT JOIN Inventory i ON mo.cInvCode = i.cInvCode
+            left join RdRecord01 mm on mo.id=mm.id
+        WHERE
+            datediff( WEEK, mm.dDate , getdate ( ) ) = 0
         GROUP BY
             i.cInvName
     </select>