<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="炉计划利库">
	<query id="FrmRollTubeLibraryDbk.queryPlanStoveD" desc="查询镦拔扩虚拟炉计划">
            <![CDATA[
       SELECT T.HEAT_PLAN_NO,
       T.GX_PRO_SEQ,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       DECODE(T.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭') PLANSTATUS,
       DECODE(T.PER_STATUS,'00','上料开始','10','旋扩开始','20','匀整开始','30','定径开始','40','表验开始','50','测量开始','60','交库开始') PER_STATUS,
       DECODE(T.BESIDE_STATUS,'00','上料结束','10','旋扩结束','20','匀整结束','30','定径结束','40','表验结束','50','测量结束','60','交库结束') BESIDE_STATUS,
       T.UPPER_HEATPLAN_ID,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.PROCESS_CODE_C,
       T.PROCESS_DESC_C,
       T.UPPER_PROCESS_CODE,
       T.NEXT_PROCESS_CODE,
       T.GOWHERE_CODE,
       T.GOWHERE_NAME,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       DECODE(T.ISENDGX,'1','是','/') ISENDGX,
       DECODE(T.IF_MATCH_ODD,'1','利库计划','2','组炉计划','3','精整利库','6','本工序精整利库','正常计划') IF_MATCH_ODD,
       DECODE(T.IF_DO_HEAT_PLAN,'1','是','/') IF_DO_HEAT_PLAN,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO||'/'||T.ORDER_SEQ ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.IF_EXPORT,
       T.PRIORITY,
       T.PRIORITY_MEMO,
       T.PRO_MONTH,
       TO_CHAR(TO_DATE(T.PRO_DAY, 'YYYY-MM-DD'), 'YYYY-MM-DD') PRO_DAY,
       TO_CHAR(TO_DATE(T.BAL_YEAR_MONTH, 'YYYY-MM'), 'YYYY-MM') BAL_YEAR_MONTH,
       DECODE(T.IF_MONITOR,'1','是','/') IF_MONITOR,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.BOM,
       T.WHOLE_BACKLOG,
       T.WHOLE_BACKLOG_DESC,
       T.STATION_ROAD,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       T.CRAFT_SEQ,
       T.SEC_CRAFT_FILE_NO,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.OUTNUM_CUT,
       T.AIMOUTDIAMETER,
       T.AIMWALLTHICK,
       T.AIMLENGTH,
       T.AIMLENGTH_MAX,
       T.AIMLENGTH_MIN,
       T.LEN_CUTHEAD,
       T.LEN_CUTEND,
       T.PLN_INSINGLE_NUM,
       T.PLN_INSINGLE_WT,
       T.PLN_INDOUBLE_NUM,
       T.PLN_INDOUBLE_WT,
       T.PLN_OUTSINGLE_NUM,
       T.PLN_OUTSINGLE_W,
       T.PLN_OUTDOUBLE_NUM,
       T.PLN_OUTDOUBLE_W,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.DOWNMAN,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,
       T.INDEX_SEQ,S.PLN_DIVIDE_ID,S.ZY_BATCH_ID,T.FEED_HEAT_NO,T.MEMO,T.ZY_BATCH_ID_ZG,T.DECISION,
       T.FLAG_STOVE_NO,
       (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_ZG_M Z WHERE Z.FEED_HEAT_NO=T.FEED_HEAT_NO) PLANSTATUS_GX
  FROM PLN_ZY_DBK_M T, PLN_ORDER_DBK_S S
 WHERE T.PRO_PLAN_ID = S.PRO_PLAN_ID
   AND T.GX_PLAN_NO = S.GX_PLAN_NO
              ]]>
	</query>
	<query id="FrmRollTubeLibraryDbk.queryPlanStoveDc" desc="查询镦拔扩实际炉计划">
            <![CDATA[
SELECT T.HEAT_PLAN_NO,
       T.HEAT_PLAN_SQE,
       T.JUGDE_APPLY_CODE,
       T1.ZY_BATCH_ID,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.OUTNUM_CUT,
       T.LENGTH_IN,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.PLAN_INDOUBLE_NUM,
       T.PLAN_INDOUBLE_WT,
       T.REAL_INDOUBLE_NUM,
       T.REAL_INDOUBLE_WT,
       T.REAL_OUTDOUBLE_NUM,
       T.REAL_OUTDOUBLE_WT,T.FEED_HEAT_NO, T.FLAG_STOVE_NO,T.FEED_HEAT_NO
 FROM PLN_ZY_DBK_C T,PLN_ORDER_DBK_S T1
 WHERE 1=1
  AND T.PRO_PLAN_ID=T1.PRO_PLAN_ID
 AND T.GX_PLAN_NO=T1.GX_PLAN_NO
              ]]>
	</query>
	<query id="FrmRollTubeLibraryDbk.queryPlanOrderD" desc="查询镦拔扩排产(界面)">
             <![CDATA[  
        SELECT CASE
         WHEN TO_NUMBER(NVL(DBK.WEIGTH_S, 0)) -
              TO_NUMBER(NVL(DBK.BATCHED_WT, 0)) < 0 THEN
          0
         ELSE
          TO_NUMBER(NVL(DBK.WEIGTH_S, 0)) - TO_NUMBER(NVL(DBK.BATCHED_WT, 0))
       END REALL_WT,  (SELECT COUNT(Q1.MAT_NO)
                  FROM MAT_BC_M Q1
                 WHERE Q1.PRODUCT_FLAG = '801401'
                   AND (Q1.MAT_STATUS ='80150102'  AND Q1.INSTOCK_FLAG='1' AND Q1.JUDGE_RESULT_CODE IN ('40740701','40740709') OR Q1.MAT_STATUS ='80150101'AND Q1.INSTANCY_FLAG='1')
                   AND Q1.QCM_STAUS = '00'
                     --AND Q1.LOCK_FLAG='0' AND Q1.MNG_LOCK_FLAG='0'
                   AND (CASE
                 WHEN DBK.WHOLE_BACKLOG_DESC LIKE '%轧制%' THEN
                  'D'
                 ELSE
                   ''
               END) = Q1.PROCESS_CDOE
                  AND INSTR(DECODE(DBK.E_IN_MATERIAL_NO,'',DBK.INWL_ID,DBK.E_IN_MATERIAL_NO), Q1.MATERIAL_NO) > 0
              ) AS STOCK_NUM_LIKU,
       DBK.*
  FROM (SELECT 
                  (SELECT LISTAGG(B4.E_IN_MATERIAL_NO, ',') WITHIN GROUP(ORDER BY B4.E_IN_MATERIAL_NO ASC) 
                   FROM (SELECT B.E_IN_MATERIAL_DESC,B.E_IN_MATERIAL_NO,B3.ORD_LN_DLY_PK,B.MSC_PLINE,B2.CRAFT_SEQ
                  FROM SLM_ORD_DESIGN_BOM B,
                       CRAFT_ORD_LINE_BOM B1,
                       CRAFT_ORD_DESIGN   B2,
                       PLN_SALEORD        B3
                 WHERE B.BOM = B1.BOM
                   AND B1.DESGIN_KEY = B2.DESGIN_KEY
                   AND B2.ORD_LN_PK =B3.ORD_LN_PK
                  AND B2.VALIDFLAG!='0'
                   ) B4 WHERE B4.ORD_LN_DLY_PK=T.ORD_LN_DLY_PK AND B4.MSC_PLINE=T.INDEX_SEQ AND B4.CRAFT_SEQ=T.CRAFT_SEQ) E_IN_MATERIAL_NO,
       T.PRO_ORDER_NO,
       T.PRO_PLAN_ID,
       T.GX_PLAN_NO,
       T.PLAN_GROUP_ID,
       T.ORDER_SOURCE,
       T.ORD_LN_DLY_PK,
       T.PLN_DIVIDE_ID,
       DECODE(T.ISENDGX,
              '1',
              NULLIF(T.ORDER_NO || '/' || T.ORDER_SEQ, '/'),
              T.PRO_PLAN_ID) PRO_PLAN_NO,
       NULLIF(T.ORDER_NO || '/' || T.ORDER_SEQ, '/') ORDER_NO,
       T.ORDER_SEQ,
       T.DELIVERY_NO,
       T.REQ_BL_ID,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.INWL_ID,
       T.INWL_DESC,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.WEIGTH_S,
       T.NUM_S,
       T.GX_PRO_SEQ,
       TO_CHAR(ROUND(TO_NUMBER(NVL(T.PLAN_USETIME, '0')) / 60, 2)) PLAN_USETIME,
       TO_CHAR(T.PLAN_TIME_B, 'YYYY-MM-DD HH24:MI:SS') PLAN_TIME_B,
       TO_CHAR(T.PLAN_TIME_E, 'YYYY-MM-DD HH24:MI:SS') PLAN_TIME_E,
       DECODE(T.EXE_STATUS,
              '0',
              '计划',
              '1',
              '生产中',
              '2',
              '已生产',
              '3',
              '关闭A',
              '') EXE_STATUS,
       DECODE(T.IS_REPAIR_PLN, '1', '是', '/') IS_REPAIR_PLN,
       T.REPAIR_TYPE,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.LENGTHDISC,
       T.AIMOUTDIAMETER,
       T.AIMWALLTHICK,
       T.AIMLENGTH,
       T.OUTDIAMETER_IN,
       T.WALLTHICK_IN,
       T.LENGTH_IN,
       T.LEN_CUTHEAD,
       T.LEN_CUTEND,
       T.LENGTHMAX_IN,
       T.LENGTHMIN_IN,
       T.IN_WEIGHT_S,
       T.IN_NUM_S,
       T.ADD_WT_IN,
       T.ADD_NUM_IN,
       T.MATCH_WT_IN,
       T.MATCH_NUM_IN,
       DECODE(T.ISENDGX, '1', '是', '/') ISENDGX,
       DECODE(T.IF_MONITOR_DBK, '1', '是', '/') IF_MONITOR_DBK,
       T.PRDCR_NO,
       T.MONITOR_POINT,
       T.CIC,
       T.PIC,
       T.SIC,
       T.DIC,
       T.WIC,
       T.GIC,
       T.STATION_ROAD,
      (SELECT SUM(NVL(M.PLN_INSINGLE_WT,0)) FROM PLN_ZY_DBK_M M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') BATCHED_WT,
      (SELECT SUM(NVL(M.PLN_INSINGLE_NUM,0)) FROM PLN_ZY_DBK_M M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') BATCHED_NUM,
      (SELECT SUM(NVL(M.PLAN_INDOUBLE_WT,0)) FROM PLN_ZY_DBK_C M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') Real_Batch_Wt,
      (SELECT SUM(NVL(M.PLAN_INDOUBLE_NUM,0)) FROM PLN_ZY_DBK_C M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') Real_Batch_Num,
      (SELECT SUM(NVL(M.REAL_INDOUBLE_WT,0)) FROM PLN_ZY_DBK_C M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') Real_Indouble_Wt,
      (SELECT SUM(NVL(M.REAL_INDOUBLE_NUM,0)) FROM PLN_ZY_DBK_C M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') Real_Indouble_Num,
      (SELECT SUM(NVL(M.REAL_OUTDOUBLE_WT,0)) FROM PLN_ZY_DBK_C M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') FINISHWEIGHT,
      (SELECT SUM(NVL(M.REAL_OUTDOUBLE_NUM,0)) FROM PLN_ZY_DBK_C M WHERE M.PRO_PLAN_ID=T.PRO_PLAN_ID AND M.GX_PLAN_NO=T.GX_PLAN_NO AND M.IF_FLAG='0') FINISHNUM,
       DECODE(T.IS_PLAN_OK, '1', '是', '/') IS_PLAN_OK,
       T.ZY_BATCH_ID,
       T.GRADECODE,
       T.GRADENAME,
       T.PRO_MONTH,
       T.PREVIOUS_GX,
       T.PREV_GXPLAN_ID,
       T.IF_EXPORT,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.MEMO,
       TO_CHAR(T.ISSUED_TIME, 'YYYY-MM-DD HH24:MI:SS') ISSUED_TIME,
       T.ISSUED_MAN,
       TO_CHAR(T.LAST_UNDOWN_TIME, 'YYYY-MM-DD HH24:MI:SS') LAST_UNDOWN_TIME,
       T.LAST_UNDOWN_MAN,
       T.VERSION_NO,
       T.PROCESSING_COST,
       T.TOTAL_COST,
       DECODE(T.IF_STOVE_ISSUED, '1', '是', '/') IF_STOVE_ISSUED,
       TO_CHAR(T.STOVE_ISSUED_TIME, 'YYYY-MM-DD HH24:MI:SS') STOVE_ISSUED_TIME,
       T.STOVE_ISSUED_MAN,
       DECODE(T.IS_ONLOAD_LINE, '1', '是', '/') IS_ONLOAD_LINE,
       T.WHOLE_BACKLOG_DESC,
       T.MSC,
       T.INDEX_SEQ,
       T.BOM,
       S.PRODUCCODE,
       S.PRODUCNAME,
       S.STD_CODE,
       S.STD_NAME,
       S.STD_STYLE_DESC,
       T2.ORDER_SPEC_CODE,
       T2.ORDER_SPEC_DESC,
       S.SPEC_CODE,
       S.SPEC_NAME,
       S.STEELCODE,
       S.STEELNAME,
       S.SUPPLY_UNIT_CODE,
       S.SUPPLY_UNIT,
       (SELECT LV.CRAFT_PATH
          FROM CRAFT_FILE_LV2 LV
         WHERE INSTR(T2.CRAFT_FILE_LV2_E, LV.PK) > 0
           AND INSTR(LV.PLINE_CODE, T.PLINE_CODE) > 0
           AND LV.VALIDFLAG = '1'
           AND LV.PROCESS_CODE = 'E') CRAFT_FILE_LV2_G,
       NVL(T.WEIGTH_S_MIN, 0) MIN_WGT,
       (SELECT CD.CRAFT_PATH
          FROM CRAFT_ORD_DESIGN CD
         WHERE CD.ORD_LN_PK = T2.ORD_LN_PK
           AND CD.CRAFT_SEQ = T.CRAFT_SEQ) CRAFT_PATH,
       T.CRAFT_SEQ,
       T.CRAFT_FILE_NO,
       T.CRAFT_FILE_MAN,
       (SELECT T9.BASENAME
          FROM COM_BASE_INFO T9
         WHERE T9.BASECODE = T.PRIORITY) PRIORITY,
       T.PRIORITY_MEMO, T.DECISION,
           (SELECT SUM(NVL(Z.PLANS_NUM, 0))
          FROM PLN_ORDER_ZG_S  Z
         WHERE Z.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
           AND Z.PLN_DIVIDE_ID = T.PLN_DIVIDE_ID) OUTPUT_NUM,
      (Select  TO_CHAR(MIN(Z.PLAN_TIME_B),'YYYY-MM-DD HH24:MI:SS') from PLN_ORDER_ZG_S Z where Z.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK AND Z.PLN_DIVIDE_ID = T.PLN_DIVIDE_ID) zg_Start_Time
      
  FROM PLN_ORDER_DBK_S T,
       (SELECT Q1.ORDER_SPEC_CODE,
               Q1.ORDER_SPEC_DESC,             
               Q2.ORD_LN_DLY_PK,
               Q2.ORD_LN_PK,              
               Q1.DELVRY_RANGE_TPE,
               Q1.DELVRY_RANGE_MAX,
               Q1.DELVRY_RANGE_MIN,
               Q2.DELVRY_QTY,
               Q4.CRAFT_NAME,
               Q3.CRAFT_FILE_LV2_E
          FROM SLM_ORDER_LINE           Q1,
               SLM_ORDER_LINE_DELIVERY  Q2,
               CRAFT_ORD_DESIGN         Q3,
               CRAFT_ORD_DESIGN_APPOINT Q4
         WHERE Q1.ORD_LN_PK = Q2.ORD_LN_PK
           AND Q1.ORD_LN_PK = Q4.ORD_LN_PK(+)
           AND Q1.ORD_LN_PK = Q3.ORD_LN_PK(+)
           AND Q3.VALIDFLAG(+) = '1') T2,
       PLN_SALEORD S
 WHERE T.ORD_LN_DLY_PK = T2.ORD_LN_DLY_PK(+)
   AND T.ORD_LN_DLY_PK = S.ORD_LN_DLY_PK
   AND (T.IS_REPAIR_PLN IS NULL OR T.IS_REPAIR_PLN = '0')
               ]]>
	</query>
	<query id="FrmRollTubeLibraryDbk.getStlChemicalStd" desc="查询镦拔扩对应内控成分元素">
            <![CDATA[
             SELECT V.CHEM_CODE,
             V.CHEM_NAME,
             V.CHEM_TYPE,
             V.CHEM_FORMULA,
             V.STDMIN_SIGN || V.STDMIN STDMIN_SIGN,
             V.STDMAX_SIGN || V.STDMAX STDMAX_SIGN,
             V.STDTARGET,
             C.CHEM_SEQ,V.CIC
        FROM CRAFT_ORD_DESIGN_STD_CIC V, COM_BASE_CHEM C
       WHERE V.CHEM_CODE = C.CHEM_CODE
          AND INSTR(?, V.CIC) > 0
         AND V.PROCESS_CODE = 'A'
         AND V.DESGIN_KEY = ?
         AND V.MSC_PLINE = ?
         AND V.SPECL_FL = '2'
         AND V.VALIDFLAG = '1'
         ORDER BY V.CIC,C.CHEM_SEQ ASC
             ]]>
	</query>
	<query id="FrmRollTubeLibraryDbk.getPlnOrderZg" desc="查询镦拔扩信息">
            <![CDATA[
            SELECT D.DESGIN_KEY, T.CRAFT_SEQ, T.CIC_GP, T.INDEX_SEQ,T.OUTWL_ID,T.INWL_ID,T.PLINE_CODE, T.CIC_GROUP_LK
                  FROM PLN_ORDER_ZG_S T, PLN_SALEORD T1, CRAFT_ORD_DESIGN D
                 WHERE T1.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
                   AND D.ORD_LN_PK = T1.ORD_LN_PK
                   AND D.CRAFT_SEQ = T.CRAFT_SEQ
                   AND T.PRO_PLAN_ID =?
                   AND T.GX_PLAN_NO = ?
             ]]>
	</query>
	<query id="FrmRollTubeLibraryDbk.getStlChemicalData" desc="查询判定表成分元素">
            <![CDATA[
           SELECT T2.C,
       T2.SI,
       T2.MN,
       T2.P,
       T2.S,
       T2.NI,
       T2.CR,
       T2.CU,
       T2.ASN,
       T2.TI,
       T2.V,
       T2.MO,
       T2.B,
       T2.W,
       T2.AL,
       T2.ZN,
       T2.PB,
       T2.SN,
       T2.CA,
       T2.LA,
       T2.SB,
       T2.CE,
       T2.SE,
       T2.MG,
       T2.NB,
       T2.CD,
       T2.BI,
       T2.N,
       T2.H,
       T2.O,
       T2.FE,
       T2.ALT,
       T2.ALS,
       T2.ALINS,
       T2.BS,
       T2.BN,
       T2.MGO,
       T2.SIO2,
       T2.AL2O3,
       T2.TFEO,
       T2.FE2O3,
       T2.H2O,
       T2.CAF2,
       T2.P2O5,
       T2.TFE,
       T2.CR2O3,
       T2.TIO2,
       T2.MNO,
       T2.V2O5,
       T2.FEO,
       T2.CAO,
       T2.ZR,
       T2.CO,
       T2.SAMPLE_NO,
       T2.ASSAYNO,
       T2.STOVE_NO
  FROM QCM_JHY_ELEMENTS T2,
       QCM_LG_CHEMJUDGE T1,
       (SELECT T.JUDGE_STOVE_NO, T.CHEM_JUDGE_ID
          FROM MAT_GP_M T
         WHERE T.CHEM_JUDGE_ID IS NOT NULL
         GROUP BY T.JUDGE_STOVE_NO, T.CHEM_JUDGE_ID) M
 WHERE M.CHEM_JUDGE_ID= T1.CHEM_JUDGE_ID
   AND M.JUDGE_STOVE_NO = T1.JUDGE_STOVE_NO
   AND T1.ASSAYNO=T2.ASSAYNO
   AND T2.VALIDFLAG = '1'
   AND T1.VALIDFLAG = '1'
   AND T1.JUDGE_STOVE_NO = ?
   AND T1.CHEM_JUDGE_ID= ?
 ORDER BY T2.CREATE_TIME DESC
             ]]>
	</query>
	<query id="FrmRollTubeLibraryDbk.queryMatGpTrack" desc="查询脱单利库记录">
            <![CDATA[
 SELECT 
       T.EVENT_ID,
       T.EVENT_DESC,
       T.FORM_NAME,
       T.CALL_FUNC_CODING,
       T.KEYVALUE_1,
       T.KEYVALUE_1_DESC,
       T.KEYVALUE_2,
       T.KEYVALUE_2_DESC2,
       T.KEYVALUE_3,
       T.KEYVALUE_3_DESC3,
       T.KEYVALUE_4,
       T.KEYVALUE_4_DESC4,
       T.KEYVALUE_5,
       T.KEYVALUE_5_DESC5,
       T.KEYVALUE_6,
       T.KEYVALUE_6_DESC6,
       T.KEYVALUE_7,
       T.KEYVALUE_7_DESC7,
       (SELECT I.BASENAME
          FROM COM_BASE_INFO I
         WHERE I.BASECODE = T.PRODUCT_FLAG) PRODUCT_FLAG,
       (SELECT I.BASENAME
          FROM COM_BASE_INFO I
         WHERE I.BASECODE = T.MAT_STATUS) MAT_STATUS,
       T.LOT_NO,
       T.STOVE_NO,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.ACT_LEN,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       T.ACT_COUNT,
       T.ACT_WEIGHT,
       T.ACT_THEORY_WEIGHT,
       T.PRO_ORDER_NO,
       T.PRO_ORDER_ID,
       T.PRO_ORDER_NO1,
       T.PRO_ORDER_ID1,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORD_LN_DLY_PK,
       T.ORDER_NO,
       T.ORDER_SEQ,
       T.ORDER_SEQ_NO,
       T.OLD_ORD_PK,
       T.OLD_ORD_LN_PK,
       T.OLD_ORD_LN_DLY_PK,
       T.OLD_ORDER_NO,
       T.OLD_ORDER_SEQ,
       T.OLD_ORDER_SEQ_NO,
       T.BELONG_CODE,
       T.BELONG_NAME,
       T.MEMO,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.DEPARTMENT_CODE,
       T.DEPARTMENT_DESC,
       T.MANAGEMENT_NO,
       T.MANAGEMENT_NAME,
       T.PROCESS_CDOE,
       T.GRADECODE,
       T.GRADENAME
 FROM MAT_BC_TRACK T
 WHERE T.EVENT_ID like '%'||? ||'%' AND T.JUDGE_STOVE_NO like '%'||? ||'%' 
  AND T.PROCESS_CDOE='E'
  ORDER BY T.CREATE_NAME DESC
             ]]>
	</query>
	<query id="FrmRollTubeLibraryDbk.getPlnMatBcDbk" desc="查询镦拔扩信息">
            <![CDATA[
            SELECT *
  FROM (SELECT T.*
          FROM MAT_BC_M T
         WHERE T.JUDGE_STOVE_NO = ?
           AND T.BATCH_NO = ?
           AND T.BATCH_GROUD_NO = ?
           AND NVL(T.JUGDE_APPLY_CODE,'/') = NVL(?,'/')
           AND T.QCM_STAUS='00'
           AND T.HANGING_FLAG='1'
           AND T.HEAT_PLAN_NO_NEXT=?
         ORDER BY T.MAT_NO ASC)
 WHERE ROWNUM <= ?
             ]]>
	</query>
</queryMap>