<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="同步检化验成品理化到质量理化">
	<query id="JhyCpPhyToQcmPhyTask.getPipeCheckConsignDetail" desc="获取成品理化实绩主表">
		<![CDATA[
SELECT *
  FROM (SELECT T.CHECK_NO,
               wm_concat(T.PHY_CODE_MAX) PHY_CODE_MAX,
               MIN(A.LOT_NO) LOT_NO,
               MIN(A.STOVE_NO) STOVE_NO,
               MIN(A.HEAT_NO) JUDGE_STOVE_NO,
               MIN(T.BATCH_NO) BATCH_NO,
               MIN(A.CHECK_COUNT) SAMPLE_TYPE,
               MIN(A.CONSIGN_DEPT) CONSIGNER,
               MIN(A.PLINE_CODE) PLINE_CODE,
               MIN(A.CRAFT_SOURCE) CRAFT_SOURCE,
               MIN(A.CAILI_PATH) CAILI_PATH,
               MIN(A.FUSHI_PATH) FUSHI_PATH,
               MIN(A.JINWU_PATH) JINWU_PATH,
               MIN(A.GONGCHENG_PATH) GONGCHENG_PATH,
               MIN(A.DIBEI_PATH) DIBEI_PATH,
               MIN(A.HUAXUE_PATH) HUAXUE_PATH,
               MIN(A.LOT_NO_GROUP) LOT_NO_GROUP
          FROM PIPE_CHECKCONSIGN_DETAIL T, PIPE_CHECKCONSIGN_BASEINFO A
         WHERE T.PHY_CODE_MAX NOT IN ('HX',
                                      'ONH',
                                      'C0030',
                                      'C0031',
                                      'C0032',
                                      'C0033',
                                      'C0133',
                                      'C0147',
                                      'C0150',
                                      'C0007',
                                      'C0146',
                                      'C0061',
                                      'C0065',
                                      'C0148')
           AND A.CHECK_NO = T.CHECK_NO
           AND A.CRAFT_SOURCE IN ('0', '1', '6', '7')
           AND T.FLAG = '4'
           AND T.VALIDFLAG = '0'
           AND (SELECT COUNT(1)
                  FROM PIPE_CHECKCONSIGN_DETAIL B
                 WHERE B.CHECK_NO = T.CHECK_NO
                   AND B.PHY_CODE_MAX NOT IN ('HX',
                                              'ONH',
		                                      'C0030',
		                                      'C0031',
		                                      'C0032',
		                                      'C0033',
		                                      'C0133',
		                                      'C0147',
		                                      'C0150',
		                                      'C0007',
		                                      'C0146',
		                                      'C0061',
		                                      'C0065',
		                                      'C0148')
                   AND B.VALIDFLAG = '0') =
               (SELECT COUNT(1)
                  FROM PIPE_CHECKCONSIGN_DETAIL B
                 WHERE B.CHECK_NO = T.CHECK_NO
                   AND B.PHY_CODE_MAX NOT IN ('HX',
                                              'ONH',
                                              'C0030',
                                              'C0031',
                                              'C0032',
                                              'C0033',
                                              'C0133',
                                              'C0147',
                                              'C0150',
                                              'C0007',
                                              'C0146',
		                                      'C0061',
		                                      'C0065',
		                                      'C0148')
                   AND B.FLAG = T.FLAG
                   AND B.VALIDFLAG = '0')
         GROUP BY T.CHECK_NO
        UNION ALL
        SELECT T.CHECK_NO,
               wm_concat(T.PHY_CODE_MAX) PHY_CODE_MAX,
               MIN(A.LOT_NO) LOT_NO,
               MIN(A.STOVE_NO) STOVE_NO,
               MIN(A.HEAT_NO) JUDGE_STOVE_NO,
               MIN(T.BATCH_NO) BATCH_NO,
               MIN(A.CHECK_COUNT) SAMPLE_TYPE,
               MIN(A.CONSIGN_DEPT) CONSIGNER,
               MIN(A.PLINE_CODE) PLINE_CODE,
               MIN(A.CRAFT_SOURCE) CRAFT_SOURCE,
               MIN(A.CAILI_PATH) CAILI_PATH,
               MIN(A.FUSHI_PATH) FUSHI_PATH,
               MIN(A.JINWU_PATH) JINWU_PATH,
               MIN(A.GONGCHENG_PATH) GONGCHENG_PATH,
               MIN(A.DIBEI_PATH) DIBEI_PATH,
               MIN(A.HUAXUE_PATH) HUAXUE_PATH,
               MIN(A.LOT_NO_GROUP) LOT_NO_GROUP
          FROM PIPE_CHECKCONSIGN_DETAIL T, PIPE_CHECKCONSIGN_BASEINFO A
         WHERE T.PHY_CODE_MAX IN
               ('C0030', 'C0031', 'C0032', 'C0033', 'C0133', 'C0147','C0150')
           AND A.CHECK_NO = T.CHECK_NO
           AND A.CRAFT_SOURCE IN ('0', '1', '6', '7')
           AND T.FLAG = '4'
           AND T.VALIDFLAG = '0'
           AND (SELECT COUNT(1)
                  FROM PIPE_CHECKCONSIGN_DETAIL B
                 WHERE B.CHECK_NO = T.CHECK_NO
                   AND B.PHY_CODE_MAX IN
                       ('C0030', 'C0031', 'C0032', 'C0033', 'C0133', 'C0147','C0150')
                   AND B.VALIDFLAG = '0') =
               (SELECT COUNT(1)
                  FROM PIPE_CHECKCONSIGN_DETAIL B
                 WHERE B.CHECK_NO = T.CHECK_NO
                   AND B.PHY_CODE_MAX IN
                       ('C0030', 'C0031', 'C0032', 'C0033', 'C0133', 'C0147','C0150')
                   AND B.FLAG = T.FLAG
                   AND B.VALIDFLAG = '0')
         GROUP BY T.CHECK_NO
        UNION ALL
        SELECT T.CHECK_NO,
               wm_concat(T.PHY_CODE_MAX) PHY_CODE_MAX,
               MIN(A.LOT_NO) LOT_NO,
               MIN(A.STOVE_NO) STOVE_NO,
               MIN(A.HEAT_NO) JUDGE_STOVE_NO,
               MIN(T.BATCH_NO) BATCH_NO,
               MIN(A.CHECK_COUNT) SAMPLE_TYPE,
               MIN(A.CONSIGN_DEPT) CONSIGNER,
               MIN(A.PLINE_CODE) PLINE_CODE,
               MIN(A.CRAFT_SOURCE) CRAFT_SOURCE,
               MIN(A.CAILI_PATH) CAILI_PATH,
               MIN(A.FUSHI_PATH) FUSHI_PATH,
               MIN(A.JINWU_PATH) JINWU_PATH,
               MIN(A.GONGCHENG_PATH) GONGCHENG_PATH,
               MIN(A.DIBEI_PATH) DIBEI_PATH,
               MIN(A.HUAXUE_PATH) HUAXUE_PATH,
               MIN(A.LOT_NO_GROUP) LOT_NO_GROUP
          FROM PIPE_CHECKCONSIGN_DETAIL T, PIPE_CHECKCONSIGN_BASEINFO A
         WHERE T.PHY_CODE_MAX IN ('C0007', 'C0146','C0061','C0065','C0148')
           AND A.CHECK_NO = T.CHECK_NO
           AND A.CRAFT_SOURCE IN ('0', '1', '6', '7')
           AND T.FLAG = '4'
           AND T.VALIDFLAG = '0'
           AND (SELECT COUNT(1)
                  FROM PIPE_CHECKCONSIGN_DETAIL B
                 WHERE B.CHECK_NO = T.CHECK_NO
                   AND B.PHY_CODE_MAX IN ('C0007', 'C0146','C0061','C0065','C0148')
                   AND B.VALIDFLAG = '0') =
               (SELECT COUNT(1)
                  FROM PIPE_CHECKCONSIGN_DETAIL B
                 WHERE B.CHECK_NO = T.CHECK_NO
                   AND B.PHY_CODE_MAX IN ('C0007', 'C0146','C0061','C0065','C0148')
                   AND B.FLAG = T.FLAG
                   AND B.VALIDFLAG = '0')
         GROUP BY T.CHECK_NO)
 WHERE ROWNUM <= 50
		]]>
	</query>
	
	<query id="JhyCpPhyToQcmPhyTask.getPipeCheckConsignPhyDetail" desc="获取成品理化实绩主表">
		<![CDATA[
SELECT T.PHYDETAIL_ID,
       T.CHECK_NO,
       T.BATCH_NO,
       T.SAMPLE_NO,
       T.INDEX_SEQ,
       T.DEPT_ID,
       T.PHY_CODE_MAX,
       T.PHY_NAME_MAX,
       T.PHY_CODE_MIN,
       T.PHY_NAME_MIN,
       T.PHY_CODE,
       T.PHY_NAME,
       T.PHY_UNIT,
       T.ITEM_CODE_F,
       T.ITEM_NAME_F,
       T.ITEM_CODE_W,
       T.ITEM_NAME_W,
       T.ITEM_CODE_S,
       T.ITEM_NAME_S,
       T.GROUP_SEQ,
       T.RESULT_COUNT,
       T.ISCHECK,
       T.ISJUDGE,
       T.ISQUOTE,
       T.PHY_TYPE,
       T.PHY_FORMULA,
       T.STDMIN_SIGN,
       T.STDMIN,
       T.STDMAX_SIGN,
       T.STDMAX,
       T.JUDGE_BASIS,
       T.STDMIN_SIGN2,
       T.STDMIN2,
       T.STDMAX_SIGN2,
       T.STDMAX2,
       T.STD_CHOOSE,
       T.STDMEMO,
       T.ADDCONDITION,
       T.ADDSTDCON_CODE,
       T.ADDSTD_MIN_SIGN,
       T.ADDSTD_MIN,
       T.ADDSTD_MAX_SIGN,
       T.ADDSTD_MAX,
       T.ADDPERCENT,
       T.BILLET_SAMPLE,
       T.REMARK,
       T.VALUE1,
       T.VALUE2,
       T.VALUE3,
       T.VALUE4,
       T.VALUE5,
       T.VALUE6,
       T.VALUE7,
       T.VALUE8,
       T.VALUE9,
       T.VALUE10,
       T.VALUE11,
       T.VALUE12,
       T.VALUE13,
       T.VALUE14,
       T.VALUE15,
       T.AVERAGE_VALUE
  FROM PIPE_CHECKCONSIGN_PHYDETAIL T
 WHERE T.CHECK_NO = {0}
   AND T.SAMPLE_NO = {1}
		]]>
	</query>
	
	<query id="JhyCpPhyToQcmPhyTask.clear" desc="清除质量理化表">
		<![CDATA[
DELETE FROM (SELECT *
               FROM QCM_JHY_PHYRESULT T
              WHERE T.SAMPLE_ID = {0}
                AND T.PHY_CODE_MIN = {1})
		]]>
	</query>

	
	 <query id="JhyCpPhyToQcmPhyTask.Insert" desc="新增">
        <![CDATA[
INSERT INTO QCM_JHY_PHYRESULT
  (SAMPLE_ID,
   SAMPLE_NO,
   INDEX_SEQ,
   LOT_NO,
   STOVE_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   SAMPLE_TYPE,
   CONSIGNER,
   PLINE_CODE,
   PHY_CODE_MAX,
   PHY_NAME_MAX,
   PHY_CODE_MIN,
   PHY_NAME_MIN,
   PHY_CODE,
   PHY_NAME,
   ITEM_CODE_F,
   ITEM_NAME_F,
   ITEM_CODE_W,
   ITEM_NAME_W,
   ITEM_CODE_S,
   ITEM_NAME_S,
   VALUE1,
   VALUE2,
   VALUE3,
   VALUE4,
   VALUE5,
   VALUE6,
   VALUE7,
   VALUE8,
   VALUE9,
   VALUE10,
   VALUE11,
   VALUE12,
   VALUE13,
   VALUE14,
   VALUE15,
   AVERAGE,
   CREATE_NAME,
   CREATE_TIME,
   FILE_PATH,
   FOR_CHECK_NO,
   RATE,
   IS_GOOD,
   IS_DEFECT,
   ISRCL,
   MAT_NO,
   HEAD_MAT_NO,
   BAR_CODE,
   CHECK_TEMP,
   HARDNESS_TYPE,
   PHY_CODE_DIR,
   PHY_NAME_DIR,
   SAMPLE_STYLE,
   SAMPLE_SIZE,
   LOT_NO_GROUP,
   VALUE_KSI,
   VALUE_PSI,
   VALUE_F2,
   VALUE_F3,
   AVERAGE_VALUE_F,
   REMARK,
   SAMPLE_JB,
   NOTCH_SHAPE)
VALUES
  ('#SAMPLE_ID#',
   '#SAMPLE_NO#',
   (SELECT NVL(MAX(T.INDEX_SEQ), 0) + 1
      FROM QCM_JHY_PHYRESULT T
     WHERE T.SAMPLE_ID = '#SAMPLE_ID#'
       AND T.SAMPLE_NO = '#SAMPLE_NO#'),
   '#LOT_NO#',
   '#STOVE_NO#',
   '#JUDGE_STOVE_NO#',
   '#BATCH_NO#',
   '#SAMPLE_TYPE#',
   '#CONSIGNER#',
   '#PLINE_CODE#',
   '#PHY_CODE_MAX#',
   '#PHY_NAME_MAX#',
   '#PHY_CODE_MIN#',
   '#PHY_NAME_MIN#',
   '#PHY_CODE#',
   '#PHY_NAME#',
   '#ITEM_CODE_F#',
   '#ITEM_NAME_F#',
   '#ITEM_CODE_W#',
   '#ITEM_NAME_W#',
   '#ITEM_CODE_S#',
   '#ITEM_NAME_S#',
   '#VALUE1#',
   '#VALUE2#',
   '#VALUE3#',
   '#VALUE4#',
   '#VALUE5#',
   '#VALUE6#',
   '#VALUE7#',
   '#VALUE8#',
   '#VALUE9#',
   '#VALUE10#',
   '#VALUE11#',
   '#VALUE12#',
   '#VALUE13#',
   '#VALUE14#',
   '#VALUE15#',
   '#AVERAGE#',
   '#CREATE_NAME#',
   SYSDATE,
   '#FILE_PATH#',
   '#FOR_CHECK_NO#',
   '#RATE#',
   '#IS_GOOD#',
   '#IS_DEFECT#',
   '#ISRCL#',
   '#MAT_NO#',
   '#HEAD_MAT_NO#',
   '#BAR_CODE#',
   '#CHECK_TEMP#',
   '#HARDNESS_TYPE#',
   '#PHY_CODE_DIR#',
   '#PHY_NAME_DIR#',
   '#SAMPLE_STYLE#',
   '#SAMPLE_SIZE#',
   '#LOT_NO_GROUP#',
   '#VALUE_KSI#',
   '#VALUE_PSI#',
   '#VALUE_F2#',
   '#VALUE_F3#',
   '#AVERAGE_VALUE_F#',
   '#REMARK#',   '#SAMPLE_JB#',
   '#NOTCH_SHAPE#')
        ]]>
    </query>
    
    <query id="JhyCpPhyToQcmPhyTask.clearLabInfo" desc="清除质量实验室记录表">
		<![CDATA[
		DELETE QCM_CHECKCONSIGN_LAB_RESULT T  WHERE T.CHECK_NO = {0}
		]]>
	</query>
	
		<query id="JhyCpPhyToQcmPhyTask.getLabInfoByCheckNo" desc="通过检验编号查询">
		<![CDATA[
		SELECT 
			CHECK_NO,
			SAMPLE_NO,
			PHY_CODE_MAX,
			STANDARD,
			TEST_DATE,
			REPORTED_DATE,
			REPORTED_NAME,
			APPROVED_NAME,
			SAMPLE_NO1,
			SAMPLE_NO2,
			SAMPLE_NO3,
			SPECIMEN_SIZE1,
			SPECIMEN_SIZE2,
			SPECIMEN_SIZE3,
			NACE_PH_S1,
			NACE_PH_F1,
			NACE_PH_S2,
			NACE_PH_F2,
			NACE_PH_S3,
			NACE_PH_F3,
			NACE_SOLUTION_S1,
			NACE_SOLUTION_F1,
			NACE_SOLUTION_S2,
			NACE_SOLUTION_F2,
			NACE_SOLUTION_S3,
			NACE_SOLUTION_F3,
			PSEUDO_STRESS,
			SECTION_NO11,
			SECTION_NO12,
			SECTION_NO21,
			SECTION_NO22,
			TEST_TIME,
			TEST_TEMP1,
			TEST_TEMP2,
			TEST_TEMP3,
			NOTE,
			NACE_PH_NAME,
			YSMIN_NAME,
			YSMIN1,
			YSMIN2,
			YSMIN3,
			ACTUAL_S_YSMIN1,
			ACTUAL_S_YSMIN2,
			ACTUAL_S_YSMIN3,
			ACTUAL_LOAD1,
			ACTUAL_LOAD2,
			ACTUAL_LOAD3,
			CRACK_LENGTH1,
			CRACK_LENGTH2,
			CRACK_LENGTH3,
			PRESET_LOAD1,
			PRESET_LOAD2,
			PRESET_LOAD3,
			NACE_H2S_NAME,
			TEST_SOLUTION,
			SURFACE_AREA1,
			SURFACE_AREA2,
			SURFACE_AREA3,
			WEIGHT_BEFORE_TEST1,
			WEIGHT_BEFORE_TEST2,
			WEIGHT_BEFORE_TEST3,
			WEIGHT_AFTER_TEST1,
			WEIGHT_AFTER_TEST2,
			WEIGHT_AFTER_TEST3,
			LOSS_OF_WEIGHT1,
			LOSS_OF_WEIGHT2,
			LOSS_OF_WEIGHT3,
			MASS_LOSS1,
			MASS_LOSS2,
			MASS_LOSS3,
			PITTING_DENSITY1,
			PITTING_DENSITY2,
			PITTING_DENSITY3,
			PITTING_COUNT1,
			PITTING_COUNT2,
			PITTING_COUNT3,
			NACE_PH,
			CLEANING_SAMPLE,
			COLLECTION_RATE,
			SPRAY_TYPE,
			ANGLE,
			SAMPLE_TYPE,
			CONCENTRATION,
			TEST_ITEM,
			CONNECTION,
			PROOF_RING_NO1,
			PROOF_RING_NO2,
			PROOF_RING_NO3,
			PRESSURE_MEDIUM,
			WEIGHT,
			TEST_RESULT,
			LOAD_LEVEL,
			LOAD_LEVEL2,
			LOAD_LEVEL3,
			YING_ACTUAL_LOAD1,
			YING_ACTUAL_LOAD2,
			YING_ACTUAL_LOAD3,
			REPORT_NO,
			YING_ADD1,
			YING_ADD2,
			YING_ADD3,
			TEST_RESULT2,
			TEST_SPECIMENS1,
			TEST_SPECIMENS2,
			TEST_GAS,
			SAMPLING_ORIENTATION,
			DMTS,
			SAMPLING_LOCATION,
			TEST_DURATION1,
			TEST_DURATION2,
			TEST_DURATION3
  FROM PIPE_CHECKCONSIGN_LAB_RESULT
 WHERE CHECK_NO = {0}
		]]>
	</query>
	
	<query id="JhyCpPhyToQcmPhyTask.InsertLabInfo" desc="新增">
        <![CDATA[
	INSERT INTO QCM_CHECKCONSIGN_LAB_RESULT
  		(	CHECK_NO,
			SAMPLE_NO,
			PHY_CODE_MAX,
			STANDARD,
			TEST_DATE,
			REPORTED_DATE,
			REPORTED_NAME,
			APPROVED_NAME,
			SAMPLE_NO1,
			SAMPLE_NO2,
			SAMPLE_NO3,
			SPECIMEN_SIZE1,
			SPECIMEN_SIZE2,
			SPECIMEN_SIZE3,
			NACE_PH_S1,
			NACE_PH_F1,
			NACE_PH_S2,
			NACE_PH_F2,
			NACE_PH_S3,
			NACE_PH_F3,
			NACE_SOLUTION_S1,
			NACE_SOLUTION_F1,
			NACE_SOLUTION_S2,
			NACE_SOLUTION_F2,
			NACE_SOLUTION_S3,
			NACE_SOLUTION_F3,
			PSEUDO_STRESS,
			SECTION_NO11,
			SECTION_NO12,
			SECTION_NO21,
			SECTION_NO22,
			TEST_TIME,
			TEST_TEMP1,
			TEST_TEMP2,
			TEST_TEMP3,
			NOTE,
			NACE_PH_NAME,
			YSMIN_NAME,
			YSMIN1,
			YSMIN2,
			YSMIN3,
			ACTUAL_S_YSMIN1,
			ACTUAL_S_YSMIN2,
			ACTUAL_S_YSMIN3,
			ACTUAL_LOAD1,
			ACTUAL_LOAD2,
			ACTUAL_LOAD3,
			CRACK_LENGTH1,
			CRACK_LENGTH2,
			CRACK_LENGTH3,
			PRESET_LOAD1,
			PRESET_LOAD2,
			PRESET_LOAD3,
			NACE_H2S_NAME,
			TEST_SOLUTION,
			SURFACE_AREA1,
			SURFACE_AREA2,
			SURFACE_AREA3,
			WEIGHT_BEFORE_TEST1,
			WEIGHT_BEFORE_TEST2,
			WEIGHT_BEFORE_TEST3,
			WEIGHT_AFTER_TEST1,
			WEIGHT_AFTER_TEST2,
			WEIGHT_AFTER_TEST3,
			LOSS_OF_WEIGHT1,
			LOSS_OF_WEIGHT2,
			LOSS_OF_WEIGHT3,
			MASS_LOSS1,
			MASS_LOSS2,
			MASS_LOSS3,
			PITTING_DENSITY1,
			PITTING_DENSITY2,
			PITTING_DENSITY3,
			PITTING_COUNT1,
			PITTING_COUNT2,
			PITTING_COUNT3,
			NACE_PH,
			CLEANING_SAMPLE,
			COLLECTION_RATE,
			SPRAY_TYPE,
			ANGLE,
			SAMPLE_TYPE,
			CONCENTRATION,
			TEST_ITEM,
			CONNECTION,
			PROOF_RING_NO1,
			PROOF_RING_NO2,
			PROOF_RING_NO3,
			PRESSURE_MEDIUM,
			WEIGHT,
			TEST_RESULT,
			LOAD_LEVEL,
			LOAD_LEVEL2,
			LOAD_LEVEL3,
			YING_ACTUAL_LOAD1,
			YING_ACTUAL_LOAD2,
			YING_ACTUAL_LOAD3,
			REPORT_NO,
			YING_ADD1,
			YING_ADD2,
			YING_ADD3,
			TEST_RESULT2,
			TEST_SPECIMENS1,
			TEST_SPECIMENS2,
			TEST_GAS,
			SAMPLING_ORIENTATION,
			DMTS,
			SAMPLING_LOCATION,
			ZBS_ID,
			TEST_DURATION1,
			TEST_DURATION2,
			TEST_DURATION3)
	VALUES
  			('#CHECK_NO#',
			'#SAMPLE_NO#',
			'#PHY_CODE_MAX#',
			'#STANDARD#',
			TO_DATE('#TEST_DATE#','yyyy-MM-dd HH24:mi:ss'),
			TO_DATE('#REPORTED_DATE#','yyyy-MM-dd HH24:mi:ss'),
			'#REPORTED_NAME#',
			'#APPROVED_NAME#',
			'#SAMPLE_NO1#',
			'#SAMPLE_NO2#',
			'#SAMPLE_NO3#',
			'#SPECIMEN_SIZE1#',
			'#SPECIMEN_SIZE2#',
			'#SPECIMEN_SIZE3#',
			'#NACE_PH_S1#',
			'#NACE_PH_F1#',
			'#NACE_PH_S2#',
			'#NACE_PH_F2#',
			'#NACE_PH_S3#',
			'#NACE_PH_F3#',
			'#NACE_SOLUTION_S1#',
			'#NACE_SOLUTION_F1#',
			'#NACE_SOLUTION_S2#',
			'#NACE_SOLUTION_F2#',
			'#NACE_SOLUTION_S3#',
			'#NACE_SOLUTION_F3#',
			'#PSEUDO_STRESS#',
			'#SECTION_NO11#',
			'#SECTION_NO12#',
			'#SECTION_NO21#',
			'#SECTION_NO22#',
			'#TEST_TIME#',
			'#TEST_TEMP1#',
			'#TEST_TEMP2#',
			'#TEST_TEMP3#',
			'#NOTE#',
			'#NACE_PH_NAME#',
			'#YSMIN_NAME#',
			'#YSMIN1#',
			'#YSMIN2#',
			'#YSMIN3#',
			'#ACTUAL_S_YSMIN1#',
			'#ACTUAL_S_YSMIN2#',
			'#ACTUAL_S_YSMIN3#',
			'#ACTUAL_LOAD1#',
			'#ACTUAL_LOAD2#',
			'#ACTUAL_LOAD3#',
			'#CRACK_LENGTH1#',
			'#CRACK_LENGTH2#',
			'#CRACK_LENGTH3#',
			'#PRESET_LOAD1#',
			'#PRESET_LOAD2#',
			'#PRESET_LOAD3#',
			'#NACE_H2S_NAME#',
			'#TEST_SOLUTION#',
			'#SURFACE_AREA1#',
			'#SURFACE_AREA2#',
			'#SURFACE_AREA3#',
			'#WEIGHT_BEFORE_TEST1#',
			'#WEIGHT_BEFORE_TEST2#',
			'#WEIGHT_BEFORE_TEST3#',
			'#WEIGHT_AFTER_TEST1#',
			'#WEIGHT_AFTER_TEST2#',
			'#WEIGHT_AFTER_TEST3#',
			'#LOSS_OF_WEIGHT1#',
			'#LOSS_OF_WEIGHT2#',
			'#LOSS_OF_WEIGHT3#',
			'#MASS_LOSS1#',
			'#MASS_LOSS2#',
			'#MASS_LOSS3#',
			'#PITTING_DENSITY1#',
			'#PITTING_DENSITY2#',
			'#PITTING_DENSITY3#',
			'#PITTING_COUNT1#',
			'#PITTING_COUNT2#',
			'#PITTING_COUNT3#',
			'#NACE_PH#',
			'#CLEANING_SAMPLE#',
			'#COLLECTION_RATE#',
			'#SPRAY_TYPE#',
			'#ANGLE#',
			'#SAMPLE_TYPE#',
			'#CONCENTRATION#',
			'#TEST_ITEM#',
			'#CONNECTION#',
			'#PROOF_RING_NO1#',
			'#PROOF_RING_NO2#',
			'#PROOF_RING_NO3#',
			'#PRESSURE_MEDIUM#',
			'#WEIGHT#',
			'#TEST_RESULT#',
			'#LOAD_LEVEL#',
			'#LOAD_LEVEL2#',
			'#LOAD_LEVEL3#',
			'#YING_ACTUAL_LOAD1#',
			'#YING_ACTUAL_LOAD2#',
			'#YING_ACTUAL_LOAD3#',
			'#REPORT_NO#',
			'#YING_ADD1#',
			'#YING_ADD2#',
			'#YING_ADD3#',
			'#TEST_RESULT2#',
			'#TEST_SPECIMENS1#',
			'#TEST_SPECIMENS2#',
			'#TEST_GAS#',
			'#SAMPLING_ORIENTATION#',
			'#DMTS#',
			'#SAMPLING_LOCATION#',
			'#ZBS_ID#',
			'#TEST_DURATION1#',
			'#TEST_DURATION2#',
			'#TEST_DURATION3#')
        ]]>
    </query>
    
    <query id="JhyCpPhyToQcmPhyTask.getUpdateFlag" desc="修改成品理化标志位">
		<![CDATA[
UPDATE PIPE_CHECKCONSIGN_DETAIL T
  SET T.FLAG = DECODE(T.FLAG, '4', {2}, T.FLAG)
WHERE T.CHECK_NO = {0}
  AND INSTR({1}, T.PHY_CODE_MAX) > 0
		]]>
	</query>

	<query id="JhyCpPhyToQcmPhyTask.getSampleByCheckNo" desc="通过检验编号查询">
		<![CDATA[
SELECT T.phydetail_id,
       T.check_no,
       A.batch_no,
       T.sample_no,
       T.index_seq,
       T.dept_id,
       T.phy_code_max,
       T.phy_name_max,
       T.phy_code_min,
       T.phy_name_min,
       T.phy_code,
       T.phy_name,
       T.phy_unit,
       T.item_code_f,
       T.item_name_f,
       T.item_code_w,
       T.item_name_w,
       T.item_code_s,
       T.item_name_s,
       T.group_seq,
       T.result_count,
       T.ischeck,
       T.isjudge,
       T.isquote,
       T.phy_type,
       T.phy_formula,
       T.stdmin_sign,
       T.stdmin,
       T.stdmax_sign,
       T.stdmax,
       T.judge_basis,
       T.stdmin_sign2,
       T.stdmin2,
       T.stdmax_sign2,
       T.stdmax2,
       T.std_choose,
       T.stdmemo,
       T.addcondition,
       T.addstdcon_code,
       T.addstd_min_sign,
       T.addstd_min,
       T.addstd_max_sign,
       T.addstd_max,
       T.addpercent,
       T.billet_sample,
       T.remark,
       T.value1,
       T.value2,
       T.value3,
       T.value4,
       T.value5,
       T.value6,
       T.value7,
       T.value8,
       T.value9,
       T.value10,
       T.value11,
       T.value12,
       T.value13,
       T.value14,
       T.value15,
       T.average_value,
       A.FORMUAL_NAME,
       A.RATE,
       A.FOR_CHECK_NO,
       T.IS_GOOD,
       T.IS_DEFECT,
       A.ISRCL,
       A.MAT_NO,
       A.HEAD_MAT_NO,
       A.BAR_CODE,
       A.CHECK_TEMP,
       A.HARDNESS_TYPE,
       T.PHY_CODE_DIR,
       T.PHY_NAME_DIR,
       A.SAMPLE_STYLE,
       A.SAMPLE_TYPE,
       T.VALUE_KSI,
       T.VALUE_PSI,
       T.VALUE_F2,
       T.VALUE_F3,
       T.AVERAGE_VALUE_F,
       A.FORMUAL_NO,
       A.FORMUAL_NAME,
       t.SAMPLE_JB,
	   t.NOTCH_SHAPE

  FROM PIPE_CHECKCONSIGN_PHYDETAIL T, PIPE_CHECKCONSIGN_DETAIL A
 WHERE T.CHECK_NO = {0}
   AND INSTR({1}, T.PHY_CODE_MAX) > 0
   AND A.CHECK_NO = T.CHECK_NO
   AND A.SAMPLE_NO = T.SAMPLE_NO
   AND A.PHY_CODE_MAX = T.PHY_CODE_MAX
   AND A.FLAG = '4'
   AND A.VALIDFLAG = '0'
 ORDER BY T.PHY_CODE_MAX,
          T.PHY_CODE,
          T.ITEM_CODE_F,
          T.ITEM_CODE_W,
          T.ITEM_CODE_S
		]]>
	</query>
	
	<query id="JhyCpPhyToQcmPhyTask.getunqualifiedSampleNo" desc="获取没有通过的试样号">
		<![CDATA[
SELECT A.SAMPLE_ID, A.SAMPLE_NO
  FROM QCM_BC_PHYJUDGE A
 WHERE A.SAMPLE_ID = {0}
   AND A.PHY_JUDGE_ID =
       (SELECT MAX(B.PHY_JUDGE_ID)
          FROM QCM_BC_PHYJUDGE B
         WHERE B.SAMPLE_ID = A.SAMPLE_ID)
   AND A.JUDGERESULT_PHY IN ('40740202', '40740204')
 GROUP BY A.SAMPLE_ID, A.SAMPLE_NO
		]]>
	</query>
	
	<query id="JhyCpPhyToQcmPhyTask.getPhyJudgeResult" desc="获取理化判定结果">
		<![CDATA[
SELECT B.PHY_CODE_MIN,
       B.PHY_CODE,
       B.ITEM_CODE_F,
       B.ITEM_CODE_W,
       B.ITEM_CODE_S,
       B.UNQUALIFIED_TYPE
  FROM QCM_BC_PHYJUDGE A, QCM_BC_PHYRESULT B
 WHERE A.SAMPLE_ID = {0}
   AND A.SAMPLE_NO = {1}
   AND A.PHY_JUDGE_ID = (SELECT MAX(C.PHY_JUDGE_ID)
                           FROM QCM_BC_PHYJUDGE C
                          WHERE C.SAMPLE_ID = A.SAMPLE_ID
                            AND C.SAMPLE_NO = A.SAMPLE_NO)
   AND B.PHY_RESULT_ID = A.PHY_JUDGE_ID
   AND B.PHY_RESULT_SEQ = A.JUDGE_SEQ
   AND (B.NK_QUALIFIED = '0' OR B.JF_QUALIFIED = '0')
		]]>
	</query>
	
	<query id="JhyCpPhyToQcmPhyTask.getASample" desc="获取没做复样的项目">
		<![CDATA[
SELECT B.PHY_CODE_MIN,
       B.PHY_CODE,
       B.ITEM_CODE_F,
       B.ITEM_CODE_W,
       B.ITEM_CODE_S,
       B.UNQUALIFIED_TYPE
  FROM QCM_BC_PHYJUDGE A, QCM_BC_PHYRESULT B
 WHERE A.SAMPLE_ID = {0}
   AND A.SAMPLE_NO = {1}
   AND A.PHY_JUDGE_ID = (SELECT MAX(C.PHY_JUDGE_ID)
                           FROM QCM_BC_PHYJUDGE C
                          WHERE C.SAMPLE_ID = A.SAMPLE_ID
                            AND C.SAMPLE_NO = A.SAMPLE_NO)
   AND B.PHY_RESULT_ID = A.PHY_JUDGE_ID
   AND B.PHY_RESULT_SEQ = A.JUDGE_SEQ
   AND (B.NK_QUALIFIED = '0' OR B.JF_QUALIFIED = '0')
		]]>
	</query>
	
	<query id="JhyCpPhyToQcmPhyTask.setJhyPhyValidflag" desc="修改检化验有效标志">
		<![CDATA[
   UPDATE QCM_JHY_PHYRESULT T SET T.VALIDFLAG = '0' WHERE T.SAMPLE_ID = {0}
		]]>
	</query>

	<query id="JhyCpPhyToQcmPhyTask.getPhyCommon" desc="获取理化是否共样">
		<![CDATA[
SELECT *
  FROM CRAFT_ORD_DESIGN_STD_PIC_SMP A, CRAFT_ORD_DESIGN B, PLN_SALEORD C
 WHERE C.ORD_LN_DLY_PK = {0}
   AND B.ORD_LN_PK = C.ORD_LN_PK
   AND B.CRAFT_SEQ = {1}
   AND A.DESGIN_KEY = B.DESGIN_KEY
   AND A.COMMON = '1'
   AND ROWNUM <= 1
		]]>
	</query>


    <query id="JhyCpPhyToQcmPhyTask.getPhyCommonByPhy" desc="获取理化是否共样">
        <![CDATA[
SELECT A.*
  FROM CRAFT_ORD_DESIGN_STD_PIC_SMP A, CRAFT_ORD_DESIGN B, PLN_SALEORD C
 WHERE C.ORD_LN_DLY_PK = {0}
   AND B.ORD_LN_PK = C.ORD_LN_PK
   AND B.CRAFT_SEQ = {1}
   AND A.DESGIN_KEY = B.DESGIN_KEY
   AND A.COMMON = '1'
   AND A.CRAFT_SOURCE = '2'
   AND A.PHY_CODE_MIN = {2}
		]]>
    </query>

    <query id="JhyCpPhyToQcmPhyTask.getCraftPhyByPhy" desc="获取理化是否共样">
        <![CDATA[
 SELECT A.*
   FROM CRAFT_ORD_DESIGN_STD_PIC_SMP A, CRAFT_ORD_DESIGN B, PLN_SALEORD C
  WHERE C.ORD_LN_DLY_PK = {0}
    AND B.ORD_LN_PK = C.ORD_LN_PK
    AND B.CRAFT_SEQ = {1}
    AND A.DESGIN_KEY = B.DESGIN_KEY
    AND A.MSC_PLINE = {2}
    AND A.PROCESS_CODE = {3}
    AND A.PIC = {4}
    AND A.PHY_CODE_MIN = {5}
		]]>
    </query>
</queryMap>