|
@@ -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 < 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
|