<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
    <query id="JdgMatZcM.setZbsId" desc="修改质保书ID">
        <![CDATA[
UPDATE MAT_ZC_M T
   SET T.ZBS_ID = {3}
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.ORD_LN_DLY_PK = {2}
        ]]>
    </query>
    
    <query id="JdgMatZcM.setZbsIdByRownum" desc="修改质保书ID">
        <![CDATA[
UPDATE MAT_ZC_M T
   SET T.ZBS_ID = {6}, T.JG_ZBS_ID = {7}
 WHERE T.MAT_NO IN (SELECT MAT_NO
                      FROM (SELECT A.MAT_NO, ROWNUM RN
                              FROM (SELECT *
                                      FROM MAT_ZC_M A
                                     WHERE A.JUDGE_STOVE_NO = {0}
                                       AND A.BATCH_NO = {1}
                                       AND A.BATCH_GROUD_NO = {2}
                                       AND A.ORD_LN_DLY_PK = {3}) A
                             WHERE ROWNUM <= {5})
                     WHERE RN >= {4})
        ]]>
    </query>
    
    <query id="JdgMatZcM.setZbsFlag" desc="修改质保书FLAG">
        <![CDATA[
UPDATE MAT_ZC_M T
   SET T.ZBS_FLAG = {4}
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.BATCH_GROUD_NO = {2}
   AND T.ORD_LN_DLY_PK = {3}
        ]]>
    </query>
    
   <query id="JdgMatZcM.setZbsFlagNoPk" desc="修改质保书FLAG">
        <![CDATA[
UPDATE MAT_ZC_M T
   SET T.ZBS_FLAG = {4}
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.BATCH_GROUD_NO = {2}
        ]]>
    </query>
    
    <query id="JdgMatZcM.setJudgeResult" desc="修改判定结果">
        <![CDATA[
UPDATE MAT_ZC_M T
   SET T.JUDGE_RESULT_CODE = {4},
   T.JUDGE_RESULT     =
       (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = {4})
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.BATCH_GROUD_NO = {2}
   AND (T.ORD_LN_DLY_PK = {3} OR (t.PRO_ORDER_NO like 'TH%' AND T.PRO_ORDER_NO = {5}))
   AND T.JUDGE_RESULT_CODE != '40740701'
        ]]>
    </query>
    
    <query id="JdgMatZcM.setLkLock" desc="修改利库封锁标志">
        <![CDATA[
UPDATE MAT_ZC_M T
   SET T.LOCK_LIKU = {4},
       T.LOCK_FLAG = {5}
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.BATCH_GROUD_NO = {2}
   AND T.ORD_LN_DLY_PK = {3}
        ]]>
    </query>
    
     <query id="JdgMatZcM.getMatStatus80150301" desc="获取材料状态">
        <![CDATA[
SELECT 1 FROM MAT_ZC_M T
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.BATCH_GROUD_NO = {2}
   AND T.ORD_LN_DLY_PK = {3}
   AND T.MAT_STATUS <> '80150301'
        ]]>
    </query>
    
    <query id="JdgMatZcM.getCountWeightByBatchNo" desc="通过炉批查询">
        <![CDATA[
SELECT SUM(T.ACT_COUNT) ACT_COUNT, SUM(T.ACT_WEIGHT) ACT_WEIGHT, 
SUM(T.ACT_THEORY_WEIGHT) ACT_THEORY_WEIGHT
  FROM MAT_ZC_M T
 WHERE T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.BATCH_GROUD_NO = {2}
   AND T.ORD_LN_DLY_PK = {3}
        ]]>
    </query>
</queryMap>