<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
    <query id="JdgQcmZbsChemResult.insert" desc="新增">
        <![CDATA[
  INSERT INTO QCM_ZBS_CHEM_RESULT(
        ZBS_ID,
        ZBS_SEQ,
        SAMPLE_NO,
        PROCESS_CODE,
        CHEM_TYPE,
        CHEM_NAME,
        CHEM_VALUE,
        NK_MIN,
        NK_MAX,
        NK_QUALIFIED,
        JF_MIN,
        JF_MAX,
        JF_QUALIFIED,
        ROUND,
        SAMPLE_ID,
        JUDGE_STOVE_NO)
 VALUES( 
        '#ZBS_ID#',
        (SELECT NVL(MAX(A.ZBS_SEQ), 0) + 1
      FROM QCM_ZBS_CHEM_RESULT A
     WHERE A.ZBS_ID = '#ZBS_ID#'),
        '#SAMPLE_NO#',
        '#PROCESS_CODE#',
        '#CHEM_TYPE#',
        '#CHEM_NAME#',
        '#CHEM_VALUE#',
        '#NK_MIN#',
        '#NK_MAX#',
        '#NK_QUALIFIED#',
        '#JF_MIN#',
        '#JF_MAX#',
        '#JF_QUALIFIED#',
        '#ROUND#',
        '#SAMPLE_ID#',
        '#JUDGE_STOVE_NO#')
        ]]>
    </query>
    
    <query id="JdgQcmZbsChemResult.delete" desc="删除">
        <![CDATA[
 DELETE FROM QCM_ZBS_CHEM_RESULT WHERE ZBS_ID = {0}
        ]]>
    </query>
    
        <query id="JdgQcmZbsChemResult.deleteByJudgeStoveNo" desc="删除">
        <![CDATA[
 DELETE FROM QCM_ZBS_CHEM_RESULT WHERE JUDGE_STOVE_NO = {0}
        ]]>
    </query>
    
    <query id="JdgQcmZbsChemResult.getMaxChemZbsId" desc="获取最大质保书ID">
		<![CDATA[
SELECT MAX(T.ZBS_ID) ZBS_ID
  FROM QCM_ZBS_CHEM_RESULT T
 WHERE T.ZBS_ID LIKE 'GP'|| TO_CHAR(SYSDATE, 'YYYYMMDD') || '%'
		]]>
	</query>

    <query id="JdgQcmZbsChemResult.getByZbsId" desc="通过质保书ID查询">
        <![CDATA[
 SELECT * FROM QCM_ZBS_CHEM_RESULT WHERE ZBS_ID = {0}
        ]]>
    </query>
</queryMap>