<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="尺寸外观检查实绩">

	<query id="AppearanceService.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.ODMAX,C.ODMIN,C.OUTOFROUNDNESS,C.ENDSTRAIGHTNESS,C.FULLLENGTHSTRAIGHTNESS,
				C.CHECK_RESULT,C.CHECKPIECES,C.COL_SHIFT,C.COL_GROUP,C.COL_USER,C.COL_TIME
			from PLN_ZY_RCL_M T,HTT_APPEARANCECHECK_RESULT C
			where T.RCLBATCH_ID= C.PLAN_NO
			AND T.RCLBATCH_ID=?
        ]]>
	</query>
	
	<query id="AppearanceService.GetAppearanceResultById" desc="按计划号查询尺寸外观检查实绩">
        <![CDATA[
         SELECT T.PLAN_NO,T.PLINE_CODE,T.ODMAX,T.ODMIN,T.OUTOFROUNDNESS,
				T.ENDSTRAIGHTNESS,T.FULLLENGTHSTRAIGHTNESS,T.CHECKPIECES,
				T.CHECK_RESULT,T.COL_SHIFT,T.COL_GROUP,T.COL_USER,T.COL_TIME
			FROM HTT_APPEARANCECHECK_RESULT T
			WHERE T.PLAN_NO=?
        ]]>
	</query>
	
	<query id="AppearanceService.AddAppearanceResult" desc="新增尺寸外观检查实绩">
        <![CDATA[
         INSERT INTO HTT_APPEARANCECHECK_RESULT
                    (RESULT_NO,
                    ODMAX,
                    ODMIN,
                    OUTOFROUNDNESS,
                    ENDSTRAIGHTNESS,
                    FULLLENGTHSTRAIGHTNESS,
                    CHECK_RESULT,
                    CHECKPIECES,
                    COL_SHIFT,
                    COL_GROUP,
                    COL_USER,
                    COL_TIME,
                    PLAN_NO,
                    PLINE_CODE)
            VALUES
                   (COUPLING_RESULT_SEQUENCE.Nextval,
                   	?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    TO_DATE(?,'yyyy-mm-dd hh24:mi:ss'),
                    ?,
                    ?)
        ]]>
	</query>
	
	<query id="AppearanceService.UpdateAppearanceResult" desc="修改尺寸外观检查实绩">
		<![CDATA[
			 UPDATE HTT_APPEARANCECHECK_RESULT set
		                    ODMAX=?,
		                    ODMIN=?,
		                    OUTOFROUNDNESS=?,
		                    ENDSTRAIGHTNESS=?,
		                    FULLLENGTHSTRAIGHTNESS=?,
		                    CHECK_RESULT=?,
		                    CHECKPIECES=?,
		                    COL_SHIFT=?,
		                    COL_GROUP=?,
		                    COL_USER=?,
		                    COL_TIME=TO_DATE(?,'yyyy-mm-dd hh24:mi:ss')
						WHERE PLAN_NO=? AND PLINE_CODE =?
		]]>
	</query>
	
	<query id="AppearanceService.GetAppearanceDById" desc="按计划号查询尺寸外观检查实绩结果表">
        <![CDATA[
         SELECT T.SEQ_NO,T.PIPE_NO,T.ENDA_STRAIGHTNESS,T.ENDA_AVG_OD,T.ENDA_MAX_OD,
				T.ENDA_MIN_OD,T.ENDA_OVALITY,T.ENDB_STRAIGHTNESS,T.ENDB_AVG_OD,
				T.ENDB_MIN_OD,T.ENDB_MAX_OD,T.ENDB_OVALITY
			FROM HTT_APPEARANCECHECK_RESULT_D T
			WHERE T.PLAN_NO=?
        ]]>
	</query>
	
	<query id="AppearanceService.GetAppearanceDByPlanNoAndSeqNo" 
	desc="按计划号和序号查询尺寸外观检查实绩结果表">
        <![CDATA[
         SELECT T.PIPE_NO,T.ENDA_STRAIGHTNESS,T.ENDA_AVG_OD,T.ENDA_MAX_OD,
				T.ENDA_MIN_OD,T.ENDA_OVALITY,T.ENDB_STRAIGHTNESS,T.ENDB_AVG_OD,
				T.ENDB_MIN_OD,T.ENDB_MAX_OD,T.ENDB_OVALITY
			FROM HTT_APPEARANCECHECK_RESULT_D T
			WHERE T.PLAN_NO=? AND T.SEQ_NO=?
        ]]>
	</query>
	
	<query id="AppearanceService.AddAppearanceD" desc="新增尺寸外观检查实绩结果表">
        <![CDATA[
         INSERT INTO HTT_APPEARANCECHECK_RESULT_D
                    (RESULT_NO,
                    PIPE_NO,
                    ENDA_STRAIGHTNESS,
                    ENDA_AVG_OD,
                    ENDA_MAX_OD,
                    ENDA_MIN_OD,
                    ENDA_OVALITY,
                    ENDB_STRAIGHTNESS,
                    ENDB_AVG_OD,
                    ENDB_MIN_OD,
                    ENDB_MAX_OD,
                    ENDB_OVALITY,
                    PLAN_NO,
                    SEQ_NO)
            VALUES
                   (COUPLING_RESULT_SEQUENCE.Nextval,
                   	?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?,
                    ?)
        ]]>
	</query>
	
	<query id="AppearanceService.UpdateAppearanceD" desc="修改尺寸外观检查实绩结果表">
		<![CDATA[
			 UPDATE HTT_APPEARANCECHECK_RESULT_D set
		                    PIPE_NO=?,
		                    ENDA_STRAIGHTNESS=?,
		                    ENDA_AVG_OD=?,
		                    ENDA_MAX_OD=?,
		                    ENDA_MIN_OD=?,
		                    ENDA_OVALITY=?,
		                    ENDB_STRAIGHTNESS=?,
		                    ENDB_AVG_OD=?,
		                    ENDB_MIN_OD=?,
		                    ENDB_MAX_OD=?,
		                    ENDB_OVALITY=?
						WHERE PLAN_NO=? AND SEQ_NO =?
		]]>
	</query>

</queryMap>