gaodd vor 2 Jahren
Ursprung
Commit
5cd996158c

+ 17 - 1
src/main/java/com/chinaitop/depot/business/mapper/BusinessDrugStandingBookMapper.xml

@@ -541,7 +541,7 @@
541
   </select>
541
   </select>
542
 
542
 
543
   <select id="queryCountByType" resultType="java.util.Map">
543
   <select id="queryCountByType" resultType="java.util.Map">
544
-    SELECT
544
+    <!-- SELECT
545
       SUM(
545
       SUM(
546
           CASE
546
           CASE
547
           WHEN type = 1 THEN
547
           WHEN type = 1 THEN
@@ -556,6 +556,22 @@
556
     GROUP BY
556
     GROUP BY
557
       drug_kind
557
       drug_kind
558
     ORDER BY
558
     ORDER BY
559
+      drug_kind -->
560
+      
561
+      SUM(
562
+          CASE
563
+          WHEN type = 1 THEN
564
+              cast(storage_count as DECIMAL )
565
+          END
566
+      ) storage_count,
567
+     SUM(cast(delivery_count as DECIMAL)) delivery_count,
568
+      drug_kind
569
+     FROM
570
+      business_drug_standing_book
571
+    where org_id = #{orgId}
572
+    GROUP BY
573
+      drug_kind
574
+    ORDER BY
559
       drug_kind
575
       drug_kind
560
   </select>
576
   </select>
561
 
577