<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="基础信息">
    <query id="JdgCouplingMatM.setJudgeInfo" desc="修改半成品判定信息">
        <![CDATA[
UPDATE COUPLING_MAT_M T
   SET T.judge_result         = (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = '#JUDGE_RESULT_CODE#'),
       T.JUDGE_RESULT_CODE    = '#JUDGE_RESULT_CODE#',
       T.JUDGE_RESULT_TIME    = TO_DATE(DECODE('#JUDGE_RESULT_CODE#', NULL, NULL, TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS')), 'YYYY-MM-DD HH24:MI:SS'),
       T.JUDGE_MAKER          = '#JUDGE_MAKER#',
       T.JUGDE_CONVICTED      = '#JUGDE_CONVICTED#'
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND T.BATCH_NO = '#BATCH_NO#'
   AND T.DETER_NO = '#DETER_NO#'
   AND T.WO_ID = '#WO_ID#'
		]]>
    </query>

    <query id="JdgCouplingMatM.setTolJudgeInfo" desc="修改成品判定信息">
        <![CDATA[
UPDATE COUPLING_MAT_M T
   SET T.JUDGE_TOLRESULT_CODE = '#JUDGE_TOLRESULT_CODE#',
       T.JUDGE_TOLRESULT      = (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = '#JUDGE_TOLRESULT_CODE#'),
       T.JUDGE_TOLRESULT_TIME = TO_DATE(DECODE('#JUDGE_TOLRESULT_CODE#', NULL, NULL, TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS')), 'YYYY-MM-DD HH24:MI:SS'),
       T.judge_tolmaker       = '#JUDGE_TOLMAKER#',
       T.JUGDE_TOLCONVICTED   = '#JUGDE_TOLCONVICTED#'
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND T.BATCH_NO = '#BATCH_NO#'
   AND T.DETER_NO = '#DETER_NO#'
   AND T.WO_ID = '#WO_ID#'
		]]>
    </query>

    <query id="JdgCouplingMatM.setZbsId" desc="修改质保书信息">
        <![CDATA[
UPDATE COUPLING_MAT_M T
   SET T.ZBS_ID = '#ZBS_ID#', T.ZBS_FLAG = '#ZBS_FLAG#'
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND T.BATCH_NO = '#BATCH_NO#'
   AND T.DETER_NO = '#DETER_NO#'
   AND T.WO_ID = '#WO_ID#'
		]]>
    </query>

    <query id="JdgCouplingMatM.setBelong" desc="修改所属权">
        <![CDATA[
UPDATE COUPLING_MAT_M T
   SET T.BELONG_CODE          = '#BELONG_CODE#',
       T.BELONG_NAME          = '#BELONG_NAME#'
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND T.BATCH_NO = '#BATCH_NO#'
   AND T.DETER_NO = '#DETER_NO#'
   AND T.WO_ID = '#WO_ID#'
		]]>
    </query>
</queryMap>