<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
	<query id="JdgHttAppearanceCheckResult.getInfo" desc="获取热处理表检信息">
        <![CDATA[
SELECT DISTINCT *
     FROM (SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  A.PLINE_CODE,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_DBK_M B
            WHERE {1} = 'E'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0}
           UNION ALL
           SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  A.PLINE_CODE,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_RCL_M B
            WHERE {1} = 'F'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0}
           UNION ALL
           SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  A.PLINE_CODE,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_JGX_M B
            WHERE {1} = 'G'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0}
           UNION ALL
           SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  A.PLINE_CODE,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_JG_M B
            WHERE {1} = 'H'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0})
        ]]>
    </query>


    <query id="JdgHttAppearanceCheckResult.getInfoByPlineCode" desc="获取热处理表检信息">
        <![CDATA[
SELECT DISTINCT *
     FROM (SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_DBK_M B
            WHERE {1} = 'E'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0}
              AND A.PLINE_CODE = {2}
           UNION ALL
           SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_RCL_M B
            WHERE {1} = 'F'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0}
              AND A.PLINE_CODE = {2}
           UNION ALL
           SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_JGX_M B
            WHERE {1} = 'G'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0}
              AND A.PLINE_CODE = {2}
           UNION ALL
           SELECT '合格' JUDGE_RESULT,
                  A.CHECKPIECES,
                  NVL(A.WAST_NUM, 0) WAST_NUM,
                  A.CHECKPIECES - NVL(A.WAST_NUM, 0) QUALIFIED_NUM,
                  A.REPORT_PATH
             FROM HTT_APPEARANCECHECK_RESULT A, PLN_ZY_JG_M B
            WHERE {1} = 'H'
              AND B.HEAT_PLAN_NO = A.HEAT_PLAN_NO
              AND B.JUDGE_STOVE_NO = {0}
              AND A.PLINE_CODE = {2})
        ]]>
    </query>
</queryMap>