<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="精整作业实绩">

	<query id="FinishingService.GetFinishingResultByID" desc="精整作业实绩查询">
        <![CDATA[
         select H.ROLL_NUM1,H.ROLL_NUM2,H.ROLL_NUM3,H.BEND_RATE,H.LSTRAIGHTEN_TEMP,H.ROLL_PIECES,
				H.COL_SHIFT,H.COL_GROUP,H.COL_USER,H.LSTRAIGHTEN_TIME,
				L.ROLL_NUM1 LNUM1,L.ROLL_NUM2 LNUM2,L.ROLL_NUM3 LNUM3,L.BEND_RATE LBEND_RATE,
				L.LSTRAIGHTEN_TEMP LLSTRAIGHTEN_TEMP,L.ROLL_PIECES LROLL_PIECES,
				L.COL_SHIFT SHIFT,L.COL_GROUP LGROUP,L.COL_USER LUSER,L.LSTRAIGHTEN_TIME LTIME,
				T.SIZING_PIECES,T.COL_SHIFT TSHIFT,T.COL_GROUP TGROUP,T.COL_USER TUSER,T.SIZING_TIME
			from HTT_LSTRAIGHTEN_RESULT H,HTT_LSTRAIGHTEN_RESULT L,HTT_SIZING_RESULT T
			WHERE H.LSTRAIGHTEN_MODE=0 
			AND L.LSTRAIGHTEN_MODE=1
			AND H.PLAN_NO = L.PLAN_NO
			AND H.PLAN_NO = T.PLAN_NO
			AND T.PLAN_NO=?
        ]]>
	</query>
	
	<query id="FinishingService.GetSizingResultByID" desc="定径实绩查询">
        <![CDATA[
         select T.SIZING_PIECES,T.COL_SHIFT,T.COL_GROUP,T.COL_USER,T.SIZING_TIME,
				T.PLINE_CODE,T.PLAN_NO
			from HTT_SIZING_RESULT T
			where T.PLAN_NO=?
        ]]>
	</query>
	
	<query id="FinishingService.AddLstraightenResult" desc="新增矫直实绩">
        <![CDATA[
         INSERT INTO HTT_LSTRAIGHTEN_RESULT
                    (RESULT_NO,
                    ROLL_NUM1,
                    ROLL_NUM2,
                    ROLL_NUM3,
                    BEND_RATE,
                    LSTRAIGHTEN_TEMP,
                    ROLL_PIECES,
                    COL_SHIFT,
                    COL_GROUP,
                    COL_USER,
                    LSTRAIGHTEN_TIME,
                    PLINE_CODE,
                    PLAN_NO,
                    LSTRAIGHTEN_MODE)
            VALUES
                   (COUPLING_RESULT_SEQUENCE.Nextval,
                   	?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
                    ?,
                    ?,
                    ?)
        ]]>
	</query>
	
	<query id="FinishingService.UpdateLstraightenResult" desc="修改矫直实绩">
		<![CDATA[
			 UPDATE HTT_LSTRAIGHTEN_RESULT set
							ROLL_NUM1=?,
							ROLL_NUM2=?,
							ROLL_NUM3=?,
							BEND_RATE=?,
		                    LSTRAIGHTEN_TEMP=?,
		                    ROLL_PIECES=?,
		                    COL_SHIFT=?,
		                    COL_GROUP=?,
		                    COL_USER=?,
							LSTRAIGHTEN_TIME=TO_DATE(?,'yyyy-mm-dd hh24:mi:ss')
							WHERE PLINE_CODE=? 
							AND PLAN_NO =?
							AND LSTRAIGHTEN_MODE=?		
		]]>
	</query>
	
	<query id="FinishingService.AddSizingResult" desc="新增定径实绩">
        <![CDATA[
         INSERT INTO HTT_SIZING_RESULT
                    (RESULT_NO,
                    SIZING_PIECES,
                    COL_SHIFT,
                    COL_GROUP,
                    COL_USER,
                    SIZING_TIME,
                    PLINE_CODE,
                    PLAN_NO)
            VALUES
                   (COUPLING_RESULT_SEQUENCE.Nextval,
                   	?,
                    ?,
                    ?,
                    ?,
                    TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
                    ?,
                    ?)
        ]]>
	</query>
	
	<query id="FinishingService.UpdateSizingResult" desc="修改定径实绩">
		<![CDATA[
			 UPDATE HTT_SIZING_RESULT set
							SIZING_PIECES=?,
							COL_SHIFT=?,
							COL_GROUP=?,
							COL_USER=?, 
							SIZING_TIME=TO_DATE(?,'yyyy-mm-dd hh24:mi:ss')
							WHERE PLINE_CODE=? 
							AND PLAN_NO =?
		]]>
	</query>

</queryMap>
