<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
    <query id="JdgMchTwistinglyResult.getInfo" desc="获取拧接信息">
        <![CDATA[
SELECT A.TORQUES_MIN,
       A.TORQUES_OPT,
       A.TORQUES_MAX,
       A.PLINE_CODE,
       A.TURNING_TORQUES_MAX,
       A.TURNING_TORQUES_MIN,
       (SELECT WM_CONCAT(B.COUPLING_STOVE_NO || '+' || B.LOT_NO)
          FROM MCH_TWISTINGLY_RESULT_D B
         WHERE B.RESULT_NO = A.RESULT_NO) JG_JUDGE_BATCH_NO,
       '合格' TWISTINGLY_RESULT,
       A.RESULT_NO,A.REPORT_PATH
  FROM MCH_TWISTINGLY_RESULT A
 WHERE A.JUDGE_STOVE_NO = {0}
   AND A.BATCH_NO = {1}
        ]]>
    </query>


    <query id="JdgMchTwistinglyResult.getInfoByPline" desc="获取拧接信息">
        <![CDATA[
SELECT A.TORQUES_MIN,
       A.TORQUES_OPT,
       A.TORQUES_MAX,
       A.TURNING_TORQUES_MAX,
       A.TURNING_TORQUES_MIN,
       (SELECT WM_CONCAT(B.COUPLING_STOVE_NO || '+' || B.LOT_NO)
          FROM MCH_TWISTINGLY_RESULT_D B
         WHERE B.RESULT_NO = A.RESULT_NO) JG_JUDGE_BATCH_NO,
       '合格' TWISTINGLY_RESULT,
       A.RESULT_NO,A.REPORT_PATH
  FROM MCH_TWISTINGLY_RESULT A
 WHERE A.JUDGE_STOVE_NO = {0}
   AND A.BATCH_NO = {1}
   AND A.PLINE_CODE = {2}
        ]]>
    </query>
    
    <query id="JdgMchTwistinglyResult.getResultDInfoByPline" desc="获取拧接字表信息">
        <![CDATA[
 SELECT T.COUPLING_STOVE_NO,
        T.LOT_NO,
        T.COUPLING_NUM,
        T.PLINE_NAME,
        (SELECT MIN(B.JUDGE_RESULT)
           FROM QCM_ZG_JUGDE_APPLY B
          WHERE B.JUDGE_STOVE_NO = A.JUDGE_STOVE_NO
            AND B.BATCH_NO = A.BATCH_NO
            AND B.PROCESS_CODE = 'H') JG_JUDGE_RESULT
   FROM mch_twistingly_result_d T, MCH_TWISTINGLY_RESULT A
  WHERE T.RESULT_NO = A.RESULT_NO
    AND A.JUDGE_STOVE_NO = {0}
    AND A.BATCH_NO = {1}
    AND A.PLINE_CODE = {2}
        ]]>
    </query>


    <query id="JdgMchTwistinglyResult.getResultDInfo" desc="获取拧接字表信息">
        <![CDATA[
 SELECT T.COUPLING_STOVE_NO,
        T.LOT_NO,
        T.COUPLING_NUM,
        T.PLINE_NAME,
        (SELECT MIN(B.JUDGE_RESULT)
           FROM QCM_ZG_JUGDE_APPLY B
          WHERE B.JUDGE_STOVE_NO = A.JUDGE_STOVE_NO
            AND B.BATCH_NO = A.BATCH_NO
            AND B.PROCESS_CODE = 'H') JG_JUDGE_RESULT
   FROM mch_twistingly_result_d T, MCH_TWISTINGLY_RESULT A
  WHERE T.RESULT_NO = A.RESULT_NO
    AND A.JUDGE_STOVE_NO = {0}
    AND A.BATCH_NO = {1}
        ]]>
    </query>
    
    <query id="JdgMchTwistinglyResult.getResultDInfoByBatchNoHeatPlanNo" desc="获取拧接字表信息">
        <![CDATA[
 SELECT E.FEED_HEAT_NO AS COUPLING_STOVE_NO, T.LOT_NO, SUM(T.COUPLING_NUM) COUPLING_NUM
   FROM mch_twistingly_result_d T, MCH_TWISTINGLY_RESULT A,PLN_ZY_JG_M E
  WHERE T.RESULT_NO = A.RESULT_NO
    and T.COUPLING_STOVE_NO = E.JUDGE_STOVE_NO
    AND A.JUDGE_STOVE_NO = {0}
    AND A.BATCH_NO = {1}
    AND A.HEAT_PLAN_NO = {2}
    GROUP BY E.FEED_HEAT_NO, LOT_NO
        ]]>
    </query>
</queryMap>