<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc = "管坯申请用车">
<query id = "FrmGpM.doQuery" desc = "查询管坯库存">
    SELECT T.STOVE_NO,
    T.JUDGE_STOVE_NO,
    T.MATERIAL_NO,
    T.MATERIAL_NAME,
    T.GRADECODE,
    T.GRADENAME,
    T.STD_CODE,
    T.STD_NAME,
    T.PRO_ORDER_NO,
    T.PLINE_CODE,
    T.PLINE_NAME,
    T.DIMATER,
    T.FIX_LEN,
    MAX(T.ACT_LEN) ACT_LEN,
    SUM(T.ACT_COUNT) ACT_COUNT,
    SUM(T.ACT_WEIGHT) ACT_WEIGHT,
    (SELECT C.STORAGE_NAME
    FROM YDM_BS_STORAGE C
    WHERE C.STORAGE_NO = S.STORAGE_NO) STORAGE_NAME,
    S.STORAGE_NO,
    T.FLAG_STOVE_NO,
    T.FURNACENO,
    T.SEQUENCENO
    FROM MAT_GP_M T, YDM_GP_BUTTRESS S
    WHERE T.MAT_NO = S.MAT_NO
    AND T.QCM_STAUS = '00'
</query>
    <query id = "FrmStuffMoveOut.doQueryWeight" desc = "查询重量">
        <![CDATA[
SELECT NVL(SUM(T.ACT_WEIGHT),0)ACT_WEIGHT
  FROM MAT_GP_M T, YDM_GP_BUTTRESS S
 WHERE T.MAT_NO = S.MAT_NO
   AND NVL(T.STOVE_NO, '/') = NVL('#STOVE_NO#', '/')
   AND T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(S.STORAGE_NO, '/') = NVL('#STORAGE_NO#', '/')
   AND T.QCM_STAUS = '00'
   AND ROWNUM <= #ACT_COUNT#
 ORDER BY T.MAT_NO DESC
 ]]>
    </query>
</queryMap>