<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="炉计划利库">
	<query id="FrmRollTubeLibraryJg.queryPlanStoveD" desc="查询接箍虚拟炉计划">
            <![CDATA[
        SELECT 
       T.HEAT_PLAN_NO,
       T.PRO_PLAN_ID,
       T.JG_GROUP_ID,
       T.GX_PLAN_NO,
       T.JUDGE_STOVE_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.CODE_JG_BL,
       T.BL_WL_ID,
       T.BL_WL_DESC,
       T.STEELCODE,
       T.STEELNAME,
       T.GRADECODE,
       T.GRADENAME,
       T.MIN_D,
       T.MIN_H,
       T.AIMLENGTH_BL,
       T.AIM_CUT_LEN,
       T.LENGTH_MIN,
       T.LENGTH_MAX,
       T.TAPER,
       T.CODE_JG,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.SPEC_JG,
       T.SPEC_JG_DESC,
       T.STYLE_JG,
       T.DIAMETER,
       T.CHECK_J_VAL,
       T.AIMLENGTH,
       T.SINGLEWEIGHT,
       T.COAT_TYPE,
       T.PLAN_JG_NUM,
       T.PLAN_BL_NUM,
       T.PLAN_BL_WT,
       T.MONITORDEMAND,
        DECODE(T.IF_MONITOR_JG,'1','是','/') IF_MONITOR_JG,
       T.PRDCR_NO,
       T.CUT_MACH_GRP_NO,
       T.CUT_MACH_GRP_NM,
       T.DEMAND_COPPER,
       T.LATHE_GRP_NO,
       T.LATHE_GRP_NM,
       T.DEMAND_DETECTION,
       T.DEMAND_BLAST,
       T.DEMAND_BONDERIZING,
         DECODE(T.PLANSTATUS,
              '00',
              '计划',
              '10',
              '下发',
              '20',
              '生产中',
              '30',
              '生产完成',
              '40',
              '关闭') PLANSTATUS,
       T.MEMO,
       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.CUST_ALPHA_NO,
       T.ORDER_SPECIAL_DESC,
       T.ALPHA_CODE,
       T.CRAFT_FILE_NO,
       T.CRAFT_SEQ,
       T.ORD_LN_DLY_PK,
       T.SINGLE_CUT_NUN,
       DECODE(T.IF_MATCH_ODD,'0','正常计划','1','利库计划') IF_MATCH_ODD,
       DECODE(T.IF_DO_HEAT_PLAN,'1','是','/') IF_DO_HEAT_PLAN,
       T.OUTWL_ID,
       T.OUTWL_DESC,
       T.STOVE_NO,
       T.FLAG_STOVE_NO,
       T.FEED_HEAT_NO,
       T.GX_PRO_SEQ,
       T.PRO_DAY,
       T.BAL_YEAR_MONTH,
       T.PROD_STANDARD,
       T.OUTPUT_STANDARD,
       T.UPPER_HEATPLAN_ID,
       T.UPPER_PROCESS_CODE,
       T.STD_CODE,
       T.STD_NAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.PRODUCCODE_JG,
       T.PRODUCCODE_JG_DESC,
       T.DOWNMAN,
       S.DECISION,
       TO_CHAR(T.DOWNTIME, 'YYYY-MM-DD HH24:MI:SS') DOWNTIME,
       S.PLN_DIVIDE_ID,
        CASE WHEN T.UPPER_PROCESS_CODE='D' THEN
       (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_ZG_M Z WHERE Z.FEED_HEAT_NO=T.JUDGE_STOVE_NO) 
       WHEN T.UPPER_PROCESS_CODE='E' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_DBK_M Z WHERE Z.JUDGE_STOVE_NO=T.JUDGE_STOVE_NO) 
           WHEN T.UPPER_PROCESS_CODE='F' THEN 
          (SELECT MAX(DECODE(Z.PLANSTATUS,'00','计划','10','下发','20','生产中','30','生产完成','40','关闭')) FROM PLN_ZY_RCL_M Z WHERE Z.JUDGE_STOVE_NO=T.JUDGE_STOVE_NO) 
         ELSE
           ''
           END PLANSTATUS_GX,
           T.FLAG_STOVE_NO,T.MEMO,
            (SELECT DECODE(MIN(S1.EXE_STATUS),
                      '0',
                      '计划',
                      '1',
                      '生产中',
                      '2',
                      '已生产',
                      '3',
                      '关闭')
          FROM PLN_ORDER_JGX_S S1, PLN_ORDER_JG J, PLN_JG_AND_BL B
 WHERE J.PRO_PLAN_ID = B.PRO_PLAN_ID
   AND S1.ORD_LN_DLY_PK = J.ORD_LN_DLY_PK
   AND B.REQ_BL_ID = S.ORD_LN_DLY_PK) CP_EXE_STATUS  
  FROM PLN_ZY_JG_M T, PLN_GX_JG_PROP_S S
 WHERE T.PRO_PLAN_ID = S.PRO_PLAN_ID
   AND T.GX_PLAN_NO = S.GX_PLAN_NO
              ]]>
	</query>
	<query id="FrmRollTubeLibraryJg.queryPlanStoveDc" desc="查询接箍实际炉计划">
            <![CDATA[
 SELECT 
       T.HEAT_PLAN_NO,
       T.HEAT_PLAN_SQE,
       T.JUGDE_APPLY_CODE,
       T.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.FLAG_STOVE_NO,
       T.OUT_JG_NUM,
       T.USE_BL_NUM,
       T.USE_BL_WT,
       T.REAL_INDOUBLE_NUM,
       T.REAL_INDOUBLE_WT,
       T.REAL_OUTDOUBLE_NUM,
       T.REAL_OUTDOUBLE_WT
     
 FROM PLN_ZY_JG_C T
 WHERE 1=1
              ]]>
	</query>
	<query id="FrmRollTubeLibraryJg.queryPlanOrderD" desc="查询接箍排产(界面)">
             <![CDATA[  
     SELECT CASE
         WHEN TO_NUMBER(NVL(JG.GROUP_BL_WT_S, 0)) -
              TO_NUMBER(NVL(JG.BATCHED_WT, 0)) < 0 THEN
          0
         ELSE
          TO_NUMBER(NVL(JG.GROUP_BL_WT_S, 0)) -
          TO_NUMBER(NVL(JG.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 INSTR(JG.BL_WL_ID, Q1.MATERIAL_NO) > 0
           AND Q1.ACT_DIMATER >= (SELECT S2.MIN_D_CP FROM COM_MSC_JG S2 WHERE S2.CODE_JG = JG.CODE_JG)
           AND (Q1.ACT_DIMATER - 2*Q1.ACT_HEIGHT) <= (SELECT S3.MAX_D_CP FROM COM_MSC_JG S3 WHERE S3.CODE_JG = JG.CODE_JG)
           AND (Q1.STEELCODE = JG.STEELCODE OR INSTR((SELECT listagg(STEELCODE_JG,';') WITHIN GROUP(ORDER BY STEELCODE_JG)
          FROM COM_MSC_JG_R_STEEL
         WHERE STEELCODE = JG.STEELCODE), Q1.STEELCODE) > 0)
           ) AS STOCK_NUM_LIKU,
           (SELECT COUNT(Q2.MAT_NO)
          FROM MAT_BC_M Q2
         WHERE Q2.PRODUCT_FLAG = '801401'
           AND (Q2.MAT_STATUS ='80150102'  AND Q2.INSTOCK_FLAG='1' AND Q2.JUDGE_RESULT_CODE IN ('40740701','40740709') OR Q2.MAT_STATUS ='80150101'AND Q2.INSTANCY_FLAG='1')
           AND Q2.QCM_STAUS = '00'
           AND INSTR(JG.BL_WL_ID, Q2.MATERIAL_NO) > 0
           ) AS MA_NUM_MAT,
       JG.*,  NVL(CASE
         WHEN JG.EXPECT_NUM > 0 THEN
          TO_NUMBER(JG.EXPECT_NUM) - TO_NUMBER(JG.WORK_NUM_TRANTA) -
          TO_NUMBER(0)
         ELSE
          TO_NUMBER(JG.PLANS_NUM) - TO_NUMBER(JG.WORK_NUM_TRANTA) -
          TO_NUMBER(0)
       END,0) WORK_BILL,
       (SELECT listagg(STEELCODE_JG,';') WITHIN GROUP(ORDER BY STEELCODE_JG)
          FROM COM_MSC_JG_R_STEEL
         WHERE STEELCODE = JG.STEELCODE) REP_STEEL_CODE,

         (SELECT listagg(STEELCODE_JG_DESC,';') WITHIN GROUP(ORDER BY STEELCODE_JG_DESC)
          FROM COM_MSC_JG_R_STEEL
         WHERE STEELCODE = JG.STEELCODE) REP_STEEL_NAME
  FROM (SELECT T.PRO_PLAN_ID,
               T.JG_GROUP_ID,
               T.GX_PLAN_NO,
               T.PLINE_CODE,
               T.PLINE_NAME,
               T.GX_PRO_SEQ,
               T.CODE_JG,
               T.SPEC_JG_DESC,
               T.CODE_JG_BL,
               T.STEELCODE,
               T.STEELNAME,
               T.GRADECODE,
               T.GRADENAME,
               T.BL_WL_ID,
               T.BL_WL_DESC,
               T.MIN_D,
               T.MIN_H,
               T.AIMLENGTH_BL,
               T.AIM_CUT_LEN,
               T.LENGTH_MIN,
               T.LENGTH_MAX,
               T.TAPER,
               T.MODEL_CODE,
               T.MODEL_DESC,
               T.DEMAND_DETECTION,
               T.DEMAND_BONDERIZING,
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = T.DEMAND_COPPER) DEMAND_COPPER,
               T.DEMAND_BLAST,
               T.GROUP_NUM_S,
               T.SINGLE_CUT_NUN,
               T.GROUP_BL_NUM_S,
               T.GROUP_BL_WT_S,
               DECODE(T.IS_PLAN_OK, '1', '是', '/') IS_PLAN_OK,
               T.MATCHNUM_JG,
               T.PRO_MONTH,
               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,
               
               T.MATCHWT_BL,
               T.MATCHNUM_BL,
               (SELECT SUM(M.PLAN_BL_NUM)
                  FROM PLN_ZY_JG_M M
                 WHERE M.PRO_PLAN_ID = T.PRO_PLAN_ID
                   AND M.GX_PLAN_NO = T.GX_PLAN_NO) BATCHED_NUM,
               (SELECT SUM(M.PLAN_BL_WT)
                  FROM PLN_ZY_JG_M M
                 WHERE M.PRO_PLAN_ID = T.PRO_PLAN_ID
                   AND M.GX_PLAN_NO = T.GX_PLAN_NO) BATCHED_WT,
               (SELECT SUM(M.PLAN_JG_NUM)
                  FROM PLN_ZY_JG_M M
                 WHERE M.PRO_PLAN_ID = T.PRO_PLAN_ID
                   AND M.GX_PLAN_NO = T.GX_PLAN_NO) BATCHED_NUM_OUT,
               (SELECT SUM(C.USE_BL_WT)
                  FROM PLN_ZY_JG_C C, PLN_ZY_JG_M M
                 WHERE C.HEAT_PLAN_NO = M.HEAT_PLAN_NO
                   AND M.PRO_PLAN_ID = T.PRO_PLAN_ID
                   AND M.GX_PLAN_NO = T.GX_PLAN_NO) REAL_BATCHED_WT,
               (SELECT SUM(C.USE_BL_NUM)
                  FROM PLN_ZY_JG_C C, PLN_ZY_JG_M M
                 WHERE C.HEAT_PLAN_NO = M.HEAT_PLAN_NO
                   AND M.PRO_PLAN_ID = T.PRO_PLAN_ID
                   AND M.GX_PLAN_NO = T.GX_PLAN_NO) REAL_BATCHED_NUM,
               (SELECT SUM(C.OUT_JG_NUM)
                  FROM PLN_ZY_JG_C C, PLN_ZY_JG_M M
                 WHERE C.HEAT_PLAN_NO = M.HEAT_PLAN_NO
                   AND M.PRO_PLAN_ID = T.PRO_PLAN_ID
                   AND M.GX_PLAN_NO = T.GX_PLAN_NO) PRODUCED_NUM,
               DECODE(T.EXE_STATUS,
                      '0',
                      '计划',
                      '1',
                      '生产中',
                      '2',
                      '已生产',
                      '3',
                      '关闭A',
                      '') EXE_STATUS,
               DECODE(T.IS_REPAIR_PLN, '1', '是', '/') IS_REPAIR_PLN,
               T.REPAIR_TYPE,
               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.PROCESSING_COST,
               T.TOTAL_COST,
               DECODE(T.IF_MONITOR_JG, '1', '是', '/') IF_MONITOR_JG,
               T.PRDCR_NO,
               TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
               DECODE(T.IS_STOVE_ISSUED, '1', '是', '/') IS_STOVE_ISSUED,
               TO_CHAR(T.STOVE_ISSUED_TIME, 'YYYY-MM-DD HH24:MI:SS') STOVE_ISSUED_TIME,
               T.STOVE_ISSUED_MAN,
               T.ORD_LN_DLY_PK,
               T.PLN_DIVIDE_ID,
               T.SPEC_JG,
               T.GROUP_WT_S,
               T.REQ_BL_ID,
               T.OUTWL_ID,
               T.OUTWL_DESC,
               T.MONITOR_POINT,
               T.CRAFT_FILE_NO,
               T.CRAFT_FILE_MAN,
               T.CRAFT_SEQ,
               T.STATION_ROAD,
               T.VERSION_NO,
               (SELECT CD.CRAFT_PATH
                  FROM CRAFT_ORD_DESIGN CD
                 WHERE CD.ORD_LN_PK = T.CODE_JG_BL
                   AND CD.CRAFT_SEQ = T.CRAFT_SEQ) CRAFT_PATH,
               T.STD_CODE,
               T.STD_NAME,
               T.STD_STYLE,
               T.STD_STYLE_DESC,
               T.PRODUCCODE_JG,
               T.PRODUCCODE_JG_DESC,
               T.DECISION,
               T.MEMO,
               (SELECT T1.BASENAME
                  FROM COM_BASE_INFO T1
                 WHERE T1.BASECODE = T.STYLE_JG) STYLE_JG,
               T.CODE_BL_ALL,
               FUN_GETGRADEBYBLCODE(T.CODE_BL_ALL)GRADE_NAME_ALL,
               NVL((SELECT SUM(W.PLAN_JG_NUM)
                     FROM PLN_ZY_JG_WORKBILL W, PLN_GX_JG_PROP_C JGC
                    WHERE W.KEY = JGC.KEY
                      AND JGC.PRO_PLAN_ID = T.PRO_PLAN_ID
                      AND W.ZY_BILL_STATUS IN ('0', '1', '2')),
                   0) WORK_NUM_TRANTA,
                   T2.EXPECT_NUM,
                   T2.PLANS_NUM,
                   T2.PLN_INSINGLE_NUM,
                   (SELECT GET_JG_PRDCR_ADVC_DAY(T.PRO_PLAN_ID) FROM DUAL) PRDCR_ADVC_DAY,
                     DECODE(T.IF_MONITOR_BL, '1', '是', '/') IF_MONITOR_BL,
                     (SELECT SUM(NVL(ZG.FINISHNUM,0) * NVL(ZG.OUTNUM_CUT,0))
          FROM PLN_ORDER_ZG_S ZG
         WHERE ZG.ORD_LN_DLY_PK = T.ORD_LN_DLY_PK
           AND ZG.PLN_DIVIDE_ID = T.PLN_DIVIDE_ID) FINISHNUM,   T2.CP_PLAN_TIME_B,T.ORDER_SOURCE,
               (SELECT DECODE(MIN(S1.EXE_STATUS),
                      '0',
                      '计划',
                      '1',
                      '生产中',
                      '2',
                      '已生产',
                      '3',
                      '关闭')
          FROM PLN_ORDER_JGX_S S1, PLN_ORDER_JG J, PLN_JG_AND_BL B
 WHERE J.PRO_PLAN_ID = B.PRO_PLAN_ID
   AND S1.ORD_LN_DLY_PK = J.ORD_LN_DLY_PK
   AND B.REQ_BL_ID = T.ORD_LN_DLY_PK
   AND J.PRO_PLAN_ID_S=T.PRO_PLAN_ID) CP_EXE_STATUS  
          FROM PLN_GX_JG_PROP_S T,
               (SELECT SUM(T3.EXPECT_NUM) EXPECT_NUM,
                       SUM(T3.PLANS_NUM) PLANS_NUM,
                       SUM(T3.PLN_INSINGLE_NUM) PLN_INSINGLE_NUM,
                       T3.PRO_PLAN_ID,
                        MIN(T3.PLAN_TIME_B) CP_PLAN_TIME_B
                  FROM (SELECT SUM((SELECT SUM(M.PLN_OUTSINGLE_NUM)
                                     FROM PLN_ZY_ZG_M M, PLN_ORDER_ZG_S ZG
                                    WHERE M.PRO_PLAN_ID = ZG.PRO_PLAN_ID
                                      AND M.GX_PLAN_NO = ZG.GX_PLAN_NO
                                      AND ZG.ORD_LN_DLY_PK = S.ORD_LN_DLY_PK
                                      AND ZG.PLN_DIVIDE_ID = S.PLN_DIVIDE_ID)) EXPECT_NUM,
                               SUM((SELECT NVL(SUM(ZG.PLANS_NUM), 0)
                                     FROM PLN_ORDER_ZG_S ZG
                                    WHERE ZG.ORD_LN_DLY_PK = S.ORD_LN_DLY_PK
                                      AND ZG.PLN_DIVIDE_ID = S.PLN_DIVIDE_ID)) PLANS_NUM,
                               T1.KEY,
                               T1.PRO_PLAN_ID,
                               (SELECT SUM(M.PLN_INSINGLE_NUM)
                                  FROM PLN_ZY_JGX_M M
                                 WHERE M.PRO_PLAN_ID = JS.PRO_PLAN_ID
                                   AND M.GX_PLAN_NO = JS.GX_PLAN_NO) PLN_INSINGLE_NUM,
                                     MIN(JS.PLAN_TIME_B) PLAN_TIME_B
                          FROM PLN_SALEORD_PROC S,
                               PLN_ORDER_JG     J,
                               PLN_ORDER_JGX_S  JS,
                               PLN_GX_JG_PROP_C T1,
                               PLN_SALEORD      S1
                         WHERE S.ORD_LN_DLY_PK = J.ORD_LN_DLY_PK
                           AND S1.ORD_LN_DLY_PK = JS.ORD_LN_DLY_PK
                           AND JS.ORD_LN_DLY_PK = S.ORD_LN_DLY_PK
                           AND JS.PLN_DIVIDE_ID = S.PLN_DIVIDE_ID
                           AND JS.EXE_STATUS IN ('0','1')
                           AND J.KEY = T1.KEY
                         GROUP BY T1.KEY,T1.PRO_PLAN_ID,
                                  JS.PRO_PLAN_ID,
                                  JS.GX_PLAN_NO) T3
                 GROUP BY  T3.PRO_PLAN_ID) T2
         WHERE 1 = 1
           AND (T.IS_REPAIR_PLN IS NULL OR T.IS_REPAIR_PLN = '0')
          AND T.PRO_PLAN_ID = T2.PRO_PLAN_ID(+)
               ]]>
	</query>
	<query id="FrmRollTubeLibraryJg.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="FrmRollTubeLibraryJg.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="FrmRollTubeLibraryJg.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="FrmRollTubeLibraryJg.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='H'
  ORDER BY T.CREATE_NAME DESC
             ]]>
	</query>
	<query id="FrmRollTubeLibraryJg.getPlnMatBcDbk" desc="查询接箍信息">
            <![CDATA[
            SELECT *
  FROM (SELECT T.*
          FROM MAT_BC_M T
         WHERE T.JUDGE_STOVE_NO = ?
           AND T.BATCH_NO = ?
           AND NVL(T.BATCH_GROUD_NO,'/') = NVL(?,'/')
           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>
	<query id = "FrmRollTubeLibraryJg.getJgDim" desc  = "查询接箍码产数">
		SELECT T.MIN_D_CP,T.MAX_D_CP FROM COM_MSC_JG T WHERE T.CODE_JG = ?
	</query>
	<query id = "FrmRollTubeLibraryJg.updateMemo" desc = "修改备注">
		UPDATE PLN_GX_JG_PROP_S T
		SET T.MEMO = '#MEMO#'
		WHERE T.PRO_PLAN_ID = '#PRO_PLAN_ID#'
		AND T.GX_PLAN_NO = '#GX_PLAN_NO#'
	</query>
</queryMap>