<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="查询工序完成量">
	<query id="CorePlnProcOrdFinish.getPinOrdProcessCode" desc="查询排产合同工序">
		<![CDATA[
			SELECT M.DESGIN_KEY, M1.PROCESS_CODE
			  FROM PLN_SALEORD_PROC            T,
			       PLN_SALEORD                 T1,
			       CRAFT_ORD_DESIGN            M,
			       CRAFT_ORD_DESIGN_MSC_PL_PRC M1
			 WHERE T.ORD_LN_DLY_PK = T1.ORD_LN_DLY_PK
			   AND M.ORD_LN_PK = T1.ORD_LN_PK
			   AND M.CRAFT_SEQ = T.CRAFT_SEQ
			   AND M1.DESGIN_KEY = M.DESGIN_KEY
			   AND M1.MSC_PLINE = T.INDEX_SEQ
			   AND T.ORD_LN_DLY_PK = ?
			   AND T.PLN_DIVIDE_ID = ?
			   ORDER BY M1.PROCESS_CODE DESC
		]]>
	</query>
	
	<query id="CorePlnProcOrdFinish.getZgOrdFinishWt" desc="查询轧管完成量">
		<![CDATA[
			SELECT SUM(NVL(T.FINISHWEIGHT, 0)) FINISHWEIGHT
			  FROM PLN_ORDER_ZG T
			 WHERE T.ORD_LN_DLY_PK = ?
			   AND T.PLN_DIVIDE_ID = ?
		]]>
	</query>
	
	<query id="CorePlnProcOrdFinish.getDbkOrdFinishWt" desc="查询镦拔扩完成量">
		<![CDATA[
			SELECT SUM(NVL(T.FINISHWEIGHT, 0)) FINISHWEIGHT
			  FROM PLN_ORDER_DBK T
			 WHERE T.ORD_LN_DLY_PK = ?
			   AND T.PLN_DIVIDE_ID = ?
		]]>
	</query>
	
	<query id="CorePlnProcOrdFinish.getRclOrdFinishWt" desc="查询热处理完成量">
		<![CDATA[
			SELECT SUM(NVL(T.FINISHWEIGHT, 0)) FINISHWEIGHT
			  FROM PLN_ORDER_RCL T
			 WHERE T.ORD_LN_DLY_PK = ?
			   AND T.PLN_DIVIDE_ID = ?
		]]>
	</query>
	
	<query id="CorePlnProcOrdFinish.getJgxOrdFinishWt" desc="查询加工完成量">
		<![CDATA[
			SELECT SUM(NVL(t.FINISHWEIGHT, 0)) FINISHWEIGHT
			  FROM PLN_ORDER_JGX t
			 WHERE t.ORD_LN_DLY_PK = ?
			   AND t.PLN_DIVIDE_ID = ?
		]]>
	</query>
</queryMap>