<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="接箍上料实绩">
	
	<query id="CoupLoadingService.GetCoupPlanByID" desc="作业计划查询">
        <![CDATA[
         SELECT T.PLINE_CODE,T.PLINE_NAME,T.JUDGE_STOVE_NO,T.BATCH_NO,'是否监制',
				T.PLAN_TIME,T.PLAN_USETIME,T.GROUP_CUT,'备注',
				T.WL_ID_IN,T.JGBL_NUM,T.JGBL_WEIGHT
				FROM PLN_ZY_JG_CUT T
		  WHERE T.COUPCUT_BATCH_ID =?
        ]]>
	</query>
	
	<query id="CoupLoadingService.GetCoupPlanAndLoadResultByID" desc="作业计划和上料实绩查询">
        <![CDATA[
         SELECT T.PLINE_CODE,T.PLINE_NAME,T.JUDGE_STOVE_NO,T.BATCH_NO,'是否监制',
		        T.PLAN_TIME,T.PLAN_USETIME,T.GROUP_CUT,'备注',
		        T.WL_ID_IN,T.JGBL_NUM,T.JGBL_WEIGHT,
		        C.LOAD_PIECES,C.LOAD_SHIFT,C.LOAD_GROUP,C.LOAD_USER,C.LOAD_TIME
        FROM PLN_ZY_JG_CUT T,COUPLING_LOADING_RESULT C
      	WHERE T.COUPCUT_BATCH_ID =C.COUPCUT_BATCH_ID AND T.COUPCUT_BATCH_ID =?
        ]]>
	</query>
	
	<query id="CoupLoadingService.GetLoadResultByID" desc="上料实绩查询">
        <![CDATA[
         SELECT C.LOAD_PIECES,C.LOAD_SHIFT,C.LOAD_GROUP,C.LOAD_USER,C.LOAD_TIME
				FROM COUPLING_LOADING_RESULT C
		  WHERE C.COUPCUT_BATCH_ID =?
        ]]>
	</query>
	
	<query id="CoupLoadingService.AddLoadResult" desc="新增上料实绩">
        <![CDATA[
         INSERT INTO COUPLING_LOADING_RESULT
                    (RESULT_NO,
                    LOAD_PIECES,
                    LOAD_SHIFT,
                    LOAD_GROUP,
                    LOAD_USER,
                    LOAD_TIME,
                    COUPCUT_BATCH_ID)
            VALUES
                   (COUPLING_RESULT_SEQUENCE.Nextval,
                   	?,
                    ?,
                    ?,
                    ?,
                    TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
                    ?)
        ]]>
	</query>
	
	<query id="CoupLoadingService.UpdateLoadResult" desc="修改上料实绩">
		<![CDATA[
			 UPDATE COUPLING_LOADING_RESULT set
							LOAD_PIECES=?,
							LOAD_SHIFT=?,
							LOAD_GROUP=?,
							LOAD_USER=?, 
							LOAD_TIME=TO_DATE(?,'yyyy-mm-dd hh24:mi:ss')
							WHERE COUPCUT_BATCH_ID =?
		]]>
	</query>
	
</queryMap>