<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="手工输入MPS编号">
 
	<query id="CoreInPutMpsNo.queryMpsLine" desc="是否存在指定炉批组号的材料库存">
		<![CDATA[
   	 	SELECT A.ORDER_NO,
       B.ORD_PK,
       B.ORD_LN_PK,
       B.ORDER_SEQ,
       B.MPS_NO,
       B.MPS_NO_INPUT,
       DECODE(B.MPS_NO_FILE ,NULL,'无MPS文本','最近上传的MPS文本'||' '||B.MPS_NO_FILE) MPS_NO_FILE,
       B.MPS_NO_FILE MPS_FILE

     FROM SLM_ORDER_HEAD A, SLM_ORDER_LINE B
     WHERE B.ORD_PK = ?
     AND A.ORD_PK = B.ORD_PK
     AND A.VALIDFLAG = '1'
     AND B.VALIDFLAG = '1'
     AND B.MPS_FL = '1'
   	 		
		]]>
	</query>
	
	<query id="CoreInPutMpsNo.saveMpsLine" desc="是否存在指定炉批组号的材料库存">
		<![CDATA[
   	 		UPDATE SLM_ORDER_LINE T
   SET T.MPS_NO_INPUT = ?
      -- T.MPS_NO_FILE = ?
    WHERE T.ORD_LN_PK = ?
   AND T.MPS_FL = '1'
   AND T.VALIDFLAG = '1'
   	 		
		]]>
	</query>
	
	<query id="CoreInPutMpsNo.updateMpsLine" desc="是否存在指定炉批组号的材料库存">
		<![CDATA[
   	 		UPDATE SLM_ORDER_LINE T
   SET  
       T.MPS_NO_FILE = ?,
       T.MPS_ID    = ''
    WHERE T.ORD_LN_PK = ?
   AND T.MPS_FL = '1'
   AND T.VALIDFLAG = '1'
   	 		
		]]>
	</query>
	
	
	<query id="CoreInPutMpsNo.selectMpsAddr" desc="是否存在指定炉批组号的材料库存">
		<![CDATA[
    	
    	SELECT T.MPS_ADDR  FROM  SLM_ORDER_STABLE_MPS T
    	WHERE T.MPS_ID = (SELECT A.MPS_ID FROM SLM_ORDER_LINE  A WHERE A.ORD_LN_PK = ?)
   	 		
		]]>
	</query>
	
	
 
	
</queryMap>
