<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="本地计量">




    <query  id="PoundMatServer.doSaveMat" desc="保存材料信息">
        <![CDATA[
        INSERT INTO CMM_WEIGHT_MAT(
        RECORD_NO,
        RECORD_SEQ,
        ORDER_NO,
        ORDER_SEQ,
        ORDER_SEQ_NO,
        PRO_ORDER_NO,
        LOT_NO,
        JUDGE_STOVE_NO,
        BATCH_NO,
        GROUP_NO,
        STOVE_NO,
        MATERIAL_NO,
        MATERIAL_NAME,
        PRODUCCODE,
        PRODUCNAME,
        STD_CODE,
        STD_NAME,
        GRADECODE,
        GRADENAME,
        STEELCODE,
        STEELNAME,
        STD_STYLE,
        STD_STYLE_DESC,
        SPEC_CODE,
        SPEC_NAME,
        MODEL_CODE,
        MODEL_DESC,
        PROCESS_CDOE,
        PROCESS_DESC,
        PLINE_CODE,
        PLINE_NAME,
        ACT_DIMATER,
        ACT_HEIGHT,
        ACT_LEN_TEMP,
        ACT_LEN_MIN,
        ACT_LEN_MAX,
        ACT_COUNT,
        ACT_WEIGHT,
        ACT_THEORY_WEIGHT,
        MEMO,
        RESULT_NO,
        STORAGE_NO,
        STORAGE_NAME,
        SPEC_NO,
        JUDGE_STOVE_NO_OLD
        )
 VALUES(
        '#RECORD_NO#',
        (SELECT NVL(MAX(RECORD_SEQ),0) + 1 FROM CMM_WEIGHT_MAT WHERE RECORD_NO =  '#RECORD_NO#'),
        '#ORDER_NO#',
        '#ORDER_SEQ#',
        '#ORDER_SEQ_NO#',
        '#PRO_ORDER_NO#',
        '#LOT_NO#',
        '#JUDGE_STOVE_NO#',
        '#BATCH_NO#',
        '#GROUP_NO#',
        '#STOVE_NO#',
        '#MATERIAL_NO#',
        '#MATERIAL_NAME#',
        '#PRODUCCODE#',
        '#PRODUCNAME#',
        '#STD_CODE#',
        '#STD_NAME#',
        '#GRADECODE#',
        '#GRADENAME#',
        '#STEELCODE#',
        '#STEELNAME#',
        '#STD_STYLE#',
        '#STD_STYLE_DESC#',
        '#SPEC_CODE#',
        '#SPEC_NAME#',
        '#MODEL_CODE#',
        '#MODEL_DESC#',
        '#PROCESS_CDOE#',
        '#PROCESS_DESC#',
        '#PLINE_CODE#',
        '#PLINE_NAME#',
        '#ACT_DIMATER#',
        '#ACT_HEIGHT#',
        '#ACT_LEN_TEMP#',
        '#ACT_LEN_MIN#',
        '#ACT_LEN_MAX#',
        '#ACT_COUNT#',
        '#ACT_WEIGHT#',
        '#ACT_THEORY_WEIGHT#',
        '#MEMO#',
        '#RESULT_NO#',
        '#STORAGE_NO#',
        '#STORAGE_NAME#',
        '#SPEC_NO#',
        '#JUDGE_STOVE_NO_OLD#'

        )
           ]]>
    </query>

    <query  id="PoundMatServer.doUpdateMatResultNo" desc="保存过磅记录">
        <![CDATA[
        UPDATE CMM_WEIGHT_MAT
        SET RESULT_NO = ?
        WHERE RECORD_NO = ?
           ]]>
    </query>


    <query  id="PoundMatServer.doQuery" desc="保存过磅记录">
        <![CDATA[
        SELECT * FROM CMM_WEIGHT_MAT WHERE 1= 1
           ]]>
    </query>



    <query  id="PoundMatServer.deleteMat" desc="保存过磅记录">
        <![CDATA[
        DELETE FROM CMM_WEIGHT_MAT WHERE RECORD_NO =?
           ]]>
    </query>

    <query  id="PoundMatServer.getGroupByResultNo" desc="保存过磅记录">
        <![CDATA[
       SELECT  T.JUDGE_STOVE_NO, SUM(T.ACT_WEIGHT) ACT_WEIGHT, SUM(T.ACT_COUNT) ACT_COUNT
  FROM CMM_WEIGHT_MAT T
 WHERE T.RESULT_NO = ?
 GROUP BY T.JUDGE_STOVE_NO

           ]]>
    </query>


</queryMap>