<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="接箍公共信息">
	<query id="FrmJGMatNoReport.doQueryInfoResult" desc="查询接箍材料信息">		
        <![CDATA[
 SELECT T.MAT_NO,
       T.RESULT_NO,
       T.ZY_PLAN_ID,
       T.WO_ID,
       T1.PRO_PLAN_ID,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BL_WL_ID,
       T.BL_WL_DESC,
       T.MIN_D,
       T.MIN_H,     
       T.CODE_JG,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       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.MONITORDEMAND,
       T.IF_MONITOR_JG,
       T.PRDCR_NO,
       T.PRODUCER,
       T1.MACH_NO,
       T1.MACH_NM,
       T.PRO_NUM,
       T.PRO_WT,
       TO_CHAR(T.RRO_TIME, 'YYYY-MM-DD HH24:MI:SS') RRO_TIME,
       DECODE(T.PRO_GROUP, '1', '甲', '2', '乙', '3', '丙', '4', '丁') PRO_GROUP,
       DECODE(T.PRO_SHIFT, '0', '常白', '1', '早', '2', '中', '3', '夜') PRO_SHIFT,
       T1.CUST_ALPHA_NO,
       T1.ORDER_SPECIAL_DESC,
       T1.ALPHA_CODE,
       T.COL_OPERATOR,   
       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,
       T1.KEP_NO,
       (SELECT B.STORAGE_NAME
          FROM YDM_BS_STORAGE B
         WHERE B.STORAGE_NO = T1.STORAGE_NO
           AND B.VALIDFLAG = '1') STORAGE_NO,
       T1.LOCATION_NO
  FROM COUPLING_MAT_M T, COUPLING_MAT_BUTTRESS T1
 WHERE T.MAT_NO = T1.MAT_NO
        ]]>
	</query>
	<query id="FrmJGMatNoReport.doQueryLoadResult" desc="查询接箍上料台账">
        <![CDATA[
   SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       M.JUDGE_STOVE_NO,
       T.BATCH_NO,
       M.PRDCR_NO,
       T.WO_ID,
       M.MIN_D,
       M.MIN_H,
       T.GRADENAME,
       T.STEELNAME,
       T.SPEC_JG_DESC,
       T.STD_NAME,
       T.STD_STYLE_DESC,
       T.PRODUCCODE_JG_DESC,
       T.MODEL_DESC,
       M.BUYER_NAME,
       T.IS_AUDITE,
       DECODE(T.CONFIRM,'1','已确认','未确认') CONFIRM,
       T.CONFIRM_NAME,
       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') CONFIRM_TIME,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.LOAD_PIECES), 0) PRO_NUM,
       NVL(MAX(T.LOAD_WEIGHT), 0) PRO_WT,
       NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.LOAD_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
        DECODE(T.LOAD_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.LOAD_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.LOAD_USER,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYYMM') BAL_YEAR_MONTH,
       DECODE((SELECT MAX(T1.STATION_STATUS)
                FROM COUPLING_COM_INFO T1
               WHERE T1.WO_ID = T.WO_ID
                AND T1.RESULT_NO =T.RESULT_NO),
              '1',
              '生产中',
              '2',
              '生产完成') STATION_STATUS
  FROM pln_zy_jg_workbill M,coupling_loading_result T LEFT JOIN COUPLING_OFFLINE_RESULT T1 ON T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700301'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id AND NVL(T.Judge_Stove_No,'/') = NVL(M.Judge_Stove_No,'/') AND T.PLINE_CODE = M.PLINE_CODE 
          ]]>
	</query>
		<query id="FrmJGMatNoReport.doQueryCutResult" desc="查询接箍锯切台账">
        <![CDATA[
 SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       M.PRDCR_NO,
       T.WO_ID,
       T.MACHINE_NO,
       T.REJECTED_REASON,
       M.MIN_D,
       M.MIN_H,
       M.MODEL_DESC,
       M.SPEC_JG_DESC,
       M.GRADENAME,
       M.STEELNAME,
       M.STD_NAME,
       M.STD_STYLE_DESC,
       M.PRODUCCODE_JG_DESC,
       M.BUYER_NAME,
       T.IS_AUDITE,
       T.COL_OPERATOR,
       DECODE(T.CONFIRM,'1','已确认','未确认') CONFIRM,
       T.CONFIRM_NAME,
       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') CONFIRM_TIME,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.CUT_PIECES), 0) PRO_NUM,
       NVL(MAX(T.QUALIFIED_NUMBER), 0) PRO_WT,
       NVL(MAX(T.REJECTED_PCS), 0) FAIL_NUM,
       NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.COL_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
       DECODE(T.COL_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.COL_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.COL_USER,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYYMM') BAL_YEAR_MONTH,
       DECODE((SELECT MAX(T1.STATION_STATUS)
                FROM COUPLING_COM_INFO T1
               WHERE T1.WO_ID = T.WO_ID
                AND T1.RESULT_NO =T.RESULT_NO),
              '1',
              '生产中',
              '2',
              '生产完成') STATION_STATUS
  FROM pln_zy_jg_workbill M,coupling_cut_result T left join coupling_offline_result t1 on T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700302'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id 
          ]]>
	</query>
	
		<query id="FrmJGMatNoReport.doQueryThreaResult" desc="查询接箍车丝台账">
        <![CDATA[
 SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       M.JUDGE_STOVE_NO,
       T.BATCH_NO,
       M.PRDCR_NO,
       T.WO_ID,
       T.MACHINE_NO,
       T.REJECTED_REASON,
         M.MIN_D,
       M.MIN_H,
       M.STEELNAME,
       M.GRADENAME,
       M.SPEC_JG_DESC,
       M.STD_NAME,
       M.STD_STYLE_DESC,
       M.PRODUCCODE_JG_DESC,
       M.BUYER_NAME,
       M.MODEL_DESC,
       T.IS_AUDITE,
       T.COL_OPERATOR1,
       T.COL_OPERATOR2,
       DECODE(T.CONFIRM,'1','已确认','未确认') CONFIRM,
       T.CONFIRM_NAME,
       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') CONFIRM_TIME,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.QUALIRIED_PCS), 0) PRO_NUM,
       NVL(MAX(T.REJECTED_PCS), 0) FAIL_NUM,
       NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.COL_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
        DECODE(T.COL_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.COL_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.COL_USER,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYYMM') BAL_YEAR_MONTH,
       DECODE((SELECT MAX(T1.STATION_STATUS)
                FROM COUPLING_COM_INFO T1
               WHERE T1.WO_ID = T.WO_ID
                AND T1.RESULT_NO =T.RESULT_NO),
              '1',
              '生产中',
              '2',
              '生产完成') STATION_STATUS
  FROM pln_zy_jg_workbill M,coupling_threading_result T LEFT JOIN COUPLING_OFFLINE_RESULT T1 on T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700305'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id
          ]]>
	</query>
	
	
		<query id="FrmJGMatNoReport.doQueryFailResult" desc="查询接箍车丝不合格品台账">
        <![CDATA[
 SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       M.JUDGE_STOVE_NO,
       M.PRDCR_NO,
       T.WO_ID,
       T.MACHINE_NO,
       T.REJECTED_REASON,
         M.MIN_D,
       M.MIN_H,
       M.STEELNAME,
       M.GRADENAME,
       M.SPEC_JG_DESC,
       M.STD_NAME,
       M.STD_STYLE_DESC,
       M.PRODUCCODE_JG_DESC,
       M.BUYER_NAME,
       T.IS_AUDITE,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.QUALIRIED_PCS), 0) PRO_NUM,
       NVL(MAX(T.REJECTED_PCS), 0) FAIL_NUM,
       NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.COL_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
        DECODE(T.COL_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.COL_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.COL_USER,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYYMM') BAL_YEAR_MONTH,
       DECODE((SELECT MAX(T1.STATION_STATUS)
                FROM COUPLING_COM_INFO T1
               WHERE T1.WO_ID = T.WO_ID
                AND T1.RESULT_NO =T.RESULT_NO),
              '1',
              '生产中',
              '2',
              '生产完成') STATION_STATUS
  FROM pln_zy_jg_workbill M,coupling_threading_result T LEFT JOIN COUPLING_OFFLINE_RESULT T1 on T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700305'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id
          ]]>
	</query>
	
		<query id="FrmJGMatNoReport.doQueryPhosphResult" desc="查询接箍磷化台账">
        <![CDATA[
 SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       M.JUDGE_STOVE_NO,
       T.BATCH_NO,
       M.PRDCR_NO,
       T.WO_ID,
       M.MIN_D,
       M.MIN_H,
       M.STEELNAME,
       M.GRADENAME,
       M.SPEC_JG_DESC,
       M.STD_NAME,
       M.STD_STYLE_DESC,
       M.PRODUCCODE_JG_DESC,
       M.BUYER_NAME,
       M.MODEL_DESC,
       T.IS_AUDITE,
       DECODE(T.CONFIRM,'1','已确认','未确认') CONFIRM,
       T.CONFIRM_NAME,
       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') CONFIRM_TIME,
       T.MATCONFIRM_NAME,
       TO_CHAR(T.MATCONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') MATCONFIRM_TIME,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.COL_COUNT), 0) PRO_NUM,
       NVL(MAX(T.COL_COUNT)*M.SINGLEWEIGHT,0)/1000 PRO_WT,
       NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.COL_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
        DECODE(T.COL_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.COL_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.COL_OPERATOR COL_USER,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(T.CREATE_TIME, 'YYYYMM') BAL_YEAR_MONTH,
       DECODE((SELECT MAX(T1.STATION_STATUS)
                FROM COUPLING_COM_INFO T1
               WHERE T1.WO_ID = T.WO_ID
                AND T1.RESULT_NO =T.RESULT_NO),
              '1',
              '生产中',
              '2',
              '生产完成') STATION_STATUS
  FROM pln_zy_jg_workbill M,coupling_phosphate_result T LEFT JOIN COUPLING_OFFLINE_RESULT T1 on T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700310'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id
          ]]>
	</query>
	
	<query id="FrmJGMatNoReport.doQueryThreadInResult" desc="查询接箍螺纹台账">
        <![CDATA[
   SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       M.JUDGE_STOVE_NO,
       T.BATCH_NO,
       M.PRDCR_NO,
       T.WO_ID,
         M.MIN_D,
       M.MIN_H,
       M.STEELNAME,
       M.GRADENAME,
       M.SPEC_JG_DESC,
       M.STD_NAME,
       M.STD_STYLE_DESC,
       M.PRODUCCODE_JG_DESC,
       M.BUYER_NAME,
       M.MODEL_DESC,
       T.IS_AUDITE,
       DECODE(T.CONFIRM,'1','已确认','未确认') CONFIRM,
       T.CONFIRM_NAME,
       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') CONFIRM_TIME,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.QUALIRIED_PCS), 0) PRO_NUM,
       NVL(MAX(T.REJECTED_PCS), 0) FAIL_NUM,
        NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.COL_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
        DECODE(T.COL_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.COL_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.COL_USER,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYYMM') BAL_YEAR_MONTH,
       DECODE((SELECT MAX(T1.STATION_STATUS)
                FROM COUPLING_COM_INFO T1
               WHERE T1.WO_ID = T.WO_ID
                AND T1.RESULT_NO =T.RESULT_NO),
              '1',
              '生产中',
              '2',
              '生产完成') STATION_STATUS
  FROM pln_zy_jg_workbill M,coupling_thinspect_result T LEFT JOIN COUPLING_OFFLINE_RESULT T1 on T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700306'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id
          ]]>
	</query>
	<query id="FrmJGMatNoReport.doQuerySandBlastResult" desc="查询接箍喷砂台账">
        <![CDATA[
   SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       M.JUDGE_STOVE_NO,
       T.BATCH_NO,
       M.PRDCR_NO,
       T.WO_ID,
           M.MIN_D,
       M.MIN_H,
       M.STEELNAME,
       M.GRADENAME,
       M.SPEC_JG_DESC,
       M.STD_NAME,
       M.STD_STYLE_DESC,
       M.PRODUCCODE_JG_DESC,
       M.BUYER_NAME,
       M.MODEL_DESC,
       T.IS_AUDITE,
       DECODE(T.CONFIRM,'1','已确认','未确认') CONFIRM,
       T.CONFIRM_NAME,
       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') CONFIRM_TIME,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.QUALIRIED_PCS), 0) PRO_NUM,
       NVL(MAX(T.REJECTED_PCS), 0) FAIL_NUM,
       NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.COL_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
        DECODE(T.COL_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.COL_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.COL_USER,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYYMM') BAL_YEAR_MONTH,
       DECODE((SELECT MAX(T1.STATION_STATUS)
                FROM COUPLING_COM_INFO T1
               WHERE T1.WO_ID = T.WO_ID
                AND T1.RESULT_NO =T.RESULT_NO),
              '1',
              '生产中',
              '2',
              '生产完成') STATION_STATUS
  FROM pln_zy_jg_workbill M,coupling_sandblast_result T LEFT JOIN COUPLING_OFFLINE_RESULT T1 on T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700308'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id
          ]]>
	</query>
	<query id="FrmJGMatNoReport.doQueryInspectResult" desc="查询接箍探伤台账">
        <![CDATA[
  SELECT T.RESULT_NO,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.WO_ID,
       M.JUDGE_STOVE_NO,
       T.BATCH_NO,
       M.PRDCR_NO,
         M.MIN_D,
       M.MIN_H,
       M.STEELNAME,
       M.GRADENAME,
       M.SPEC_JG_DESC,
       M.STD_NAME,
       M.STD_STYLE_DESC,
       M.PRODUCCODE_JG_DESC,
       M.BUYER_NAME,
       T.IS_AUDITE,
       DECODE(T.CONFIRM,'1','已确认','未确认') CONFIRM,
       T.CONFIRM_NAME,
       TO_CHAR(T.CONFIRM_TIME,'YYYY-MM-DD HH24:MI:SS') CONFIRM_TIME,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       DECODE(M.IF_MONITOR_JG,'1','是','0','否') IF_MONITOR_JG,
       NVL(MAX(T.INSPECT_PIECES), 0) PRO_NUM,
       NVL(MAX(T.QUALIRIED_PCS), 0) PRO_WT,
       NVL(MAX(T.REJECTED_PCS), 0) FAIL_NUM,
       NVL(MAX(T1.OFFLINE_NUM), 0) OFFLINE_NUM,
       NVL(MAX(T1.OFFLINE_WT), 0) OFFLINE_WT,
       NVL(MAX(T1.RE_NUM), 0) RE_NUM,
       NVL(MAX(T1.RE_WT), 0) RE_WT,
       NVL(MAX(T1.SUBCONTRACT_NUM), 0) SUBCONTRACT_NUM,
       NVL(MAX(T1.SUBCONTRACT_WT), 0) SUBCONTRACT_WT,
       TO_CHAR(MAX(T.COL_TIME), 'YYYY-MM-DD HH24:MI:SS') LOAD_TIME,
        DECODE(T.COL_SHIFT,'1','早','2','中','3','夜') LOAD_SHIFT,
       DECODE(T.COL_GROUP,'1','甲','2','乙','3','丙','4','丁') LOAD_GROUP,
       T.COL_USER,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYY-MM-DD HH24:MI:SS') PRO_YEAR_MONTH_DAY,
       TO_CHAR(MAX(T.CREATE_TIME), 'YYYYMM') BAL_YEAR_MONTH
  FROM pln_zy_jg_workbill M,coupling_inspection_result T LEFT JOIN COUPLING_OFFLINE_RESULT T1 on T.WO_ID = T1.WO_ID AND T1.PLINE_CODE = T.PLINE_CODE
  and t1.station_code = '700307'
WHERE 1=1 AND T.Wo_Id=M.Wo_Id 
          ]]>
	</query>
	<query id="FrmJGMatNoReport.getQueryCouplingMat" desc="查询库存信息">
	SELECT T.MAT_NO,
       T.RESULT_NO,
       T.ZY_PLAN_ID,
       T.WO_ID,
       DECODE(T.QCM_STAUS,
              '00',
              '合格',
              '0',
              '合格',
              '11',
              '待处理',
              '22',
              '判废',
              '10',
              '处理合格',
              '12',
              '处理判废') QCM_STAUS,
       T1.PRO_PLAN_ID,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BL_WL_ID,
       T.BL_WL_DESC,
       T.MIN_D,
       T.MIN_H,
       TO_CHAR(T.F_IN_TIME, 'YYYY-MM-DD HH24:MI:SS') F_IN_TIME,
       T.CODE_JG,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.SPEC_JG,
       T.SPEC_JG_DESC,
       (SELECT C.BASENAME FROM COM_BASE_INFO C WHERE C.BASECODE = T.STYLE_JG) STYLE_JG,
       T.DIAMETER,
       T.CHECK_J_VAL,
       T.AIMLENGTH,
       T.SINGLEWEIGHT,
       T.MONITORDEMAND,
       DECODE(T.IF_MONITOR_JG, '0', '否', '1', '是') IF_MONITOR_JG,
       T.PRDCR_NO,
       T.PRODUCER,
       T1.MACH_NO,
       T1.MACH_NM,
       sum(T.PRO_NUM) PRO_NUM,
       sum(T.PRO_WT) PRO_WT,
       TO_CHAR(T.RRO_TIME, 'YYYY-MM-DD HH24:MI:SS') RRO_TIME,
       DECODE(T.PRO_GROUP, '1', '甲', '2', '乙', '3', '丙', '4', '丁') PRO_GROUP,
       DECODE(T.PRO_SHIFT, '0', '常白', '1', '早', '2', '中', '3', '夜') PRO_SHIFT,
       T1.CUST_ALPHA_NO,
       T1.ORDER_SPECIAL_DESC,
       T.COL_OPERATOR,
       T.CREATE_NAME,
       listagg((SELECT Y.STORAGE_NAME
                  FROM YDM_BS_STORAGE Y
                 WHERE Y.STORAGE_NO = T1.STORAGE_NO) || T1.PIECES || '个',
               ',') within GROUP(order by T.MAT_NO) over(partition by T.MAT_NO) || T.MEMO MEMO,
       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,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_DETECTION) DEMAND_DETECTION,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_BLAST) DEMAND_BLAST,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_BONDERIZING) DEMAND_BONDERIZING,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_COPPER) DEMAND_COPPER,
       DECODE(T.COAT_TYPE,
              '0',
              '无',
              '1',
              '镀铜',
              '2',
              '磷化',
              '3',
              '镀铜及磷化') COAT_TYPE,
       T.CODE_JG_BL,
       T.PRODUCCODE_BL,
       T.PRODUCNAME_BL,
       T.STD_CODE_BL,
       T.STD_NAME_BL,
       T.STEELCODE_BL,
       T.STEELNAME_BL,
       T.STD_STYLE_BL,
       T.STD_STYLE_DESC_BL,
       T.MODEL_CODE_BL,
       T.MODEL_DESC_BL,
       T.MIN_D_BL,
       T.MIN_H_BL,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T1.PRODUCT_FLAG) PRODUCT_FLAG,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T1.MAT_STATUS) MAT_STATUS,
       
       (SELECT T3.ORDER_NO || '/' || T3.ORDER_SEQ
          FROM PLN_ORDER_JG T3
         WHERE T3.JG_ORDERNO = T2.JG_ORDERNO_ALL) ORDER_NO,
       
       (select DECODE(MIN(EXE_STATUS),
                      '0',
                      '计划',
                      '1',
                      '生产中',
                      '2',
                      '完成',
                      '3',
                      '关闭A',
                      '4',
                      '关闭')
          from PLN_ORDER_JGX_S
         WHERE ORDER_NO || '/' || ORDER_SEQ =
               (SELECT T3.ORDER_NO || '/' || T3.ORDER_SEQ
                  FROM PLN_ORDER_JG T3
                 WHERE T3.JG_ORDERNO = T2.JG_ORDERNO_ALL)) FLAG_MIN,
       T2.ORDER_SEQ,
       T2.DELIVERY_NO,
       T2.ORD_LN_DLY_PK,
       (SELECT Y.STORAGE_NAME
          FROM YDM_BS_STORAGE Y
         WHERE Y.STORAGE_NO = T1.STORAGE_NO) STORAGE_NO

  FROM COUPLING_MAT_M T, COUPLING_MAT_BUTTRESS T1, PLN_ZY_JG_WORKBILL T2
 WHERE T.MAT_NO = T1.MAT_NO
   AND T.WO_ID = T2.WO_ID(+) #someThing#

 group by T.F_IN_TIME,
          T.MAT_NO,
          T.RESULT_NO,
          T.ZY_PLAN_ID,
          T.WO_ID,
          T.QCM_STAUS,
          T1.PRO_PLAN_ID,
          T.PLINE_CODE,
          T.PLINE_NAME,
          T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.BL_WL_ID,
          T.BL_WL_DESC,
          T.MIN_D,
          T.MIN_H,
          T.CODE_JG,
          T.GRADECODE,
          T.GRADENAME,
          T.STEELCODE,
          T.STEELNAME,
          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.MONITORDEMAND,
          T.IF_MONITOR_JG,
          T.PRDCR_NO,
          T.PRODUCER,
          T1.MACH_NO,
          T1.MACH_NM,
          T.PRO_NUM,
          T.PRO_WT,
          T.RRO_TIME,
          T.PRO_GROUP,
          T.PRO_SHIFT,
          T1.CUST_ALPHA_NO,
          T1.ORDER_SPECIAL_DESC,
          T.COL_OPERATOR,
          T.CREATE_NAME,
          T.CREATE_TIME,
          T.UPDATE_NAME,
          T.UPDATE_TIME,
          T.DEMAND_DETECTION,
          T.DEMAND_BLAST,
          T.DEMAND_BONDERIZING,
          T.DEMAND_COPPER,
          T.COAT_TYPE,
          T.CODE_JG_BL,
          T.PRODUCCODE_BL,
          T.PRODUCNAME_BL,
          T.STD_CODE_BL,
          T.STD_NAME_BL,
          T.STEELCODE_BL,
          T.STEELNAME_BL,
          T.STD_STYLE_BL,
          T.STD_STYLE_DESC_BL,
          T.MODEL_CODE_BL,
          T.MODEL_DESC_BL,
          T.MIN_D_BL,
          T.MIN_H_BL,
          T1.PRODUCT_FLAG,
          T1.MAT_STATUS,
          T2.ORDER_NO,
          T2.ORDER_SEQ,
          T2.DELIVERY_NO,
          T2.ORD_LN_DLY_PK,
          T2.JG_ORDERNO_ALL,
          T1.STORAGE_NO,
          T1.PIECES,
          T.MEMO
 ORDER BY T.CREATE_TIME DESC
	</query>
	
	<query id="FrmJGMatNoReport.getQueryCouplingMat2" desc="查询库存信息">
	 SELECT T.MAT_NO,
       T.RESULT_NO,
       T.ZY_PLAN_ID,
       T.WO_ID,
       DECODE(T.QCM_STAUS,
              '00',
              '合格',
              '0',
              '合格',
              '11',
              '待处理',
              '22',
              '判废',
              '10',
              '处理合格',
              '12',
              '处理判废') QCM_STAUS,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BL_WL_ID,
       T.BL_WL_DESC,
       T.MIN_D,
       T.MIN_H,
       TO_CHAR(T.F_IN_TIME, 'YYYY-MM-DD HH24:MI:SS') F_IN_TIME,
       T.CODE_JG,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.OUTDIAMETER,
       T.WALLTHICK,
       T.SPEC_JG,
       T.SPEC_JG_DESC,
       (SELECT C.BASENAME FROM COM_BASE_INFO C WHERE C.BASECODE = T.STYLE_JG) STYLE_JG,
       T.DIAMETER,
       T.CHECK_J_VAL,
       T.AIMLENGTH,
       T.SINGLEWEIGHT,
       T.MONITORDEMAND,
       DECODE(T.IF_MONITOR_JG, '0', '否', '1', '是') IF_MONITOR_JG,
       T.PRDCR_NO,
       T.PRODUCER,
       sum(T.PRO_NUM) PRO_NUM,
       sum(T.PRO_WT) PRO_WT,
       TO_CHAR(T.RRO_TIME, 'YYYY-MM-DD HH24:MI:SS') RRO_TIME,
       DECODE(T.PRO_GROUP, '1', '甲', '2', '乙', '3', '丙', '4', '丁') PRO_GROUP,
       DECODE(T.PRO_SHIFT, '0', '常白', '1', '早', '2', '中', '3', '夜') PRO_SHIFT,
       T.COL_OPERATOR,
       T.CREATE_NAME,
       T.MEMO,
       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,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_DETECTION) DEMAND_DETECTION,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_BLAST) DEMAND_BLAST,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_BONDERIZING) DEMAND_BONDERIZING,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_COPPER) DEMAND_COPPER,
       DECODE(T.COAT_TYPE,
              '0',
              '无',
              '1',
              '镀铜',
              '2',
              '磷化',
              '3',
              '镀铜及磷化') COAT_TYPE,
       T.CODE_JG_BL,
       T.PRODUCCODE_BL,
       T.PRODUCNAME_BL,
       T.STD_CODE_BL,
       T.STD_NAME_BL,
       T.STEELCODE_BL,
       T.STEELNAME_BL,
       T.STD_STYLE_BL,
       T.STD_STYLE_DESC_BL,
       T.MODEL_CODE_BL,
       T.MODEL_DESC_BL,
       T.MIN_D_BL,
       T.MIN_H_BL
  FROM COUPLING_MAT_M T
 WHERE 1 = 1 #someThing#
 group by T.F_IN_TIME,
          T.MAT_NO,
          T.RESULT_NO,
          T.ZY_PLAN_ID,
          T.WO_ID,
          T.QCM_STAUS,
          T.PLINE_CODE,
          T.PLINE_NAME,
          T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.BL_WL_ID,
          T.BL_WL_DESC,
          T.MIN_D,
          T.MIN_H,
          T.CODE_JG,
          T.GRADECODE,
          T.GRADENAME,
          T.STEELCODE,
          T.STEELNAME,
          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.MONITORDEMAND,
          T.IF_MONITOR_JG,
          T.PRDCR_NO,
          T.PRODUCER,
          T.PRO_NUM,
          T.PRO_WT,
          T.RRO_TIME,
          T.PRO_GROUP,
          T.PRO_SHIFT,
          T.COL_OPERATOR,
          T.CREATE_NAME,
          T.CREATE_TIME,
          T.UPDATE_NAME,
          T.UPDATE_TIME,
          T.DEMAND_DETECTION,
          T.DEMAND_BLAST,
          T.DEMAND_BONDERIZING,
          T.DEMAND_COPPER,
          T.COAT_TYPE,
          T.CODE_JG_BL,
          T.PRODUCCODE_BL,
          T.PRODUCNAME_BL,
          T.STD_CODE_BL,
          T.STD_NAME_BL,
          T.STEELCODE_BL,
          T.STEELNAME_BL,
          T.STD_STYLE_BL,
          T.STD_STYLE_DESC_BL,
          T.MODEL_CODE_BL,
          T.MODEL_DESC_BL,
          T.MIN_D_BL,
          T.MIN_H_BL,
          T.MEMO
 ORDER BY T.CREATE_TIME DESC
	</query>
	
	<query id="FrmJGMatNoReport.getQueryCouplingMatTogether" desc="查询库存信息(汇总)">
	 SELECT T.STEELNAME,
       T.MODEL_DESC,
       T.SPEC_JG_DESC,
       (SELECT C.BASENAME FROM COM_BASE_INFO C WHERE C.BASECODE = T.STYLE_JG) STYLE_JG,
       sum(T.PRO_NUM) PRO_NUM,
       sum(T.PRO_WT) PRO_WT,
       SUM(DECODE((SELECT T3.ORDER_NO || '/' || T3.ORDER_SEQ
                    FROM PLN_ORDER_JG T3
                   WHERE T3.JG_ORDERNO = T2.JG_ORDERNO_ALL),
                  '',
                  T.PRO_NUM,
                  NULL,
                  T.PRO_NUM,
                  0)) YU_NUM,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_DETECTION) DEMAND_DETECTION,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_BLAST) DEMAND_BLAST,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_BONDERIZING) DEMAND_BONDERIZING,
       (SELECT C.BASENAME
          FROM COM_BASE_INFO C
         WHERE C.BASECODE = T.DEMAND_COPPER) DEMAND_COPPER

  FROM COUPLING_MAT_M T,  PLN_ZY_JG_WORKBILL T2
 WHERE  T.WO_ID = T2.WO_ID(+) #someThing#
 group by T.STEELNAME,
          T.MODEL_DESC,
          T.SPEC_JG_DESC,
          T.STYLE_JG,
          T.DEMAND_DETECTION,
          T.DEMAND_BLAST,
          T.DEMAND_BONDERIZING,
          T.DEMAND_COPPER
	</query>
	
	<query id="FrmJGMatNoReport.getQueryCouplingMatLiku" desc="查询接箍利库信息">
	 SELECT T.MAT_NO,
       T.RESULT_NO,
       T.ZY_PLAN_ID,
       T.WO_ID,
       T1.PRO_PLAN_ID,
       T.PLINE_CODE,
       T.PLINE_NAME,
       T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BL_WL_ID,
       T.BL_WL_DESC,
       T.MIN_D,
       T.MIN_H,     
       T.CODE_JG,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       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.MONITORDEMAND,
       T.IF_MONITOR_JG,
       T.PRDCR_NO,
       T.PRODUCER,
       T1.MACH_NO,
       T1.MACH_NM,
       sum(T.PRO_NUM) PRO_NUM,
       sum(T.PRO_WT) PRO_WT,
       TO_CHAR(T.RRO_TIME, 'YYYY-MM-DD HH24:MI:SS') RRO_TIME,
       DECODE(T.PRO_GROUP, '1', '甲', '2', '乙', '3', '丙', '4', '丁') PRO_GROUP,
       DECODE(T.PRO_SHIFT, '0', '常白', '1', '早', '2', '中', '3', '夜') PRO_SHIFT,
       T1.CUST_ALPHA_NO,
       T1.ORDER_SPECIAL_DESC,
       T.COL_OPERATOR,     
       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
  FROM COUPLING_MAT_M T, COUPLING_MAT_BUTTRESS T1
 WHERE T.MAT_NO = T1.MAT_NO AND T1.LOCK_LIKU = '1'
	</query>
	<query id="FrmJGMatNoReport.getQueryCouplingInlist" desc="查询入库信息">
	 SELECT MACH_NM,
       DEAL_NUM,
       DEAL_WT,
       TO_CHAR(DEAL_TIME, 'YYYY-MM-DD HH24:MI:SS') DEAL_TIME,
       STORAGE_NO,
       LOCATION_NO,
       STORAGE_ATTR_NAME,
       STORAGE_TYPE_NAME,
       TAR_STORAGE_NO,
       TAR_LOCATION_NO,
       TAR_STORAGE_ATTR_NAME,
       TAR_STORAGE_TYPE_NAME,
       DECODE(TAR_REC_FLAG, '0', '未接收', '1', '已接收') TAR_REC_FLAG,
       DECODE(HAND_FLAG, '0', '自动', '1', '人工') HAND_FLAG,
       CREATE_NAME,
       TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       UPDATE_NAME,
       TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       DEAL_ORDE,
       DEAL_TYPE_CODE,
       DEAL_TYPE_NAME,
       SOURCE_CODE,
       SOURCE_NAME,
       TAR_CODE,
       TAR_NAME,
       KEP_NO,
       TAR_KEP_NO,
       MAT_NO,
       RESULT_NO,
       ZY_PLAN_ID,
       PRO_PLAN_ID,
       PLINE_CODE,
       PLINE_NAME,
       JUDGE_STOVE_NO,
       BATCH_NO,
       BL_WL_DESC,
       MIN_D,
       MIN_H,
       CODE_JG,
       GRADENAME,     
       STEELNAME,     
       MODEL_DESC,
       OUTDIAMETER,
       WALLTHICK,
       SPEC_JG_DESC,
       STYLE_JG,
       DIAMETER,
       CHECK_J_VAL,
       AIMLENGTH,
       SINGLEWEIGHT,
       MONITORDEMAND,
       IF_MONITOR_JG,
       PRDCR_NO,
       PRODUCER,
       TO_CHAR(PRODUCER_TIME, 'YYYY-MM-DD HH24:MI:SS') PRODUCER_TIME,
       WO_ID
  FROM COUPLING_MAT_DEAL
 WHERE 1 = 1
 AND DEAL_TYPE_CODE = '8007'
	</query>
	<query id="FrmJGMatNoReport.getQueryCouplingOutlist" desc="查询出库信息">
	 SELECT MACH_NM,
       DEAL_NUM,
       DEAL_WT,
       TO_CHAR(DEAL_TIME, 'YYYY-MM-DD HH24:MI:SS') DEAL_TIME,
       STORAGE_NO,
       LOCATION_NO,
       STORAGE_ATTR_NAME,
       STORAGE_TYPE_NAME,
       TAR_STORAGE_NO,
       TAR_LOCATION_NO,
       TAR_STORAGE_ATTR_NAME,
       TAR_STORAGE_TYPE_NAME,
       DECODE(TAR_REC_FLAG, '0', '未接收', '1', '已接收') TAR_REC_FLAG,
       DECODE(HAND_FLAG, '0', '自动', '1', '人工') HAND_FLAG,
       CREATE_NAME,
       TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       UPDATE_NAME,
       TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       DEAL_ORDE,
       DEAL_TYPE_CODE,
       DEAL_TYPE_NAME,
       SOURCE_CODE,
       SOURCE_NAME,
       TAR_CODE,
       TAR_NAME,
       KEP_NO,
       TAR_KEP_NO,
       MAT_NO,
       RESULT_NO,
       ZY_PLAN_ID,
       PRO_PLAN_ID,
       PLINE_CODE,
       PLINE_NAME,
       JUDGE_STOVE_NO,
       BATCH_NO,
       BL_WL_DESC,
       MIN_D,
       MIN_H,
       CODE_JG,
       GRADENAME,     
       STEELNAME,     
       MODEL_DESC,
       OUTDIAMETER,
       WALLTHICK,
       SPEC_JG_DESC,
       STYLE_JG,
       DIAMETER,
       CHECK_J_VAL,
       AIMLENGTH,
       SINGLEWEIGHT,
       MONITORDEMAND,
       IF_MONITOR_JG,
       PRDCR_NO,
       PRODUCER,
       TO_CHAR(PRODUCER_TIME, 'YYYY-MM-DD HH24:MI:SS') PRODUCER_TIME,
       WO_ID
  FROM COUPLING_MAT_DEAL
 WHERE 1 = 1
 AND DEAL_TYPE_CODE = '8008'
	</query>
	<query id="FrmJGMatNoReport.getKepNo" desc="获取所有框号">
	SELECT T.KEP_NO FROM COUPLING_APP_BOX_MAIN T where t.VALIDFLAG='1'
	</query>
		<query id="FrmJGMatNoReport.getQueryLocation" desc="查询框号库位信息">
	SELECT B.STORAGE_NAME,T.KEP_NO,T.PIECES FROM COUPLING_MAT_BUTTRESS T,YDM_BS_STORAGE B WHERE T.STORAGE_NO = B.STORAGE_NO
	</query>
	<query id="FrmJGMatNoReport.getQueryOrder" desc="查询合同相关信息">
	SELECT T.* FROM PLN_ZY_JG_MIDDLE T WHERE 1 = 1
	</query>
	<query id="FrmJGMatNoReport.updateCouplingIsAduite" desc="更新实绩标志位">
	UPDATE COUPLING_LOADING_RESULT T SET T.IS_AUDITE = '1' WHERE T.WO_ID = ? AND T.RESULT_NO = ?
	</query>
		<query id="FrmJGMatNoReport.updateCouplingIsAduiteCut" desc="更新实绩标志位">
	UPDATE coupling_cut_result T SET T.IS_AUDITE = '1' WHERE T.WO_ID = ? AND T.RESULT_NO = ?
	</query>
		<query id="FrmJGMatNoReport.updateCouplingIsAduiteThrea" desc="更新实绩标志位">
	UPDATE coupling_threading_result T SET T.IS_AUDITE = '1' WHERE T.WO_ID = ? AND T.RESULT_NO = ?
	</query>
		<query id="FrmJGMatNoReport.updateCouplingIsAduiteThin" desc="更新实绩标志位">
	UPDATE coupling_thinspect_result T SET T.IS_AUDITE = '1' WHERE T.WO_ID = ? AND T.RESULT_NO = ?
	</query>
	<query id="FrmJGMatNoReport.updateCouplingIsAduiteInsp" desc="更新实绩标志位">
	UPDATE coupling_inspection_result T SET T.IS_AUDITE = '1' WHERE T.WO_ID = ? AND T.RESULT_NO = ?
	</query>
	<query id="FrmJGMatNoReport.updateCouplingIsAduiteSand" desc="更新实绩标志位">
	UPDATE coupling_sandblast_result T SET T.IS_AUDITE = '1' WHERE T.WO_ID = ? AND T.RESULT_NO = ?
	</query>
	<query id="FrmJGMatNoReport.updateCouplingIsAduitePhos" desc="更新实绩标志位">
	UPDATE coupling_phosphate_result T SET T.IS_AUDITE = '1' WHERE T.WO_ID = ? AND T.RESULT_NO = ?
	</query>
	<query id="FrmJGMatNoReport.doQueryPerformance" desc="查询接箍实绩">		
        <![CDATA[
SELECT M.WO_ID,
       M.PLINE_NAME,
       M.CRAFT_FILE_NO,
       M.CRAFT_SEQ,
       M.JUDGE_STOVE_NO JUDGE_STOVE_NO,
       M.BATCH_NO,
       T.GRADENAME,
       TO_CHAR(MAX(T1.CREATE_TIME),'YYYYMM') BAL_YEAR_MONTH,
       M.PLAN_JG_NUM,
       M.PLAN_BL_NUM PLAN_INDOUBLE_NUM,
       M.PLAN_BL_WT PLAN_INDOUBLE_WT,
       M.ORDER_NO || '/' || M.ORDER_SEQ ORDER_NO,
       M.OUTWL_DESC,
       M1.SPEC_NAME,
       M1.STD_NAME,
       M1.PRODUCNAME,
       M1.MODEL_DESC,
       M1.STEELNAME,
          NVL((SELECT SUM(V.ACT_COUNT)
             FROM port_jg_batch_sample_result V
            WHERE V.WO_ID = M.WO_ID
            AND V.PLINE_CODE = M.PLINE_CODE
            AND V.BATCH_NO = M.BATCH_NO
              AND V.MAT_STATUS = '10'),
           0) FAIL_NUM,
       NVL((SELECT SUM(V.ACT_WEIGHT)
             FROM port_jg_batch_sample_result V
            WHERE V.WO_ID = M.WO_ID
            AND V.PLINE_CODE = M.PLINE_CODE
             AND V.BATCH_NO = M.BATCH_NO
              AND V.MAT_STATUS = '10'),
           0) FAIL_WT,
       NVL((SELECT SUM(V.PRO_NUM)
             FROM COUPLING_COM_INFO V
            WHERE V.WO_ID = M.WO_ID
            AND V.PLINE_CODE = M.PLINE_CODE
             AND V.BATCH_NO = M.BATCH_NO
              AND V.STATION_CODE = '700313'),
           0) PRO_NUM,
       NVL((SELECT SUM(V.PRO_WT)
             FROM COUPLING_COM_INFO V
            WHERE V.WO_ID = M.WO_ID
            AND V.PLINE_CODE = M.PLINE_CODE
             AND V.BATCH_NO = M.BATCH_NO
              AND V.STATION_CODE = '700313'),
           0) PRO_WT,
       NVL((SELECT SUM(V.OFFLINE_NUM)
             FROM COUPLING_OFFLINE_RESULT V
            WHERE V.WO_ID = M.WO_ID
             AND V.BATCH_NO = M.BATCH_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) OFFLINE_NUM,
       NVL((SELECT SUM(V.OFFLINE_WT)
             FROM COUPLING_OFFLINE_RESULT V
            WHERE V.WO_ID = M.WO_ID
             AND V.BATCH_NO = M.BATCH_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) OFFLINE_WT,
       NVL((SELECT SUM(V.RE_NUM)
             FROM COUPLING_OFFLINE_RESULT V
            WHERE V.WO_ID = M.WO_ID
             AND V.BATCH_NO = M.BATCH_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) RE_NUM,
       NVL((SELECT SUM(V.RE_WT)
             FROM COUPLING_OFFLINE_RESULT V
            WHERE V.WO_ID = M.WO_ID
             AND V.BATCH_NO = M.BATCH_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) RE_WT,
       NVL((SELECT SUM(V.LOAD_PIECES)
             FROM COUPLING_LOADING_RESULT V
            WHERE V.WO_ID = M.WO_ID
             AND V.BATCH_NO = M.BATCH_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_NUM,
       NVL((SELECT SUM(V.LOAD_WEIGHT)
             FROM COUPLING_LOADING_RESULT V
            WHERE V.WO_ID = M.WO_ID
             AND V.BATCH_NO = M.BATCH_NO
            AND V.PLINE_CODE = M.PLINE_CODE),
           0) LOAD_PRO_WT,
   
       NVL((SELECT SUM(V1.CUT_PIECES)
             FROM coupling_cut_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_ACC_NUM,        NVL((SELECT SUM(V1.QUALIFIED_NUMBER)
             FROM coupling_cut_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_ACC_WT,
       NVL((SELECT SUM(V1.REJECTED_PCS)
             FROM coupling_cut_result V1    
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_FAIL_NUM,
            NVL((SELECT SUM(V1.PRALO_PCS)
             FROM coupling_cut_result V1    
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) MEA_PRALO_NUM,
       NVL((SELECT SUM(V1.QUALIRIED_PCS)
             FROM coupling_threading_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_PRO_NUM,  
       NVL((SELECT SUM(V1.REJECTED_PCS)
             FROM coupling_threading_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) REE_FAIL_NUM,
       NVL((SELECT SUM(V1.QUALIRIED_PCS)
             FROM coupling_thinspect_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_PRO_NUM,      
       NVL((SELECT SUM(V1.REJECTED_PCS)
             FROM coupling_thinspect_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) SIZ_FAIL_NUM,
       NVL((SELECT SUM(V1.SPRAY_COUNT)
             FROM coupling_sandblast_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_ACC_NUM,   
       NVL((SELECT SUM(V1.REJECTED_PCS)
             FROM coupling_sandblast_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) ROT_FAIL_NUM,
       NVL((SELECT SUM(V1.COL_COUNT)
             FROM coupling_phosphate_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_ACC_NUM,      
       NVL((SELECT SUM(V1.SPRAY_COUNT)
             FROM coupling_phosphate_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) JUM_FAIL_NUM,
       NVL((SELECT SUM(V1.FINAL_QUALIFIED)
             FROM coupling_inspection_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_ACC_NUM,      
       NVL((SELECT SUM(V1.UNQUALIRIED_PCS)
             FROM coupling_inspection_result V1
            WHERE V1.WO_ID = M.WO_ID
            AND V1.PLINE_CODE = M.PLINE_CODE),
           0) HOT_FAIL_NUM,
           
             NVL((SELECT SUM(MAT.ACT_COUNT)
             FROM QCM_ZG_JUGDE_APPLY MAT
            WHERE MAT.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND MAT.BATCH_NO = M.BATCH_NO
            AND MAT.PLINE_CODE = M.PLINE_CODE
            AND MAT.VALIDFLAG != '50'),
           0) MAT_NUM,      
       NVL((SELECT SUM(MAT.ACT_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY MAT
            WHERE MAT.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND MAT.BATCH_NO = M.BATCH_NO
            AND MAT.PLINE_CODE = M.PLINE_CODE
            AND MAT.VALIDFLAG != '50'),
           0) MAT_WEIGHT,
            NVL((SELECT SUM(QCM.ACT_THEORY_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.BATCH_NO = M.BATCH_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG != '50'),
           0) QCM_THEORY_WEIGHT,
       NVL((SELECT SUM(QCM.ACT_COUNT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.BATCH_NO = M.BATCH_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) QCM_NUM,      
       NVL((SELECT SUM(QCM.ACT_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
            AND QCM.BATCH_NO = M.BATCH_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) QCM_WEIGHT,
        NVL((SELECT SUM(QCM.ACT_THEORY_WEIGHT)
             FROM QCM_ZG_JUGDE_APPLY QCM
            WHERE QCM.JUDGE_STOVE_NO = M.JUDGE_STOVE_NO
              AND QCM.BATCH_NO = M.BATCH_NO
            AND QCM.PLINE_CODE = M.PLINE_CODE
            AND QCM.VALIDFLAG = '20'),
           0) THEORY_WEIGHT,  
       MIN(TO_CHAR(T1.LOAD_TIME, 'YYYY-MM-DD HH24:MI:SS')) LOAD_TIME

  FROM COUPLING_COM_INFO   T,
       pln_zy_jg_workbill   M,
       PLN_SALEORD        M1,
       COUPLING_LOADING_RESULT T1
 WHERE M.WO_ID = T.WO_ID
   AND M.WO_ID = T1.WO_ID(+)
   AND M.ORD_LN_DLY_PK = M1.ORD_LN_DLY_PK(+)
        ]]>
	</query>
	
	<query id="FrmJGMatNoReport.deleteMat" desc="删除材料表">
	DELETE FROM COUPLING_MAT_M T WHERE T.MAT_NO = ?
	</query>
	<query id="FrmJGMatNoReport.deleteButtress" desc="删除位置表">
	DELETE FROM COUPLING_MAT_BUTTRESS T WHERE T.MAT_NO = ?
	</query>
	
	<query id="FrmJGMatNoReport.extinction" desc="消亡">
        <![CDATA[
 DECLARE
  V_MAT_NO      COUPLING_MAT_M.MAT_NO%type := ?;
  V_PRO_NUM     COUPLING_MAT_M.PRO_NUM%type := ?;
  V_CREATE_NAME COUPLING_MAT_M.CREATE_NAME%type := ?;
BEGIN

  FOR MYROW IN (SELECT * FROM COUPLING_MAT_M T WHERE T.MAT_NO = V_MAT_NO) LOOP
    insert into coupling_mat_m_extinction
      (mat_no,
       result_no,
       zy_plan_id,
       wo_id,
       pline_code,
       pline_name,
       judge_stove_no,
       batch_no,
       bl_wl_id,
       min_d,
       min_h,
       code_jg,
       gradecode,
       gradename,
       steelcode,
       steelname,
       model_code,
       model_desc,
       outdiameter,
       wallthick,
       spec_jg,
       spec_jg_desc,
       style_jg,
       diameter,
       check_j_val,
       aimlength,
       singleweight,
       monitordemand,
       if_monitor_jg,
       prdcr_no,
       producer,
       pro_num,
       pro_wt,
       col_operator,
       rro_time,
       pro_shift,
       pro_group,
       create_name,
       create_time,
       update_name,
       update_time,
       f_in_time,
       bl_wl_desc,
       memo,
       demand_detection,
       demand_blast,
       demand_bonderizing,
       demand_copper,
       coat_type,
       belong_code,
       belong_name,
       code_jg_bl,
       craft_file_no,
       craft_seq,
       lock_flag,
       mng_lock_flag,
       mng_lock_remark,
       lock_remark,
       deter_status,
       deter_no,
       deter_results,
       final_user_desc,
       mat_origin_code,
       mat_origin_name,
       soure_code,
       soure_name,
       judge_std_name,
       lock_liku,
       deter_no_seq,
       qcm_staus,
       fail_num,
       fail_wt,
       ord_ln_dly_pk,
       order_no,
       order_seq,
       delivery_no,
       stove_no,
       flag_stove_no,
       judge_result,
       judge_result_time,
       judge_maker,
       judge_tolresult_code,
       judge_tolresult,
       judge_tolresult_time,
       judge_tolmaker,
       jugde_tolconvicted,
       jugde_convicted,
       zbs_id,
       zbs_flag,
       judge_result_code,
       produccode_jg,
       produccode_jg_desc,
       instancy_flag,
       mat_no_old,
       produccode_bl,
       producname_bl,
       std_code_bl,
       std_name_bl,
       steelcode_bl,
       steelname_bl,
       std_style_bl,
       std_style_desc_bl,
       model_code_bl,
       model_desc_bl,
       min_d_bl,
       min_h_bl,
       jg_orderno_all)
      select mat_no,
             result_no,
             zy_plan_id,
             wo_id,
             pline_code,
             pline_name,
             judge_stove_no,
             batch_no,
             bl_wl_id,
             min_d,
             min_h,
             code_jg,
             gradecode,
             gradename,
             steelcode,
             steelname,
             model_code,
             model_desc,
             outdiameter,
             wallthick,
             spec_jg,
             spec_jg_desc,
             style_jg,
             diameter,
             check_j_val,
             aimlength,
             singleweight,
             monitordemand,
             if_monitor_jg,
             prdcr_no,
             producer,
             V_PRO_NUM,
             '',
             col_operator,
             rro_time,
             pro_shift,
             pro_group,
             V_CREATE_NAME,
             SYSDATE,
             '',
             '',
             f_in_time,
             bl_wl_desc,
             memo,
             demand_detection,
             demand_blast,
             demand_bonderizing,
             demand_copper,
             coat_type,
             belong_code,
             belong_name,
             code_jg_bl,
             craft_file_no,
             craft_seq,
             lock_flag,
             mng_lock_flag,
             mng_lock_remark,
             lock_remark,
             deter_status,
             deter_no,
             deter_results,
             final_user_desc,
             mat_origin_code,
             mat_origin_name,
             soure_code,
             soure_name,
             judge_std_name,
             lock_liku,
             deter_no_seq,
             qcm_staus,
             fail_num,
             fail_wt,
             ord_ln_dly_pk,
             order_no,
             order_seq,
             delivery_no,
             stove_no,
             flag_stove_no,
             judge_result,
             judge_result_time,
             judge_maker,
             judge_tolresult_code,
             judge_tolresult,
             judge_tolresult_time,
             judge_tolmaker,
             jugde_tolconvicted,
             jugde_convicted,
             zbs_id,
             zbs_flag,
             judge_result_code,
             produccode_jg,
             produccode_jg_desc,
             instancy_flag,
             mat_no_old,
             produccode_bl,
             producname_bl,
             std_code_bl,
             std_name_bl,
             steelcode_bl,
             steelname_bl,
             std_style_bl,
             std_style_desc_bl,
             model_code_bl,
             model_desc_bl,
             min_d_bl,
             min_h_bl,
             jg_orderno_all
        from COUPLING_MAT_M T
       WHERE T.MAT_NO = V_MAT_NO;
  
    IF (V_PRO_NUM >= MYROW.PRO_NUM) THEN
      DELETE FROM COUPLING_MAT_M T WHERE T.MAT_NO = V_MAT_NO;
      DELETE FROM COUPLING_MAT_BUTTRESS T WHERE T.MAT_NO = V_MAT_NO;
    ELSE
      UPDATE COUPLING_MAT_M T
         SET T.PRO_NUM = MYROW.PRO_NUM - V_PRO_NUM,
             T.PRO_WT  = TO_CHAR(MYROW.PRO_WT * (MYROW.PRO_NUM - V_PRO_NUM) /
                                 MYROW.PRO_NUM,
                                 '99990.000')
       WHERE T.MAT_NO = V_MAT_NO;
    
      UPDATE COUPLING_MAT_BUTTRESS T
         SET T.PIECES = MYROW.PRO_NUM - V_PRO_NUM,
             T.WEIGHT = TO_CHAR(MYROW.PRO_WT * (MYROW.PRO_NUM - V_PRO_NUM) /
                                MYROW.PRO_NUM,
                                '99990.000')
       WHERE T.MAT_NO = V_MAT_NO;
    END IF;
  END LOOP;
END;

          ]]>
	</query>
	
	<query id="FrmJGMatNoReport.getBaseMaterialForChoose" desc="查询基础物料投入与产出 接箍">
		<![CDATA[
SELECT distinct
       T.OUT_MATERIAL_NO BASECODE,
       A.OUT_MATERIAL_DESC BASENAME
  FROM SLM_BASE_MATERIAL_H_PL T
   JOIN SLM_BASE_MATERIAL_H A
    ON A.IN_MATERIAL_NO = T.IN_MATERIAL_NO
   AND A.OUT_MATERIAL_NO = T.OUT_MATERIAL_NO
		]]>
	</query>
	
	<query id="FrmJGMatNoReport.doUpdate" desc="查询基础物料投入与产出 接箍">
		<![CDATA[
UPDATE COUPLING_MAT_M T 
		SET T.BL_WL_ID=?,
			T.BL_WL_DESC=?
		WHERE T.MAT_NO=?
		]]>
	</query>
	
</queryMap>