소스 검색

库存统计

laoyao 4 년 전
부모
커밋
3d48b5f19a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/edgeLibrary/StockInfoMapper.xml

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/edgeLibrary/StockInfoMapper.xml

@@ -73,8 +73,8 @@
         SELECT
             s1.parent_id id,
             ifnull(count( s.id),0) allCount,
-            ifnull(count( case when LENGTH(i.id) >0 then 1 else 0 end ),0)stockCount,
-            ifnull(count( s.id),0) - ifnull(count( case when LENGTH(i.id) >0 then 1 else 0 end ),0)freeCount,
+            ifnull(sum( case when LENGTH(i.id) >0 then 1 else 0 end ),0)stockCount,
+            ifnull(count( s.id),0) - ifnull(sum( case when LENGTH(i.id) >0 then 1 else 0 end ),0)freeCount,
             ifnull(sum( case when s.lock_status = '0' then 1 else 0 end ),0) lockCount
         FROM
             imcs_s_storge s