<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="同步检化验炼钢成分到质量成分">
	<query id="JhyLgChemToQcmChemTask.getSteelChemAuditResult" desc="查询标准号与适用规格关联数据">
		<![CDATA[
SELECT *
  FROM (SELECT T.ID,
               T.ASSAYNO,
               T.ASSAYTYPE,
               T.HEAT_NO,
               T.SAMPLE_NO,
               T.STEEL_NO,
               T.SAMPLE_SOURCE,
               T.DEPT_ID,
               T.DEPT_NAME,
               T.CHECK_NAME,
               TO_CHAR(T.CHECK_TIME, 'YYYY-MM-DD HH24:MI:SS') CHECK_TIME,
               T.CHECK_SHIFT,
               T.CHECK_CLASS,
               T.CHECK_TEMP,
               T.DEVICE_NO,
               T.DEVICE_NAME,
               T.ONH_CHECK_NAME,
               TO_CHAR(T.ONH_CHECK_TIME, 'YYYY-MM-DD HH24:MI:SS') ONH_CHECK_TIME,
               T.ONH_CHECK_SHIFT,
               T.ONH_CHECK_CLASS,
               T.ONH_CHECK_TEMP,
               T.ONH_DEVICE_NO,
               T.ONH_DEVICE_NAME,
               T.ANA_C,
               T.ANA_SI,
               T.ANA_MN,
               T.ANA_P,
               T.ANA_S,
               T.ANA_NI,
               T.ANA_CR,
               T.ANA_MO,
               T.ANA_CU,
               T.ANA_AL,
               T.ANA_V,
               T.ANA_NB,
               T.ANA_TI,
               T.ANA_B,
               T.ANA_PB,
               T.ANA_SN,
               T.ANA_AS,
               T.ANA_SB,
               T.ANA_BI,
               T.ANA_O,
               T.ANA_N,
               T.ANA_H,
               T.ANA_CA,
               T.ANA_W,
               T.ANA_ZR,
               T.ANA_ZN,
               T.ANA_CO,
               T.ANA_ALS,
               T.ANA_LA,
               T.ANA_CE,
               T.ANA_SE,
               T.ANA_MG,
               T.ANA_CD,
               T.ANA_FE,
               T.ANA_ALT,
               T.ANA_ALINS,
               T.ANA_BS,
               T.ANA_BN,
               T.ANA_MGO,
               T.ANA_SIO2,
               T.ANA_AL2O3,
               T.ANA_TFEO,
               T.ANA_FE2O3,
               T.ANA_H2O,
               T.ANA_CAF2,
               T.ANA_P2O5,
               T.ANA_TFE,
               T.ANA_CR2O3,
               T.ANA_TIO2,
               T.ANA_MNO,
               T.ANA_V2O5,
               T.ANA_FEO,
               T.ANA_CAO,
               T.ANA_TA,
               TO_CHAR(T.RECEIVE_TIME, 'YYYY-MM-DD HH24:MI:SS') RECEIVE_TIME,
               T.AUDIT_NAME,
               TO_CHAR(T.AUDIT_TIME, 'YYYY-MM-DD HH24:MI:SS') AUDIT_TIME,
               T.DATA_TYPE,
               T.ONH_FLAG,
               T.DB_FLAG,
               T.CX_FLAG,
               T.REMARK,
               T.IS_RECHECK
          FROM STEER_CHEM_AUDIT_RESULT T
         WHERE T.CX_FLAG = '0'
           AND T.CHECK_TIME IS NOT NULL
         ORDER BY CHECK_TIME)
 WHERE ROWNUM <= 50
		]]>
	</query>
	<query id="JhyLgChemToQcmChemTask.insertQcmJhyElements" desc="新增质量成分化验实绩表">
		<![CDATA[
INSERT INTO QCM_JHY_ELEMENTS
  (ASSAYNO,
   STOVE_NO,
   JUDGE_STOVE_NO,
   BATCH_NO,
   ASSAYTYPE,
   FLAG,
   C,
   SI,
   MN,
   P,
   S,
   NI,
   CR,
   CU,
   ASN,
   TI,
   V,
   MO,
   B,
   W,
   AL,
   ZN,
   PB,
   SN,
   CA,
   LA,
   SB,
   CE,
   SE,
   MG,
   NB,
   CD,
   BI,
   N,
   H,
   O,
   FE,
   ALT,
   ALS,
   ALINS,
   BS,
   BN,
   MGO,
   SIO2,
   AL2O3,
   TFEO,
   FE2O3,
   H2O,
   CAF2,
   P2O5,
   TFE,
   CR2O3,
   TIO2,
   MNO,
   V2O5,
   FEO,
   CAO,
   ZR,
   CO,
   TA,
   SAMPLE_ID,
   XH,
   MACHINE,
   CREATE_NAME,
   CREATE_TIME,
   MEMO,
   SAMPLE_NO,
   PLINE_CODE,
   SAMPLE_TYPE,
   MAT_NO,
   HEAD_MAT_NO,
   BAR_CODE)
VALUES
  ('#ASSAYNO#',
   '#STOVE_NO#',
   '#JUDGE_STOVE_NO#',
   '#BATCH_NO#',
   '#ASSAYTYPE#',
   '#FLAG#',
   '#C#',
   '#SI#',
   '#MN#',
   '#P#',
   '#S#',
   '#NI#',
   '#CR#',
   '#CU#',
   '#ASN#',
   '#TI#',
   '#V#',
   '#MO#',
   '#B#',
   '#W#',
   '#AL#',
   '#ZN#',
   '#PB#',
   '#SN#',
   '#CA#',
   '#LA#',
   '#SB#',
   '#CE#',
   '#SE#',
   '#MG#',
   '#NB#',
   '#CD#',
   '#BI#',
   '#N#',
   '#H#',
   '#O#',
   '#FE#',
   '#ALT#',
   '#ALS#',
   '#ALINS#',
   '#BS#',
   '#BN#',
   '#MGO#',
   '#SIO2#',
   '#AL2O3#',
   '#TFEO#',
   '#FE2O3#',
   '#H2O#',
   '#CAF2#',
   '#P2O5#',
   '#TFE#',
   '#CR2O3#',
   '#TIO2#',
   '#MNO#',
   '#V2O5#',
   '#FEO#',
   '#CAO#',
   '#ZR#',
   '#CO#',
   '#TA#',
   '#SAMPLE_ID#',
   '#XH#',
   '#MACHINE#',
   '#CREATE_NAME#',
   SYSDATE,
   '#MEMO#',
   '#SAMPLE_NO#',
   '#PLINE_CODE#',
   '#SAMPLE_TYPE#',
   '#MAT_NO#',
   '#HEAD_MAT_NO#',
   '#BAR_CODE#')
		]]>
	</query>
	<query id="JhyLgChemToQcmChemTask.updateCxFlag" desc="修改检化验实绩表中的标志位">
		<![CDATA[
UPDATE STEER_CHEM_AUDIT_RESULT T SET T.CX_FLAG = '#CX_FLAG#' WHERE T.ID = '#ID#'
		]]>
	</query>
	<query id="JhyLgChemToQcmChemTask.clear" desc="清除质量成分表">
		<![CDATA[
DELETE FROM (SELECT * FROM QCM_JHY_ELEMENTS T WHERE T.ASSAYNO = '#ASSAYNO#')
		]]>
	</query>
</queryMap>
