<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="检验报告">
	<query id="QcmJyQueryFrm.getOrderInfo" desc="查询合同信息">
	<![CDATA[
	SELECT T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.ORDER_NO || '/' || T.ORDER_SEQ ORDER_NO
  FROM YDM_ZC_OUTLIST T
 WHERE 1 = 1 #something#
 GROUP BY T.MATERIAL_NO,
          T.MATERIAL_NAME,
          T.PRODUCCODE,
          T.PRODUCNAME,
          T.STD_CODE,
          T.STD_NAME,
          T.GRADECODE,
          T.GRADENAME,
          T.STEELCODE,
          T.STEELNAME,
          T.STD_STYLE,
          T.STD_STYLE_DESC,
          T.SPEC_CODE,
          T.SPEC_NAME,
          T.MODEL_CODE,
          T.MODEL_DESC,
          T.ORDER_NO,
          T.ORDER_SEQ
	]]>
	</query>
	
	<query id="QcmJyQueryFrm.getOrderInfoXD" desc="查询合同信息(虚单)">
	<![CDATA[
	SELECT T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.ORDER_NO || '/' || T.ORDER_SEQ ORDER_NO
  FROM YDM_ZC_BILL_C T
 WHERE 1 = 1 #something#
 GROUP BY T.MATERIAL_NO,
          T.MATERIAL_NAME,
          T.PRODUCCODE,
          T.PRODUCNAME,
          T.STD_CODE,
          T.STD_NAME,
          T.GRADECODE,
          T.GRADENAME,
          T.STEELCODE,
          T.STEELNAME,
          T.STD_STYLE,
          T.STD_STYLE_DESC,
          T.SPEC_CODE,
          T.SPEC_NAME,
          T.MODEL_CODE,
          T.MODEL_DESC,
          T.ORDER_NO,
          T.ORDER_SEQ
	]]>
	</query>
	
	<query id="QcmJyQueryFrm.getJustStoveNo" desc="查询炉批信息">
	<![CDATA[
	SELECT T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.BATCH_GROUD_NO,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       T.BILL_NO,
       SUM(T.ACT_COUNT) ACT_COUNT,
       SUM(T.ACT_WEIGHT) ACT_WEIGHT,
       T.ORDER_NO || '/' || T.ORDER_SEQ ORDER_NO

  FROM YDM_ZC_OUTLIST T
 WHERE 1 = 1 #something#
 GROUP BY T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.BATCH_GROUD_NO,
          T.MATERIAL_NO,
          T.MATERIAL_NAME,
          T.PRODUCCODE,
          T.PRODUCNAME,
          T.STD_CODE,
          T.STD_NAME,
          T.GRADECODE,
          T.GRADENAME,
          T.STEELCODE,
          T.STEELNAME,
          T.STD_STYLE,
          T.STD_STYLE_DESC,
          T.SPEC_CODE,
          T.SPEC_NAME,
          T.MODEL_CODE,
          T.MODEL_DESC,
          T.ACT_DIMATER,
          T.ACT_HEIGHT,
          T.ACT_LEN_MIN,
          T.ACT_LEN_MAX,
          T.BILL_NO,
          T.ORDER_NO,
          T.ORDER_SEQ

	]]>
	</query>
	
	<query id="QcmJyQueryFrm.getJustStoveNoXD" desc="查询炉批信息(虚单)">
	<![CDATA[
	SELECT T.JUDGE_STOVE_NO,
       T.BATCH_NO,
       T.GROUP_NO BATCH_GROUD_NO,
       T.MATERIAL_NO,
       T.MATERIAL_NAME,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.GRADECODE,
       T.GRADENAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.ACT_DIMATER,
       T.ACT_HEIGHT,
       T.ACT_LEN_MIN,
       T.ACT_LEN_MAX,
       T.BILL_NO,
       SUM(T.ACT_COUNT) ACT_COUNT,
       SUM(T.ACT_WEIGHT) ACT_WEIGHT,
       T.ORDER_NO || '/' || T.ORDER_SEQ ORDER_NO

  FROM YDM_ZC_BILL_C T
 WHERE 1 = 1 #something#
 GROUP BY T.JUDGE_STOVE_NO,
          T.BATCH_NO,
          T.GROUP_NO,
          T.MATERIAL_NO,
          T.MATERIAL_NAME,
          T.PRODUCCODE,
          T.PRODUCNAME,
          T.STD_CODE,
          T.STD_NAME,
          T.GRADECODE,
          T.GRADENAME,
          T.STEELCODE,
          T.STEELNAME,
          T.STD_STYLE,
          T.STD_STYLE_DESC,
          T.SPEC_CODE,
          T.SPEC_NAME,
          T.MODEL_CODE,
          T.MODEL_DESC,
          T.ACT_DIMATER,
          T.ACT_HEIGHT,
          T.ACT_LEN_MIN,
          T.ACT_LEN_MAX,
          T.BILL_NO,
          T.ORDER_NO,
          T.ORDER_SEQ

	]]>
	</query>
	
	<query id="QcmJyQueryFrm.getQcmJyPath" desc="查询检验报告">
	<![CDATA[
	SELECT T.YEAR,
       T.SEQ,
       T.ORDER_NO,
       T.JY_NAME,
       T.JY_PATH,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       DECODE(T.PRINT_FLAG, '0', '未打印', '1', '已打印') PRINT_FLAG,
       T.PRINT_NUM,
       TO_CHAR(T.PRINT_TIME, 'YYYY-MM-DD HH24:MI:SS') PRINT_TIME,
       T.PRINT_NAME
  FROM QCM_JY_PATH T
 WHERE 1 = 1 #something#
 ORDER BY T.YEAR, T.SEQ
	]]>
	</query>
	
	<query id="QcmJyQueryFrm.AddJyReport" desc="生成检验报告">
	<![CDATA[
	INSERT INTO QCM_JY_PATH
  (YEAR, SEQ, ORDER_NO, JY_NAME, JY_PATH, CREATE_NAME, CREATE_TIME)
VALUES
  (?, ?, ?, ?, ?, ?, SYSDATE)
	]]>
	</query>
	
	<query id="QcmJyQueryFrm.doQueryJyYearSeq" desc="生成检验报告编号">
	<![CDATA[
	SELECT LPAD(NVL(MAX(T.SEQ), 0) + 1, 6, 0) SEQ
  FROM QCM_JY_PATH T
 WHERE T.YEAR = ?
	]]>
	</query>
	
	<query id="QcmJyQueryFrm.updateYearSeqNull" desc="清空检验报告编号">
	<![CDATA[
	UPDATE YDM_ZC_OUTLIST T SET T.YEAR_SEQ = '' WHERE T.YEAR_SEQ = ?
	]]>
	</query>
	
	<query id="QcmJyQueryFrm.updateYdmZcYearSeq" desc="标记出库表检验报告编号">
	<![CDATA[
	UPDATE YDM_ZC_OUTLIST T
   SET T.YEAR_SEQ = ?
 WHERE T.ORDER_NO = SUBSTR(?, 1, INSTR(?, '/') - 1)
   AND T.ORDER_SEQ = SUBSTR(?, INSTR(?, '/') + 1)
   AND T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   AND NVL(T.BILL_NO, '/') = NVL(?, '/')
   AND ROWNUM <= ?

	]]>
	</query>
	
	<query id="QcmJyQueryFrm.updateYearSeqNullXD" desc="清空检验报告编号（虚单）">
	<![CDATA[
	UPDATE YDM_ZC_BILL_C T SET T.YEAR_SEQ = '' WHERE T.YEAR_SEQ = ?
	]]>
	</query>
	
	<query id="QcmJyQueryFrm.updateYdmZcYearSeqXD" desc="标记出库表检验报告编号（虚单）">
	<![CDATA[
	UPDATE YDM_ZC_BILL_C T
   SET T.YEAR_SEQ = ?
 WHERE T.ORDER_NO = SUBSTR(?, 1, INSTR(?, '/') - 1)
   AND T.ORDER_SEQ = SUBSTR(?, INSTR(?, '/') + 1)
   AND T.JUDGE_STOVE_NO = ?
   AND T.BATCH_NO = ?
   AND NVL(T.BILL_NO, '/') = NVL(?, '/')
   AND ROWNUM <= ?

	]]>
	</query>
	
</queryMap>