<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="">
	<query id="PhyJudgeHelper.getSpecByDlyPk" desc="获取合同行信息">
		<![CDATA[
SELECT A.HEIGHT, A.DIMATER
   FROM SLM_ORDER_LINE A, PLN_SALEORD B
  WHERE B.ORD_LN_PK = A.ORD_LN_PK
    AND B.ORD_LN_DLY_PK = {0}
 UNION ALL
 SELECT A.MIN_H, A.MIN_D
   FROM COM_MSC_BL A, PLN_SALEORD B
  WHERE B.ORD_LN_PK = A.PSC_BL
    AND B.ORD_LN_DLY_PK = {0}
		]]>
	</query>
	
	<query id="PhyJudgeHelper.getChemCByBatchNo" desc="通过批号查询最大的C元素值">
        <![CDATA[
SELECT MAX(A.CHEM_VALUE) C
  FROM QCM_BC_CHEMJUDGE T, QCM_BC_CHEM_RESULT A
 WHERE T.CHEM_JUDGE_ID = A.CHEM_JUDGE_ID
   AND T.JUDGE_SEQ = A.JUDGE_SEQ
   AND T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.PROCESS_CDOE = {2}
   AND T.VALIDFLAG = '1'
   AND A.CHEM_NAME = 'C'
   AND ({3} LIKE 'F%' AND (T.SAMPLE_ID LIKE 'F%'
   OR T.SAMPLE_ID NOT LIKE 'F%' AND A.NK_QUALIFIED = '1')
   OR {3} NOT LIKE 'F%')
   AND A.CHEM_VALUE IS NOT NULL
 UNION ALL
 SELECT MIN(A.CHEM_VALUE) C
  FROM QCM_BC_CHEMJUDGE T, QCM_BC_CHEM_RESULT A
 WHERE T.CHEM_JUDGE_ID = A.CHEM_JUDGE_ID
   AND T.JUDGE_SEQ = A.JUDGE_SEQ
   AND T.JUDGE_STOVE_NO = {0}
   AND T.BATCH_NO = {1}
   AND T.PROCESS_CDOE = {2}
   AND T.VALIDFLAG = '1'
   AND A.CHEM_NAME = 'C'
   AND ({3} LIKE 'F%' AND (T.SAMPLE_ID LIKE 'F%'
   OR T.SAMPLE_ID NOT LIKE 'F%' AND A.NK_QUALIFIED = '1')
   OR {3} NOT LIKE 'F%')
   AND A.CHEM_VALUE IS NOT NULL
        ]]>
    </query>
</queryMap>