zxz 2 年之前
父节点
当前提交
98724b5093
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

+ 12 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehouseBaseInfoMapper.xml

@@ -492,11 +492,15 @@
         tran_task_info tti
         LEFT JOIN tran_car_info tci ON tci.info_id = tti.id
         AND tci.delete_flag = 0
+        AND tci.comp_id = #{compId}
         WHERE
         tti.task_type = '移库'
         AND tti.goods_name = wpsi.goods_name
         AND tti.delete_flag = 0
         AND tci.status_flag = 3
+        <if test="compId != null and compId != ''">
+            AND tti.comp_id = #{compId}
+        </if>
         )as moveNum/* 移库在途数量,已发出未反馈 */,
         (
         SELECT
@@ -517,6 +521,9 @@
         cmi.contract_type = 2
         AND cmi.delete_flag = 0
         AND sprr.amount_not_payable IS NOT NULL
+        <if test="compId != null and compId != ''">
+            AND cmi.comp_id = #{compId}
+        </if>
         GROUP BY
         cmi.contract_no,
         cgi.goods_name
@@ -527,6 +534,9 @@
         AND cpi.delete_flag = 0
         WHERE
         tt.goods_name = wpsi.goods_name
+        <if test="compId != null and compId != ''">
+            AND cmi.comp_id= #{compId}
+        </if>
         AND tt.total &lt; cpi.mildew_grain
         ) as purchaseNum/* 采购在途数量,合同已付减应付除以单价得到吨数 */,
         (
@@ -542,6 +552,8 @@
         AND tti.goods_name = wpsi.goods_name
         AND tti.delete_flag = 0
         AND tci.status_flag = 3
+        AND tci.comp_id = #{compId}
+        AND tti.comp_id = #{compId}
         ) as saleNum
         FROM
         warehouse_base_info wbi