<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="热处理上料实绩">
	
	<query id="HttLoadingService.GetHttPlanByID" desc="作业计划查询">
        <![CDATA[
         select T.PLINE_CODE,T.PLINE_NAME,T.HEATNO,T.ROLLBATCH_ID,T.PLAN_TIME,
				T.PLAN_USETIME,T.INWL_ID,T.IN_NUM,T.IN_WEIGHT,T.LENGTHMAX,T.LENGTHMIN
			from PLN_ZY_RCL_M T
			where T.RCLBATCH_ID=?
        ]]>
	</query>
	
	<query id="HttLoadingService.GetHttPlanAndResultByID" desc="作业计划和上料实绩查询">
        <![CDATA[
         select T.PLINE_CODE,T.PLINE_NAME,T.HEATNO,T.ROLLBATCH_ID,T.PLAN_TIME,
				T.PLAN_USETIME,T.INWL_ID,T.IN_NUM,T.IN_WEIGHT,T.LENGTHMAX,T.LENGTHMIN,
				C.LOAD_PIECES,C.LOAD_SHIFT,C.LOAD_GROUP,C.LOAD_USER,C.LOAD_TIME,
				C.ORDER_NO,C.ORDER_SEQ,C.ORDER_QUANTITY
			from PLN_ZY_RCL_M T,HTT_LOADING_RESULT C
			where T.RCLBATCH_ID= C.RCLBATCH_ID
			AND C.STATE=1
			AND T.RCLBATCH_ID=?
        ]]>
	</query>
	
	<query id="HttLoadingService.GetLoadResultByID" desc="上料实绩查询">
        <![CDATA[
         SELECT T.LOAD_PIECES,T.LOAD_SHIFT,T.LOAD_GROUP,T.LOAD_USER,T.LOAD_TIME,
				T.ORDER_NO,T.ORDER_SEQ,T.ORDER_QUANTITY
			FROM HTT_LOADING_RESULT T
			WHERE T.STATE=1 AND T.RCLBATCH_ID=?
        ]]>
	</query>
	
	<query id="HttLoadingService.GetLoadResultByIDPD" desc="判断是否有过上料实绩">
        <![CDATA[
         SELECT * FROM HTT_LOADING_RESULT  WHERE  RCLBATCH_ID=?
        ]]>
	</query>
	
	<query id="HttLoadingService.AddLoadResult" desc="新增上料实绩">
        <![CDATA[
         INSERT INTO HTT_LOADING_RESULT
                    (RESULT_NO,
                    LOAD_PIECES,
                    LOAD_SHIFT,
                    LOAD_GROUP,
                    LOAD_USER,
                    LOAD_TIME,
                    ORDER_NO,
                    ORDER_SEQ,
                    ORDER_QUANTITY,
                    RCLBATCH_ID)
            VALUES
                   (COUPLING_RESULT_SEQUENCE.Nextval,
                   	?,
                    ?,
                    ?,
                    ?,
                    TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
                    ?,
                    ?,
                    ?,
                    ?)
        ]]>
	</query>
	
	<query id="HttLoadingService.UpdateLoadResult" desc="修改上料实绩">
		<![CDATA[
			 UPDATE HTT_LOADING_RESULT set
							LOAD_PIECES=?,
							LOAD_SHIFT=?,
							LOAD_GROUP=?,
							LOAD_USER=?, 
							LOAD_TIME=TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
							ORDER_NO=?,
		                    ORDER_SEQ=?,
		                    ORDER_QUANTITY=?
							WHERE STATE=1 AND RCLBATCH_ID =?
		]]>
	</query>
	
	<query id="HttLoadingService.ReturnHttLoadingResult" desc="撤销上料实绩">
		<![CDATA[
			 UPDATE HTT_LOADING_RESULT set
							STATE=0
							WHERE  RCLBATCH_ID =?
		]]>
	</query>
</queryMap>