|
|
|
@ -2061,39 +2061,57 @@ |
|
|
|
|
|
|
|
<!-- 获取领料记录 --> |
|
|
|
<select id="getMaterialRecordList" resultType="java.util.Map"> |
|
|
|
select |
|
|
|
A.site, |
|
|
|
A.bu_no as buNo, |
|
|
|
A.transaction_id as transactionId, |
|
|
|
A.document_type as documentType, |
|
|
|
A.document_no as documentNo, |
|
|
|
A.roll_no as rollNo, |
|
|
|
B.status, --标签状态 |
|
|
|
(CASE WHEN B.consumed_flag = 'Y' THEN '已消耗' ELSE '未使用' END) consumedFlag , --是否耗用 |
|
|
|
A.roll_qty as rollQty, |
|
|
|
A.batch_no as batchNo, |
|
|
|
A.transaction_by as transactionBy, |
|
|
|
A.transaction_date as transactionDate |
|
|
|
from StockTransactionLog A WITH(NOLOCK) |
|
|
|
INNER JOIN inventory_stock B WITH(NOLOCK) ON A.site = B.site AND A.roll_no = B.roll_no |
|
|
|
where A.site =#{site} and A.order_no = #{orderNo} AND a.part_no = #{partNo} and a.document_type in ('生产领料','生产退仓') |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
A.site, |
|
|
|
A.bu_no buNo, |
|
|
|
A.orderref1 as transactionId, |
|
|
|
A.orderref0 as documentType, |
|
|
|
A.orderref1 as documentNo, |
|
|
|
A.roll_no rollNo, |
|
|
|
A.status, --标签状态 |
|
|
|
(CASE WHEN a.consumed_flag = 'Y' THEN '已消耗' ELSE '未使用' END) consumedFlag , --是否使用 |
|
|
|
a.qty_on_hand as rollQty, |
|
|
|
a.batch_no batchNo, |
|
|
|
create_by as transactionBy , |
|
|
|
latest_in_date as transactionDate |
|
|
|
FROM inventory_stock A WITH(NOLOCK) |
|
|
|
WHERE A.site =#{site} and A.orderref1 = #{orderNo} AND A.part_no = #{partNo} and a.orderref0 ='生产退仓' AND a.status = '待入' |
|
|
|
|
|
|
|
select * from ( |
|
|
|
select |
|
|
|
A.site, |
|
|
|
A.bu_no as buNo, |
|
|
|
A.transaction_id as transactionId, |
|
|
|
A.document_type as documentType, |
|
|
|
A.document_no as documentNo, |
|
|
|
A.roll_no as rollNo, |
|
|
|
B.status, --标签状态 |
|
|
|
(CASE WHEN B.consumed_flag = 'Y' THEN '已消耗' ELSE '未使用' END) consumedFlag , --是否耗用 |
|
|
|
A.roll_qty as rollQty, |
|
|
|
A.batch_no as batchNo, |
|
|
|
A.transaction_by as transactionBy, |
|
|
|
A.transaction_date as transactionDate |
|
|
|
from StockTransactionLog A WITH(NOLOCK) |
|
|
|
INNER JOIN inventory_stock B WITH(NOLOCK) ON A.site = B.site AND A.roll_no = B.roll_no |
|
|
|
where A.site =#{site} and A.order_no = #{orderNo} AND a.part_no = #{partNo} and a.document_type in ('生产领料','生产退仓') |
|
|
|
UNION ALL |
|
|
|
SELECT |
|
|
|
A.site, |
|
|
|
A.bu_no buNo, |
|
|
|
A.orderref1 as transactionId, |
|
|
|
A.orderref0 as documentType, |
|
|
|
A.orderref1 as documentNo, |
|
|
|
A.roll_no rollNo, |
|
|
|
A.status, --标签状态 |
|
|
|
(CASE WHEN a.consumed_flag = 'Y' THEN '已消耗' ELSE '未使用' END) consumedFlag , --是否使用 |
|
|
|
a.qty_on_hand as rollQty, |
|
|
|
a.batch_no batchNo, |
|
|
|
create_by as transactionBy , |
|
|
|
latest_in_date as transactionDate |
|
|
|
FROM inventory_stock A WITH(NOLOCK) |
|
|
|
WHERE A.site =#{site} and A.orderref1 = #{orderNo} AND A.part_no = #{partNo} and a.orderref0 ='生产退仓' AND a.status = '待入' |
|
|
|
) T |
|
|
|
<where> |
|
|
|
<if test="transactionId != null and transactionId != ''"> |
|
|
|
and T.transactionId like concat('%', #{transactionId}, '%') |
|
|
|
</if> |
|
|
|
<if test="documentType != null and documentType != ''"> |
|
|
|
and T.documentType = #{documentType} |
|
|
|
</if> |
|
|
|
<if test="rollNo != null and rollNo != ''"> |
|
|
|
and T.rollNo like concat('%', #{rollNo}, '%') |
|
|
|
</if> |
|
|
|
<if test="status != null and status != ''"> |
|
|
|
and T.status = #{status} |
|
|
|
</if> |
|
|
|
<if test="consumedFlag != null and consumedFlag != ''"> |
|
|
|
and T.consumedFlag = #{consumedFlag} |
|
|
|
</if> |
|
|
|
</where> |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 调用存储过程 sfdcRollsOpsReportExecute 用于打开材料卷 --> |
|
|
|
|