<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="同步检化验小样热处理">
	<query id="SampleHeatTreatmentToQcm.getPipeCheckConsignDetail" desc="获取委托明细信息表">
		<![CDATA[
SELECT CHECK_NO,
       BATCH_NO,
       SAMPLE_NO,
       SAMPLE_NO_MIN,
       SAMPLE_BARCODE,
       SAMPLE_LEN,
       CHECK_STD,
       PHY_CODE_MAX,
       PHY_NAME_MAX,
       SAMPLE_COUNT,
       DEPT_ID,
       LENGTH,
       WIDTH,
       EIC,
       PHY_DIR,
       SIZE_DESC,
       JG_SEND_NAME,
       JG_SEND_TIME,
       LAB_RECEIVE_NAME,
       LAB_RECEIVE_TIME,
       CHECK_TEMP,
       DEVICE_NO,
       DEVICE_NAME,
       CHECK_SHIFT,
       CHECK_CLASS,
       CHECK_NAME,
       CHECK_TIME,
       AUDIT_NAME,
       AUDIT_TIME,
       ISRCL,
       RCL_MOVE_REMARK,
       IS_NOTICE_PRODUCER,
       NOTICE_PRODUCER_REMARK,
       IS_RESAMPLE_REST,
       RESAMPLE_REST_REMARK,
       SPEC_FLAG,
       SPEC_MOVE_REMARK,
       FLAG,
       SAMPLE_REMARK,
       REMARK,
       FORMUAL_NO,
       FORMUAL_NAME,
       MAT_NO,
       SAMPLE_TYPE,
       FOR_CHECK_NO,
       VALIDFLAG,
       CHECK_HUMIDITY,
       STD_STEEL_NO,
       STD_STEEL_TYPE,
       STD_STEEL_VALUE,
       ACTUAL_VALUE,
       HARDNESS_TYPE,
       RATE,
       DESC_RATE,
       SSC_CONDITION,
       JG_SEND_SHIFT,
       JG_SEND_GROUP,
       JG_PRINT_COUNT,
       RCL_AUDIT_NAME,
       RCL_AUDIT_TIME,
       ORIGINAL_AREA,
       LAB_PRINT_COUNT,
       RCL_FLAG
  FROM PIPE_CHECKCONSIGN_DETAIL
     WHERE CHECK_NO =?
      and ISRCL >= '4'
		]]>
	</query>
	<query id="SampleHeatTreatmentToQcm.getCheckNo" desc="获取未同步的检验编号">
		<![CDATA[
SELECT DISTINCT CHECK_NO
  FROM PIPE_CHECKCONSIGN_DETAIL
 WHERE ISRCL >='4'
   AND RCL_FLAG = '0'
		]]>
	</query>

	<query id="SampleHeatTreatmentToQcm.getPipePhyInfo" desc="获取小样热处理信息">
		<![CDATA[
SELECT CHECK_NO,
       SAMPLE_NO,
       CHECK_NAME,
       TO_CHAR(CHECK_TIME, 'YYYY-MM-DD HH24:MI:SS') CHECK_TIME,
       CHECK_CLASS,
       DEVICE_NAME_CH,
       DEVICE_NO_CH,
       ZL_TEMP_CH,
       JR_TEMP_CH,
       CL_TEMP_CH,
       ZL_TIME_CH,
       BW_TIME_CH,
       CL_TIME_CH,
       LQ_METHOD_CH,
       DEVICE_NAME_HH,
       DEVICE_NO_HH,
       ZL_TEMP_HH,
       JR_TEMP_HH,
       CL_TEMP_HH,
       ZL_TIME_HH,
       BW_TIME_HH,
       CL_TIME_HH,
       LQ_METHOD_HH,
       RCL_INFO,
       REMARK,
       (SELECT DBMS_LOB.SUBSTR(WM_CONCAT(DISTINCT MAT_NO), 80, 1)
          FROM PIPE_CHECKCONSIGN_DETAIL
         WHERE CHECK_NO = T.CHECK_NO
           AND SAMPLE_NO = T.SAMPLE_NO) MAT_NO
  FROM PIPE_PHY_RCL_INFO T
 WHERE CHECK_NO = ?
		]]>
	</query>

	<query id="SampleHeatTreatmentToQcm.getUpdateFlag" desc="修改标志位">
		<![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
              SET T.RCL_FLAG = '1'
            WHERE T.CHECK_NO = ?
		]]>
	</query>


	<query id="SampleHeatTreatmentToQcm.InsertQcmPhyRclInfo" desc="插入小样热处理数据">
		<![CDATA[
INSERT INTO QCM_PHY_RCL_INFO
  (CHECK_NO,
   SAMPLE_NO,
   CHECK_NAME,
   CHECK_TIME,
   CHECK_CLASS,
   DEVICE_NAME_CH,
   DEVICE_NO_CH,
   ZL_TEMP_CH,
   JR_TEMP_CH,
   CL_TEMP_CH,
   ZL_TIME_CH,
   BW_TIME_CH,
   CL_TIME_CH,
   LQ_METHOD_CH,
   DEVICE_NAME_HH,
   DEVICE_NO_HH,
   ZL_TEMP_HH,
   JR_TEMP_HH,
   CL_TEMP_HH,
   ZL_TIME_HH,
   BW_TIME_HH,
   CL_TIME_HH,
   LQ_METHOD_HH,
   RCL_INFO,
   REMARK,
   REPORT_PATH,
   MAT_NO)
VALUES
  ('#CHECK_NO#',
   '#SAMPLE_NO#',
   '#CHECK_NAME#',
   TO_DATE('#CHECK_TIME#', 'YYYY-MM-DD HH24:MI:SS'),
   '#CHECK_CLASS#',
   '#DEVICE_NAME_CH#',
   '#DEVICE_NO_CH#',
   '#ZL_TEMP_CH#',
   '#JR_TEMP_CH#',
   '#CL_TEMP_CH#',
   '#ZL_TIME_CH#',
   '#BW_TIME_CH#',
   '#CL_TIME_CH#',
   '#LQ_METHOD_CH#',
   '#DEVICE_NAME_HH#',
   '#DEVICE_NO_HH#',
   '#ZL_TEMP_HH#',
   '#JR_TEMP_HH#',
   '#CL_TEMP_HH#',
   '#ZL_TIME_HH#',
   '#BW_TIME_HH#',
   '#CL_TIME_HH#',
   '#LQ_METHOD_HH#',
   '#RCL_INFO#',
   '#REMARK#',
   '#REPORT_PATH#',
   '#MAT_NO#')
		]]>
	</query>


	<query id="SampleHeatTreatmentToQcm.InsertQcmPhyRclDetail" desc="插入小样热处理详细数据">
		<![CDATA[
INSERT INTO QCM_PHY_RCL_DETAIL
  (CHECK_NO, SAMPLE_NO, PHY_CODE_MAX, PHY_NAME_MAX, SAMPLE_COUNT)
VALUES
  ('#CHECK_NO#',
   '#SAMPLE_NO#',
   '#PHY_CODE_MAX#',
   '#PHY_NAME_MAX#',
   '#SAMPLE_COUNT#')
		]]>
	</query>

	<query id="SampleHeatTreatmentToQcm.DeleteQcmPhyRclInfo" desc="">
		<![CDATA[
DELETE FROM QCM_PHY_RCL_INFO WHERE CHECK_NO =?

		]]>
	</query>

	<query id="SampleHeatTreatmentToQcm.DeleteQcmPhyRclDetail" desc="">
		<![CDATA[
DELETE FROM QCM_PHY_RCL_DETAIL WHERE CHECK_NO =?

		]]>
	</query>

</queryMap>
