<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="成分偏差标准">
	<query id="DeviationChemDao.getChemMain" desc="获取成分主表记录">
         <![CDATA[
 SELECT 
       T.CIC,
       T.PSC,
       T.MSC,
       T.STDSTYLE,
       T.STD_CODE_NK,
       T.STD_NAME_NK,
       T.PROCESS_CODE,
       T.PROCESS_DESC,
       T.GRADECODE,
       T.GRADENAME,
       T.STD_CODE,
       T.STD_NAME,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T.VALIDFLAG,
       T.MEMO,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.PRODUC_HEAD,
       T.CODE_JG,
       T.STEELCODE_NK,
       T.STEELNAME_NK,
       T.MODEL_CODE_NK,
       T.MODEL_DESC_NK,
       T.PRODUCCODE_NK,
       T.PRODUCNAME_NK,
       T.SMELTING_CNT,
       T.PRODUCT_CNT
 FROM COM_MSC_STD_CIC T
 WHERE
T.CIC = ?
         ]]>
	</query>

	<query id="DeviationChemDao.getChemBais" desc="获取成分偏差主记录">
         <![CDATA[
         SELECT T.CIC,
       T.STD_CODE,
       T.STD_NAME,
       T.ASSORTMENT_CODE,
       T.ASSORTMENT_NAME,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T.VALIDFLAG
  FROM COM_MSC_STD_CHEM_BIAS T
 WHERE T.STD_CODE = ?
   AND T.ASSORTMENT_CODE = ?
   AND T.VALIDFLAG != '0'        
         ]]>
	</query>

	<query id="DeviationChemDao.getChemSteel" desc="获取成分偏差主记录">
         <![CDATA[
         SELECT T.CIC,
       T.STD_CODE,
       T.STD_NAME,
       T.ASSORTMENT_CODE,
       T.ASSORTMENT_NAME,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T.VALIDFLAG
  FROM COM_MSC_STD_CHEM_BIAS T,COM_MSC_STD_CHEM_STEEL T1 
 WHERE 
    T.CIC=T1.CIC
  AND T.STD_CODE = ?
  AND T1.STEELCODE=?
  AND T1.VALIDFLAG!='0'
  AND T.VALIDFLAG !='0'
         ]]>
	</query>

	<query id="DeviationChemDao.getChemBiasC" desc="获取成分从表记录">
         <![CDATA[
          SELECT 
       T.CIC,
       T.INDEX_SEQ,
       T.CHEM_CODE,
       T.CHEM_NAME,
       T.WHOLE_BACKLOG,
       T.CHEM_FORMULA,
       T.MIN_SIGN,
       T.MIN_VAL,
       T.MAX_SIGN,
       T.MAX_VAL,
       T.STD_MIN_SIGN,
       T.STD_MIN_VAL,
       T.STD_MAX_SIGN,
       T.STD_MAX_VAL,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T.VALIDFLAG
 FROM com_msc_std_chem_bias_c T
 WHERE
T.CIC =?
         ]]>
	</query>

	<query id="DeviationChemDao.addChemBiasC" desc="新增成分从表记录">
         <![CDATA[
          INSERT INTO CRAFT_ORD_DESIGN_STD_BIAS_C(
        CIC,
        INDEX_SEQ,
        CHEM_CODE,
        CHEM_NAME,
        WHOLE_BACKLOG,
        CHEM_FORMULA,
        MIN_SIGN,
        MIN_VAL,
        MAX_SIGN,
        MAX_VAL,
        STD_MIN_SIGN,
        STD_MIN_VAL,
        STD_MAX_SIGN,
        STD_MAX_VAL,
        CREATE_NAME,
        CREATE_TIME,
        UPDATE_NAME,
        UPDATE_TIME,
        DELETE_NAME,
        DELETE_TIME,
        VALIDFLAG,
        DESGIN_KEY,
        SPECL_FL)
 VALUES( 
        '#CIC#',
        '#INDEX_SEQ#',
        '#CHEM_CODE#',
        '#CHEM_NAME#',
        '#WHOLE_BACKLOG#',
        '#CHEM_FORMULA#',
        '#MIN_SIGN#',
        '#MIN_VAL#',
        '#MAX_SIGN#',
        '#MAX_VAL#',
        '#STD_MIN_SIGN#',
        '#STD_MIN_VAL#',
        '#STD_MAX_SIGN#',
        '#STD_MAX_VAL#',
        '#CREATE_NAME#',
        SYSDATE,
        '#UPDATE_NAME#',
        NULL,
        '#DELETE_NAME#',
        NULL,
        '1',
        '#DESGIN_KEY#',
        '#SPECL_FL#')
         ]]>
	</query>


	<query id="DeviationChemDao.getGradeType" desc="获取钢种类型">
         <![CDATA[
select * from com_base_grade t where t.gradecode=?
         ]]>
	</query>
</queryMap>