<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
	<query id="JdgMilOfflineGroup.getOldJudgeStoveNo" desc="获取原炉号信息">
        <![CDATA[
SELECT DISTINCT *
  FROM (SELECT REGEXP_REPLACE(T.OLD_ZP_JUDGE_STOVE_NO, '-.*', '') JUDGE_STOVE_NO,
               (SELECT MIN(A.BATCH_NO) BATCH_NO
                  FROM QCM_ZC_CHECKCONSIGN A
                 WHERE A.JUDGE_STOVE_NO =
                       REGEXP_REPLACE(T.OLD_ZP_JUDGE_STOVE_NO, '-.*', '')
                   AND A.PROCESS_CODE = 'D'
                   AND A.IS_FLAG = '0') BATCH_NO,
               REGEXP_REPLACE(T.ZP_M_LH, '-.*', '')  ZP_JUDGE_STOVE_NO,
               (SELECT MIN(A.BATCH_NO) BATCH_NO
                  FROM QCM_ZC_CHECKCONSIGN A
                 WHERE A.JUDGE_STOVE_NO = REGEXP_REPLACE(T.ZP_M_LH, '-.*', '')
                   AND A.PROCESS_CODE = 'D'
                   AND A.IS_FLAG = '0') ZP_BATCH_NO
          FROM MIL_OFFLINE_GROUP T
         WHERE T.ZP_JUDGE_STOVE_NO LIKE {0} || '%'
        UNION ALL
        SELECT REGEXP_REPLACE(T.JUDGE_STOVE_NO, '-.*', '') JUDGE_STOVE_NO,
               (SELECT MIN(A.BATCH_NO) BATCH_NO
                  FROM QCM_ZC_CHECKCONSIGN A
                 WHERE A.JUDGE_STOVE_NO = REGEXP_REPLACE(T.JUDGE_STOVE_NO, '-.*', '')
                   AND A.PROCESS_CODE = 'D'
                   AND A.IS_FLAG = '0') BATCH_NO,
               REGEXP_REPLACE(T.ZP_JUDGE_STOVE_NO, '-.*', '') ZP_JUDGE_STOVE_NO,
               (SELECT MIN(A.BATCH_NO) BATCH_NO
                  FROM QCM_ZC_CHECKCONSIGN A
                 WHERE A.JUDGE_STOVE_NO = REGEXP_REPLACE(T.ZP_JUDGE_STOVE_NO, '-.*', '')
                   AND A.PROCESS_CODE = 'D'
                   AND A.IS_FLAG = '0') ZP_BATCH_NO
          FROM MIL_FURNACES_RESLUT_DETIA T
         WHERE T.ZP_JUDGE_STOVE_NO LIKE {0} || '%'
        UNION ALL
        SELECT REGEXP_REPLACE(T.JUDGE_STOVE_NO, '-.*', '') JUDGE_STOVE_NO,
               (SELECT MIN(A.BATCH_NO) BATCH_NO
                  FROM QCM_ZC_CHECKCONSIGN A
                 WHERE A.JUDGE_STOVE_NO = REGEXP_REPLACE(T.JUDGE_STOVE_NO, '-.*', '')
                   AND A.PROCESS_CODE = 'D'
                   AND A.IS_FLAG = '0') BATCH_NO,
               REGEXP_REPLACE(T.NEW_HEAT_NO, '-.*', '') ZP_JUDGE_STOVE_NO,
               (SELECT MIN(A.BATCH_NO) BATCH_NO
                  FROM QCM_ZC_CHECKCONSIGN A
                 WHERE A.JUDGE_STOVE_NO = SUBSTR(T.NEW_HEAT_NO, 1, 6)
                   AND A.PROCESS_CODE = 'D'
                   AND A.IS_FLAG = '0') ZP_BATCH_NO
          FROM MIL_SLAB_SCRAP T
         WHERE T.NEW_HEAT_NO LIKE {0} || '%')
        ]]>
    </query>
</queryMap>