<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="同步检化验成品成分到质量成分">
	<query id="jhy.getTestData" desc="修改成品成分标志位">
		<![CDATA[
SELECT T.ID,
       T.STEEL_NO,
       T.SELECT_STEEL_NO,
       T.SAMPLE_NO,
       T.ITEM_CODE,
       T.ITEM_NAME
  FROM BASE_CHEM_STDSTEEL_SELECT_BAK T
 WHERE (DECODE('#SAMPLE_NO#', NULL, '1', T.SAMPLE_NO) =
       DECODE('#SAMPLE_NO#', NULL, '1', '#SAMPLE_NO#') AND
       DECODE('#SAMPLE_NO#', NULL, T.SAMPLE_NO, NULL) IS NULL)
   AND (DECODE('#STEEL_NO#', NULL, '1', T.STEEL_NO) =
       DECODE('#STEEL_NO#', NULL, '1', '#STEEL_NO#') AND
       DECODE('#STEEL_NO#', NULL, T.STEEL_NO, NULL) IS NULL)
   AND (DECODE('#SELECT_STEEL_NO#', NULL, '1', T.SELECT_STEEL_NO) =
       DECODE('#SELECT_STEEL_NO#', NULL, '1', '#SELECT_STEEL_NO#') AND
       DECODE('#SELECT_STEEL_NO#', NULL, T.SELECT_STEEL_NO, NULL) IS NULL)
		]]>
	</query>
	<query id="jhy.getTestData2" desc="修改成品成分标志位">
		<![CDATA[
SELECT T.SAMPLE_NO, T.STEEL_NO, T.SELECT_STEEL_NO
   FROM BASE_CHEM_STDSTEEL_SELECT_BAK T
  WHERE T.FLAG = '0'
  GROUP BY T.SAMPLE_NO, T.STEEL_NO, T.SELECT_STEEL_NO
		]]>
	</query>
	<query id="jhy.insert" desc="修改成品成分标志位">
		<![CDATA[
 INSERT INTO BASE_CHEM_STDSTEEL_SELECT(
        STEEL_NO,
        SELECT_STEEL_NO,
        SAMPLE_NO,
        SELECT_NAME,
        SELECT_TIME,
        SELECT_SHIFT,
        SELECT_CLASS,
        ANA_C,
        ANA_SI,
        ANA_MN,
        ANA_P,
        ANA_S,
        ANA_NI,
        ANA_CR,
        ANA_MO,
        ANA_CU,
        ANA_AL,
        ANA_ALS,
        ANA_CA,
        ANA_V,
        ANA_NB,
        ANA_TI,
        ANA_O,
        ANA_N,
        ANA_H,
        ANA_ZN,
        ANA_B,
        ANA_ZR,
        ANA_W,
        ANA_CO,
        ANA_FE,
        ANA_PB,
        ANA_SN,
        ANA_AS,
        ANA_SB,
        ANA_BI,
        ANA_LA,
        ANA_CE,
        ANA_SE,
        ANA_MG,
        ANA_CD,
        ANA_ALT,
        ANA_ALINS,
        ANA_BS,
        ANA_BN,
        ANA_MGO,
        ANA_SIO2,
        ANA_AL2O3,
        ANA_TFEO,
        ANA_FE2O3,
        ANA_H2O,
        ANA_CAF2,
        ANA_P2O5,
        ANA_TFE,
        ANA_CR2O3,
        ANA_TIO2,
        ANA_MNO,
        ANA_V2O5,
        ANA_FEO,
        ANA_CAO,
        REMARK)
 VALUES(
        '#STEEL_NO#',
        '#SELECT_STEEL_NO#',
        '#SAMPLE_NO#',
        '#SELECT_NAME#',
        SYSDATE,
        '#SELECT_SHIFT#',
        '#SELECT_CLASS#',
        '#ANA_C#',
        '#ANA_SI#',
        '#ANA_MN#',
        '#ANA_P#',
        '#ANA_S#',
        '#ANA_NI#',
        '#ANA_CR#',
        '#ANA_MO#',
        '#ANA_CU#',
        '#ANA_AL#',
        '#ANA_ALS#',
        '#ANA_CA#',
        '#ANA_V#',
        '#ANA_NB#',
        '#ANA_TI#',
        '#ANA_O#',
        '#ANA_N#',
        '#ANA_H#',
        '#ANA_ZN#',
        '#ANA_B#',
        '#ANA_ZR#',
        '#ANA_W#',
        '#ANA_CO#',
        '#ANA_FE#',
        '#ANA_PB#',
        '#ANA_SN#',
        '#ANA_AS#',
        '#ANA_SB#',
        '#ANA_BI#',
        '#ANA_LA#',
        '#ANA_CE#',
        '#ANA_SE#',
        '#ANA_MG#',
        '#ANA_CD#',
        '#ANA_ALT#',
        '#ANA_ALINS#',
        '#ANA_BS#',
        '#ANA_BN#',
        '#ANA_MGO#',
        '#ANA_SIO2#',
        '#ANA_AL2O3#',
        '#ANA_TFEO#',
        '#ANA_FE2O3#',
        '#ANA_H2O#',
        '#ANA_CAF2#',
        '#ANA_P2O5#',
        '#ANA_TFE#',
        '#ANA_CR2O3#',
        '#ANA_TIO2#',
        '#ANA_MNO#',
        '#ANA_V2O5#',
        '#ANA_FEO#',
        '#ANA_CAO#',
        '#REMARK#')
		]]>
	</query>
	<query id="jhy.updateFlag" desc="修改成品成分标志位">
		<![CDATA[
UPDATE BASE_CHEM_STDSTEEL_SELECT_BAK T
   SET T.FLAG = '1'
 WHERE (DECODE('#SAMPLE_NO#', NULL, '1', T.SAMPLE_NO) =
       DECODE('#SAMPLE_NO#', NULL, '1', '#SAMPLE_NO#') AND
       DECODE('#SAMPLE_NO#', NULL, T.SAMPLE_NO, NULL) IS NULL)
   AND (DECODE('#STEEL_NO#', NULL, '1', T.STEEL_NO) =
       DECODE('#STEEL_NO#', NULL, '1', '#STEEL_NO#') AND
       DECODE('#STEEL_NO#', NULL, T.STEEL_NO, NULL) IS NULL)
   AND (DECODE('#SELECT_STEEL_NO#', NULL, '1', T.SELECT_STEEL_NO) =
       DECODE('#SELECT_STEEL_NO#', NULL, '1', '#SELECT_STEEL_NO#') AND
       DECODE('#SELECT_STEEL_NO#', NULL, T.SELECT_STEEL_NO, NULL) IS NULL)
		]]>
	</query>
</queryMap>
