|
|
|
@ -384,5 +384,35 @@
|
|
|
|
|
#{item.id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</update>
|
|
|
|
|
<select id="WmsProductPutByWorkOrderqueryBS" resultMap="WmsProductPutResult">
|
|
|
|
|
SELECT
|
|
|
|
|
mes_report_work.report_code work_order,
|
|
|
|
|
pro_order_workorder.workorder_code_sap product_order,
|
|
|
|
|
mes_report_work.product_code,
|
|
|
|
|
mes_report_work.product_name,
|
|
|
|
|
mes_report_work.unit unit_of_measure,
|
|
|
|
|
mes_report_work.batch batch_number,
|
|
|
|
|
mes_report_work.quantity plan_quantity,
|
|
|
|
|
( mes_report_work.quantity- put.put_quantity ) attr3
|
|
|
|
|
FROM
|
|
|
|
|
pro_order_workorder
|
|
|
|
|
LEFT JOIN mes_report_work ON pro_order_workorder.workorder_code = mes_report_work.workorder_code
|
|
|
|
|
LEFT JOIN (
|
|
|
|
|
SELECT SUM
|
|
|
|
|
( wms_product_put.put_quantity ) AS put_quantity,
|
|
|
|
|
wms_product_put.work_order AS work_order,
|
|
|
|
|
wms_product_put.product_code AS product_code
|
|
|
|
|
FROM
|
|
|
|
|
wms_product_put
|
|
|
|
|
GROUP BY
|
|
|
|
|
wms_product_put.work_order,
|
|
|
|
|
wms_product_put.product_code
|
|
|
|
|
) put ON put.work_order= mes_report_work.report_code
|
|
|
|
|
AND put.product_code= pro_order_workorder.workorder_code_sap
|
|
|
|
|
WHERE
|
|
|
|
|
pro_order_workorder.workorder_code_sap=#{attribute1}
|
|
|
|
|
AND mes_report_work.batch=#{attribute2}
|
|
|
|
|
AND mes_report_work.parent_order = '0'
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|