<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="上料锯切实绩操作">
	<query id="MilStraight.PlanQueryCKTC1" desc="查询跟踪记录信息">
		<![CDATA[
		SELECT 
       TO_CHAR(SCRAP_TIME, 'YYYY-MM-DD HH24:MI:SS') SCRAP_TIME,
       TO_CHAR(BACKLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') BACKLINE_TIME,
       CASE OFFLINE_PROCESS
       WHEN '1' THEN '矫直'
       WHEN '2' THEN  '探伤'
       WHEN '3' THEN  '最终下线'
       END AS OFFLINE_PROCESS,
       JUDGE_STOVE_NO,
       STEELCODE,
       STEELNAME,
       GRADECODE,
       GRADENAME,
       PLINE_CODE,
       CASE  STATUS
       WHEN '0' THEN '正常轧制'
       WHEN '1' THEN  '剔除'
       END AS  STATUS,
       FTUBE_DIAMETER,
       FTUBE_WALL_THICKNESS,
       FTUBE_LENGTH,
       TO_CHAR(START_STRAIGHTENING_TIME, 'YYYY-MM-DD HH24:MI:SS') START_STRAIGHTENING_TIME,
       TO_CHAR(END_STRAIGHTENING_TIME, 'YYYY-MM-DD HH24:MI:SS') END_STRAIGHTENING_TIME,
       CASE   OFFLINE_FLAG  
       WHEN '0' THEN '未下线'
       WHEN '1' THEN  '下线'
       WHEN '2' THEN  '返线'
       END AS OFFLINE_FLAG,
       TO_CHAR(OFFLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') OFFLINE_TIME,
       CASE FOLLOW_FLAG
       WHEN '0' THEN '未跟队'
       WHEN '1' THEN  '跟队'
       END AS FOLLOW_FLAG,
       FOLLOW_HEAT_NO,
       TO_CHAR(FOLLOW_TIME, 'YYYY-MM-DD HH24:MI:SS') FOLLOW_TIME,
       CASE GROUP_FLAG
       WHEN '0' THEN '未组炉'
       WHEN '1' THEN  '组炉' 
       END AS GROUP_FLAG,
       BEFORE_HEAT_NO,
       BEFORE_MAT_NO,
       REMARK,
       CASE COL_MODE
       WHEN '0' THEN '接口采集'
       WHEN '1' THEN  '人工录入' 
       END AS COL_MODE,
       TO_CHAR(COL_TIME, 'YYYY-MM-DD HH24:MI:SS') COL_TIME,
       COL_USER,
       case COL_SHIFT 
       WHEN '0' THEN '常白班'
       WHEN '1' THEN '早班'
       WHEN '2' THEN '中班'
       WHEN '3' THEN '晚班'
                end as COL_SHIFT,
       case COL_GROUP
       WHEN '1' THEN '甲'
       WHEN '2' THEN '乙'
       WHEN '3' THEN '丙'
       WHEN '4' THEN '丁'
               end as COL_GROUP,
       SEQ,
       COL_NO,
       MAT_NO,
       LOT_NO,
       STOVE_NO,
        CASE CHANGE_FLAG
       WHEN '0' THEN ''
       WHEN '1' THEN '确认交班'
       WHEN '2' THEN '待接班确认'
         END AS CHANGE_FLAG,
         PIPE_LENGTH
       FROM MIL_STRAIGH_RACK
       WHERE
       1=1
       AND judge_stove_no = ?
       --AND offline_flag in( 0,?)
       AND col_no = 1
		]]>
		</query>
			<query id="MilStraight.PlanQueryCKTC2" desc="查询跟踪记录信息">
		<![CDATA[
			 SELECT 
       TO_CHAR(SCRAP_TIME, 'YYYY-MM-DD HH24:MI:SS') SCRAP_TIME,
       TO_CHAR(BACKLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') BACKLINE_TIME,
       CASE OFFLINE_PROCESS
       WHEN '1' THEN '矫直'
       WHEN '2' THEN  '探伤'
       WHEN '3' THEN  '最终下线'
       END AS OFFLINE_PROCESS,
       JUDGE_STOVE_NO,
       STEELCODE,
       STEELNAME,
       GRADECODE,
       GRADENAME,
       PLINE_CODE,
       CASE  STATUS
       WHEN '0' THEN '正常轧制'
       WHEN '1' THEN  '剔除'
       END AS  STATUS,
       FTUBE_DIAMETER,
       FTUBE_WALL_THICKNESS,
       FTUBE_LENGTH,
       TO_CHAR(START_STRAIGHTENING_TIME, 'YYYY-MM-DD HH24:MI:SS') START_STRAIGHTENING_TIME,
       TO_CHAR(END_STRAIGHTENING_TIME, 'YYYY-MM-DD HH24:MI:SS') END_STRAIGHTENING_TIME,
       CASE   OFFLINE_FLAG  
       WHEN '0' THEN '未下线'
       WHEN '1' THEN  '下线'
       WHEN '2' THEN  '返线'
       END AS OFFLINE_FLAG,
       TO_CHAR(OFFLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') OFFLINE_TIME,
       CASE FOLLOW_FLAG
       WHEN '0' THEN '未跟队'
       WHEN '1' THEN  '跟队'
       END AS FOLLOW_FLAG,
       FOLLOW_HEAT_NO,
       TO_CHAR(FOLLOW_TIME, 'YYYY-MM-DD HH24:MI:SS') FOLLOW_TIME,
       CASE GROUP_FLAG
       WHEN '0' THEN '未组炉'
       WHEN '1' THEN  '组炉' 
       END AS GROUP_FLAG,
       BEFORE_HEAT_NO,
       BEFORE_MAT_NO,
       REMARK,
       CASE COL_MODE
       WHEN '0' THEN '接口采集'
       WHEN '1' THEN  '人工录入' 
       END AS COL_MODE,
       TO_CHAR(COL_TIME, 'YYYY-MM-DD HH24:MI:SS') COL_TIME,
       COL_USER,
       case COL_SHIFT 
       WHEN '0' THEN '常白班'
       WHEN '1' THEN '早班'
       WHEN '2' THEN '中班'
       WHEN '3' THEN '晚班'
                end as COL_SHIFT,
       case COL_GROUP
       WHEN '1' THEN '甲'
       WHEN '2' THEN '乙'
       WHEN '3' THEN '丙'
       WHEN '4' THEN '丁'
               end as COL_GROUP,
       SEQ,
       COL_NO,
       MAT_NO,
       LOT_NO,
       STOVE_NO,
        CASE CHANGE_FLAG
       WHEN '0' THEN ''
       WHEN '1' THEN '确认交班'
       WHEN '2' THEN '待接班确认'
         END AS CHANGE_FLAG,
         PIPE_LENGTH
       FROM MIL_STRAIGH_RACK
       WHERE
       1=1
       AND judge_stove_no = ?
       --AND offline_flag in( 0,?)
       AND col_no = 2
		]]>
		</query>
			<query id="MilStraight.PlanQueryCKTC3" desc="查询跟踪记录信息">
		<![CDATA[
       SELECT 
       TO_CHAR(SCRAP_TIME, 'YYYY-MM-DD HH24:MI:SS') SCRAP_TIME,
       TO_CHAR(BACKLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') BACKLINE_TIME,
       CASE OFFLINE_PROCESS
       WHEN '1' THEN '矫直'
       WHEN '2' THEN  '探伤'
       WHEN '3' THEN  '最终下线'
       END AS OFFLINE_PROCESS,
       JUDGE_STOVE_NO,
       STEELCODE,
       STEELNAME,
       GRADECODE,
       GRADENAME,
       PLINE_CODE,
       CASE  STATUS
       WHEN '0' THEN '正常轧制'
       WHEN '1' THEN  '剔除'
       END AS  STATUS,
       FTUBE_DIAMETER,
       FTUBE_WALL_THICKNESS,
       FTUBE_LENGTH,
       TO_CHAR(START_STRAIGHTENING_TIME, 'YYYY-MM-DD HH24:MI:SS') START_STRAIGHTENING_TIME,
       TO_CHAR(END_STRAIGHTENING_TIME, 'YYYY-MM-DD HH24:MI:SS') END_STRAIGHTENING_TIME,
       CASE   OFFLINE_FLAG  
       WHEN '0' THEN '未下线'
       WHEN '1' THEN  '下线'
       WHEN '2' THEN  '返线'
       END AS OFFLINE_FLAG,
       TO_CHAR(OFFLINE_TIME, 'YYYY-MM-DD HH24:MI:SS') OFFLINE_TIME,
       CASE FOLLOW_FLAG
       WHEN '0' THEN '未跟队'
       WHEN '1' THEN  '跟队'
       END AS FOLLOW_FLAG,
       FOLLOW_HEAT_NO,
       TO_CHAR(FOLLOW_TIME, 'YYYY-MM-DD HH24:MI:SS') FOLLOW_TIME,
       CASE GROUP_FLAG
       WHEN '0' THEN '未组炉'
       WHEN '1' THEN  '组炉' 
       END AS GROUP_FLAG,
       BEFORE_HEAT_NO,
       BEFORE_MAT_NO,
       REMARK,
       CASE COL_MODE
       WHEN '0' THEN '接口采集'
       WHEN '1' THEN  '人工录入' 
       END AS COL_MODE,
       TO_CHAR(COL_TIME, 'YYYY-MM-DD HH24:MI:SS') COL_TIME,
       COL_USER,
       case COL_SHIFT 
       WHEN '0' THEN '常白班'
       WHEN '1' THEN '早班'
       WHEN '2' THEN '中班'
       WHEN '3' THEN '晚班'
                end as COL_SHIFT,
       case COL_GROUP
       WHEN '1' THEN '甲'
       WHEN '2' THEN '乙'
       WHEN '3' THEN '丙'
       WHEN '4' THEN '丁'
               end as COL_GROUP,
       SEQ,
       COL_NO,
       MAT_NO,
       LOT_NO,
       STOVE_NO,
        CASE CHANGE_FLAG
       WHEN '0' THEN ''
       WHEN '1' THEN '确认交班'
       WHEN '2' THEN '待接班确认'
         END AS CHANGE_FLAG,
         PIPE_LENGTH
       FROM MIL_STRAIGH_RACK
       WHERE
       1=1
       AND judge_stove_no = ?
       --AND offline_flag in( 0,?)
       AND col_no = 3
		]]>
		</query>
		<query id="MilStraight.Addstraight_result" desc="新增上料锯切实绩">
        <![CDATA[
         INSERT INTO MIL_STRAIGHTENING_RESULT
  (ROLLER_DOWN_ANGLE26,
   ROLLER_SPACE22,
   ROLLER_SPACE23,
   ROLLER_SPACE24,
   ROLLER_SPACE25,
   ROLLER_UP_ANGLE31,
   ROLLER_UP_ANGLE32,
   ROLLER_UP_ANGLE33,
   ROLLER_UP_ANGLE34,
   ROLLER_UP_ANGLE35,
   ROLLER_DOWN_ANGLE31,
   ROLLER_DOWN_ANGLE32,
   ROLLER_DOWN_ANGLE33,
   ROLLER_DOWN_ANGLE34,
   ROLLER_DOWN_ANGLE35,
   ROLLER_SPACE31,
   ROLLER_SPACE32,
   ROLLER_SPACE33,
   ROLLER_SPACE34,
   ROLLER_SPACE35,
   ROLLER_ENTER_UP_ANGLE1,
   ROLLER_ENTER_UP_ANGLE2,
   ROLLER_ENTER_DOWN_ANGLE1,
   ROLLER_ENTER_DOWN_ANGLE2,
   ROLLER_MIDDLE_UP_ANGLE1,
   ROLLER_MIDDLE_UP_ANGLE2,
   ROLLER_MIDDLE_DOWN_ANGLE1,
   ROLLER_MIDDLE_DOWN_ANGLE2,
   ROLLER_EXIT_UP_ANGLE1,
   ROLLER_EXIT_UP_ANGLE2,
   ROLLER_EXIT_DOWN_ANGLE1,
   ROLLER_EXIT_DOWN_ANGLE2,
   ROLLER_ENTER_SPACE1,
   ROLLER_ENTER_SPACE2,
   ROLLER_MIDDLE_SPACE1,
   ROLLER_MIDDLE_SPACE2,
   ROLLER_EXIT_SPACE1,
   ROLLER_EXIT_SPACE2,
   MIDDLE_ROLLER_SPACE,
   MIDDLE_ROLLER_SPACE2,
   MAIN_MOTOR_SPEED,
   MAIN_MOTOR_SPEED2,
   ROLLING_SPEED,
   DEFLECTION,
   ENTRANCE_SPEED,
   EXIT_SPEED,
   START_TIME,
   EXECUTIVE_PRODUCER,
   PRODUCER_TEL,
   COL_MODE,
   COL_TIME,
   COL_USER,
   COL_SHIFT,
   COL_GROUP,
   RESULT_NO,
   LOT_NO,
   STOVE_NO,
   JUDGE_STOVE_NO,
   PLINE_CODE,
   ROLLER_UP_ANGLE11,
   ROLLER_UP_ANGLE12,
   ROLLER_UP_ANGLE13,
   ROLLER_UP_ANGLE14,
   ROLLER_UP_ANGLE15,
   ROLLER_DOWN_ANGLE11,
   ROLLER_DOWN_ANGLE12,
   ROLLER_DOWN_ANGLE13,
   ROLLER_DOWN_ANGLE14,
   ROLLER_DOWN_ANGLE15,
   ROLLER_SPACE11,
   ROLLER_SPACE12,
   ROLLER_SPACE13,
   ROLLER_SPACE14,
   ROLLER_SPACE15,
   ROLLER_UP_ANGLE21,
   ROLLER_UP_ANGLE22,
   ROLLER_UP_ANGLE23,
   ROLLER_UP_ANGLE24,
   ROLLER_UP_ANGLE25,
   ROLLER_DOWN_ANGLE21,
   ROLLER_DOWN_ANGLE22,
   ROLLER_DOWN_ANGLE23,
   ROLLER_DOWN_ANGLE24,
   ROLLER_DOWN_ANGLE25,
   ROLLER_SPACE21,
   PRO_PLAN_ID,
   GX_PLAN_NO)
VALUES
  (
   
   '#ROLLER_DOWN_ANGLE26#',
   '#ROLLER_SPACE22#',
   '#ROLLER_SPACE23#',
   '#ROLLER_SPACE24#',
   '#ROLLER_SPACE25#',
   '#ROLLER_UP_ANGLE31#',
   '#ROLLER_UP_ANGLE32#',
   '#ROLLER_UP_ANGLE33#',
   '#ROLLER_UP_ANGLE34#',
   '#ROLLER_UP_ANGLE35#',
   '#ROLLER_DOWN_ANGLE31#',
   '#ROLLER_DOWN_ANGLE32#',
   '#ROLLER_DOWN_ANGLE33#',
   '#ROLLER_DOWN_ANGLE34#',
   '#ROLLER_DOWN_ANGLE35#',
   '#ROLLER_SPACE31#',
   '#ROLLER_SPACE32#',
   '#ROLLER_SPACE33#',
   '#ROLLER_SPACE34#',
   '#ROLLER_SPACE35#',
   '#ROLLER_ENTER_UP_ANGLE1#',
   '#ROLLER_ENTER_UP_ANGLE2#',
   '#ROLLER_ENTER_DOWN_ANGLE1#',
   '#ROLLER_ENTER_DOWN_ANGLE2#',
   '#ROLLER_MIDDLE_UP_ANGLE1#',
   '#ROLLER_MIDDLE_UP_ANGLE2#',
   '#ROLLER_MIDDLE_DOWN_ANGLE1#',
   '#ROLLER_MIDDLE_DOWN_ANGLE2#',
   '#ROLLER_EXIT_UP_ANGLE1#',
   '#ROLLER_EXIT_UP_ANGLE2#',
   '#ROLLER_EXIT_DOWN_ANGLE1#',
   '#ROLLER_EXIT_DOWN_ANGLE2#',
   '#ROLLER_ENTER_SPACE1#',
   '#ROLLER_ENTER_SPACE2#',
   '#ROLLER_MIDDLE_SPACE1#',
   '#ROLLER_MIDDLE_SPACE2#',
   '#ROLLER_EXIT_SPACE1#',
   '#ROLLER_EXIT_SPACE2#',
   '#MIDDLE_ROLLER_SPACE#',
   '#MIDDLE_ROLLER_SPACE2#',
   '#MAIN_MOTOR_SPEED#',
   '#MAIN_MOTOR_SPEED2#',
   '#ROLLING_SPEED#',
   '#DEFLECTION#',
   '#ENTRANCE_SPEED#',
   '#EXIT_SPEED#',
   SYSDATE,
   '#EXECUTIVE_PRODUCER#',
   '#PRODUCER_TEL#',
   '#COL_MODE#',
   SYSDATE,
   '#COL_USER#',
   '#COL_SHIFT#',
   '#COL_GROUP#',
   '#RESULT_NO#',
   '#LOT_NO#',
   '#STOVE_NO#',
   '#JUDGE_STOVE_NO#',
   '#PLINE_CODE#',
   '#ROLLER_UP_ANGLE11#',
   '#ROLLER_UP_ANGLE12#',
   '#ROLLER_UP_ANGLE13#',
   '#ROLLER_UP_ANGLE14#',
   '#ROLLER_UP_ANGLE15#',
   '#ROLLER_DOWN_ANGLE11#',
   '#ROLLER_DOWN_ANGLE12#',
   '#ROLLER_DOWN_ANGLE13#',
   '#ROLLER_DOWN_ANGLE14#',
   '#ROLLER_DOWN_ANGLE15#',
   '#ROLLER_SPACE11#',
   '#ROLLER_SPACE12#',
   '#ROLLER_SPACE13#',
   '#ROLLER_SPACE14#',
   '#ROLLER_SPACE15#',
   '#ROLLER_UP_ANGLE21#',
   '#ROLLER_UP_ANGLE22#',
   '#ROLLER_UP_ANGLE23#',
   '#ROLLER_UP_ANGLE24#',
   '#ROLLER_UP_ANGLE25#',
   '#ROLLER_DOWN_ANGLE21#',
   '#ROLLER_DOWN_ANGLE22#',
   '#ROLLER_DOWN_ANGLE23#',
   '#ROLLER_DOWN_ANGLE24#',
   '#ROLLER_DOWN_ANGLE25#',
   '#ROLLER_SPACE21#',
   '#PRO_PLAN_ID#',
   '#GX_PLAN_NO#')
        ]]>
	</query>
	<query id="MilStraight.UpdatestraightStatue" desc="修改上料行标识">
        <![CDATA[
        update mil_plan t
   set t.status = '75'
 where t.judge_stove_no = '#JUDGE_STOVE_NO#'
   AND NVL(T.PRO_PLAN_ID,'/') = NVL('#PRO_PLAN_ID#','/')
   AND NVL(T.GX_PLAN_NO,'/') = NVL('#GX_PLAN_NO#','/')
        ]]>
   	</query>
   		<query id="MilStraight.SingleStraightQuery" desc="修改上料行标识">
        <![CDATA[
select scrap_num,
             qualified_num,
             changenum,
             IN_MAT_NUM
        from MIL_STRAIGHTENING_RESULT
        ]]>
   	</query>
		<query id="MilStraight.UpdateSTRAIGHTENINGStatue" desc="修改上料行标识">
        <![CDATA[
         UPDATE MIL_STRAIGHTENING_RESULT
   SET CHANGE_NUM                = '#CHANGE_NUM#',
       ROLLER_DOWN_ANGLE26       = '#ROLLER_DOWN_ANGLE26#',
       ROLLER_UP_ANGLE26         = '#ROLLER_UP_ANGLE26#',
       ROLLER_SPACE22            = '#ROLLER_SPACE22#',
       ROLLER_SPACE23            = '#ROLLER_SPACE23#',
       ROLLER_SPACE24            = '#ROLLER_SPACE24#',
       ROLLER_SPACE25            = '#ROLLER_SPACE25#',
       QUALIFIED_NUM3            = '#QUALIFIED_NUM3#',
       SCRAP_NUM3                = '#SCRAP_NUM3#',
       ROLLER_UP_ANGLE31         = '#ROLLER_UP_ANGLE31#',
       ROLLER_UP_ANGLE32         = '#ROLLER_UP_ANGLE32#',
       ROLLER_UP_ANGLE33         = '#ROLLER_UP_ANGLE33#',
       ROLLER_UP_ANGLE34         = '#ROLLER_UP_ANGLE34#',
       ROLLER_UP_ANGLE35         = '#ROLLER_UP_ANGLE35#',
       ROLLER_DOWN_ANGLE31       = '#ROLLER_DOWN_ANGLE31#',
       ROLLER_DOWN_ANGLE32       = '#ROLLER_DOWN_ANGLE32#',
       ROLLER_DOWN_ANGLE33       = '#ROLLER_DOWN_ANGLE33#',
       ROLLER_DOWN_ANGLE34       = '#ROLLER_DOWN_ANGLE34#',
       ROLLER_DOWN_ANGLE35       = '#ROLLER_DOWN_ANGLE35#',
       ROLLER_SPACE31            = '#ROLLER_SPACE31#',
       ROLLER_SPACE32            = '#ROLLER_SPACE32#',
       ROLLER_SPACE33            = '#ROLLER_SPACE33#',
       ROLLER_SPACE34            = '#ROLLER_SPACE34#',
       ROLLER_SPACE35            = '#ROLLER_SPACE35#',
       ROLLER_ENTER_UP_ANGLE1    = '#ROLLER_ENTER_UP_ANGLE1#',
       ROLLER_ENTER_UP_ANGLE2    = '#ROLLER_ENTER_UP_ANGLE2#',
       ROLLER_ENTER_DOWN_ANGLE1  = '#ROLLER_ENTER_DOWN_ANGLE1#',
       ROLLER_ENTER_DOWN_ANGLE2  = '#ROLLER_ENTER_DOWN_ANGLE2#',
       ROLLER_MIDDLE_UP_ANGLE1   = '#ROLLER_MIDDLE_UP_ANGLE1#',
       ROLLER_MIDDLE_UP_ANGLE2   = '#ROLLER_MIDDLE_UP_ANGLE2#',
       ROLLER_MIDDLE_DOWN_ANGLE1 = '#ROLLER_MIDDLE_DOWN_ANGLE1#',
       ROLLER_MIDDLE_DOWN_ANGLE2 = '#ROLLER_MIDDLE_DOWN_ANGLE2#',
       ROLLER_EXIT_UP_ANGLE1     = '#ROLLER_EXIT_UP_ANGLE1#',
       ROLLER_EXIT_UP_ANGLE2     = '#ROLLER_EXIT_UP_ANGLE2#',
       ROLLER_EXIT_DOWN_ANGLE1   = '#ROLLER_EXIT_DOWN_ANGLE1#',
       ROLLER_EXIT_DOWN_ANGLE2   = '#ROLLER_EXIT_DOWN_ANGLE2#',
       ROLLER_ENTER_SPACE1       = '#ROLLER_ENTER_SPACE1#',
       ROLLER_ENTER_SPACE2       = '#ROLLER_ENTER_SPACE2#',
       ROLLER_MIDDLE_SPACE1      = '#ROLLER_MIDDLE_SPACE1#',
       ROLLER_MIDDLE_SPACE2      = '#ROLLER_MIDDLE_SPACE2#',
       ROLLER_EXIT_SPACE1        = '#ROLLER_EXIT_SPACE1#',
       ROLLER_EXIT_SPACE2        = '#ROLLER_EXIT_SPACE2#',
       MIDDLE_ROLLER_SPACE       = '#MIDDLE_ROLLER_SPACE#',
       MIDDLE_ROLLER_SPACE2      = '#MIDDLE_ROLLER_SPACE2#',
       MAIN_MOTOR_SPEED          = '#MAIN_MOTOR_SPEED#',
       MAIN_MOTOR_SPEED2         = '#MAIN_MOTOR_SPEED2#',
       ROLLING_SPEED             = '#ROLLING_SPEED#',
       ROLLING_SPEED2            = '#ROLLING_SPEED2#',
       ROLLING_SPEED3            = '#ROLLING_SPEED3#',
       IN_MAT_NUM                = '#IN_MAT_NUM#',
       SCRAP_NUM                 = '#SCRAP_NUM#',
       QUALIFIED_NUM             = TO_NUMBER(#QUALIFIED_NUM1#) +
                                   TO_NUMBER(#QUALIFIED_NUM2#) +
                                   TO_NUMBER(#QUALIFIED_NUM3#),
       DEFLECTION                = '#DEFLECTION#',
       DEFLECTION2               = '#DEFLECTION2#',
       DEFLECTION3               = '#DEFLECTION3#',
       ENTRANCE_SPEED            = '#ENTRANCE_SPEED#',
       EXIT_SPEED                = '#EXIT_SPEED#',
       SOOT_BLOWING_TIME         = '#SOOT_BLOWING_TIME#',
       EXECUTIVE_PRODUCER        = '#EXECUTIVE_PRODUCER#',
       PRODUCER_TIME             = SYSDATE,
       PRODUCER_TEL              = '#PRODUCER_TEL#',
       SCRAP_NUM1                = '#SCRAP_NUM1#',
       QUALIFIED_NUM1            = '#QUALIFIED_NUM1#',
       ROLLER_UP_ANGLE11         = '#ROLLER_UP_ANGLE11#',
       ROLLER_UP_ANGLE12         = '#ROLLER_UP_ANGLE12#',
       ROLLER_UP_ANGLE13         = '#ROLLER_UP_ANGLE13#',
       ROLLER_UP_ANGLE14         = '#ROLLER_UP_ANGLE14#',
       ROLLER_UP_ANGLE15         = '#ROLLER_UP_ANGLE15#',
       ROLLER_UP_ANGLE16         = '#ROLLER_UP_ANGLE16#',
       ROLLER_DOWN_ANGLE11       = '#ROLLER_DOWN_ANGLE11#',
       ROLLER_DOWN_ANGLE12       = '#ROLLER_DOWN_ANGLE12#',
       ROLLER_DOWN_ANGLE13       = '#ROLLER_DOWN_ANGLE13#',
       ROLLER_DOWN_ANGLE14       = '#ROLLER_DOWN_ANGLE14#',
       ROLLER_DOWN_ANGLE15       = '#ROLLER_DOWN_ANGLE15#',
       ROLLER_DOWN_ANGLE16       = '#ROLLER_DOWN_ANGLE16#',
       ROLLER_SPACE11            = '#ROLLER_SPACE11#',
       ROLLER_SPACE12            = '#ROLLER_SPACE12#',
       ROLLER_SPACE13            = '#ROLLER_SPACE13#',
       ROLLER_SPACE14            = '#ROLLER_SPACE14#',
       ROLLER_SPACE15            = '#ROLLER_SPACE15#',
       SCRAP_NUM2                = '#SCRAP_NUM2#',
       QUALIFIED_NUM2            = '#QUALIFIED_NUM2#',
       ROLLER_UP_ANGLE21         = '#ROLLER_UP_ANGLE21#',
       ROLLER_UP_ANGLE22         = '#ROLLER_UP_ANGLE22#',
       ROLLER_UP_ANGLE23         = '#ROLLER_UP_ANGLE23#',
       ROLLER_UP_ANGLE24         = '#ROLLER_UP_ANGLE24#',
       ROLLER_UP_ANGLE25         = '#ROLLER_UP_ANGLE25#',
       ROLLER_DOWN_ANGLE21       = '#ROLLER_DOWN_ANGLE21#',
       ROLLER_DOWN_ANGLE22       = '#ROLLER_DOWN_ANGLE22#',
       ROLLER_DOWN_ANGLE23       = '#ROLLER_DOWN_ANGLE23#',
       ROLLER_DOWN_ANGLE24       = '#ROLLER_DOWN_ANGLE24#',
       ROLLER_DOWN_ANGLE25       = '#ROLLER_DOWN_ANGLE25#',
       ROLLER_SPACE21            = '#ROLLER_SPACE21#',
       REMARK                    = '#REMARK#',
       START_TIME                = to_date('#START_TIME#',
                                           'yyyy-mm-dd hh24:mi:ss'),
       QA_TON                    = '#QA_TON#',
       USER_ID                   = '#USER_ID#'
 WHERE JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
        ]]>
        </query>
        <query id="MilStraight.UpdateSTRAIGHTENINGStatuesaveflag" desc="更新结炉后矫直实绩">
        <![CDATA[
        UPDATE MIL_STRAIGHTENING_RESULT
   SET ROLLER_UP_ANGLE26         = '#ROLLER_UP_ANGLE26#',
       ROLLER_DOWN_ANGLE26       = '#ROLLER_DOWN_ANGLE26#',
       ROLLER_UP_ANGLE16         = '#ROLLER_UP_ANGLE16#',
       ROLLER_DOWN_ANGLE16       = '#ROLLER_DOWN_ANGLE16#',
       ROLLER_UP_ANGLE11         = '#ROLLER_UP_ANGLE11#',
       ROLLER_UP_ANGLE12         = '#ROLLER_UP_ANGLE12#',
       ROLLER_UP_ANGLE13         = '#ROLLER_UP_ANGLE13#',
       ROLLER_UP_ANGLE14         = '#ROLLER_UP_ANGLE14#',
       ROLLER_UP_ANGLE15         = '#ROLLER_UP_ANGLE15#',
       ROLLER_DOWN_ANGLE11       = '#ROLLER_DOWN_ANGLE11#',
       ROLLER_DOWN_ANGLE12       = '#ROLLER_DOWN_ANGLE12#',
       ROLLER_DOWN_ANGLE13       = '#ROLLER_DOWN_ANGLE13#',
       ROLLER_DOWN_ANGLE14       = '#ROLLER_DOWN_ANGLE14#',
       ROLLER_DOWN_ANGLE15       = '#ROLLER_DOWN_ANGLE15#',
       ROLLER_SPACE11            = '#ROLLER_SPACE11#',
       ROLLER_SPACE12            = '#ROLLER_SPACE12#',
       ROLLER_SPACE13            = '#ROLLER_SPACE13#',
       ROLLER_SPACE14            = '#ROLLER_SPACE14#',
       ROLLER_SPACE15            = '#ROLLER_SPACE15#',
       ROLLER_UP_ANGLE21         = '#ROLLER_UP_ANGLE21#',
       ROLLER_UP_ANGLE22         = '#ROLLER_UP_ANGLE22#',
       ROLLER_UP_ANGLE23         = '#ROLLER_UP_ANGLE23#',
       ROLLER_UP_ANGLE24         = '#ROLLER_UP_ANGLE24#',
       ROLLER_UP_ANGLE25         = '#ROLLER_UP_ANGLE25#',
       ROLLER_DOWN_ANGLE21       = '#ROLLER_DOWN_ANGLE21#',
       ROLLER_DOWN_ANGLE22       = '#ROLLER_DOWN_ANGLE22#',
       ROLLER_DOWN_ANGLE23       = '#ROLLER_DOWN_ANGLE23#',
       ROLLER_DOWN_ANGLE24       = '#ROLLER_DOWN_ANGLE24#',
       ROLLER_DOWN_ANGLE25       = '#ROLLER_DOWN_ANGLE25#',
       ROLLER_SPACE21            = '#ROLLER_SPACE21#',
       ROLLER_SPACE22            = '#ROLLER_SPACE22#',
       ROLLER_SPACE23            = '#ROLLER_SPACE23#',
       ROLLER_SPACE24            = '#ROLLER_SPACE24#',
       ROLLER_SPACE25            = '#ROLLER_SPACE25#',
       ROLLER_UP_ANGLE31         = '#ROLLER_UP_ANGLE31#',
       ROLLER_UP_ANGLE32         = '#ROLLER_UP_ANGLE32#',
       ROLLER_UP_ANGLE33         = '#ROLLER_UP_ANGLE33#',
       ROLLER_UP_ANGLE34         = '#ROLLER_UP_ANGLE34#',
       ROLLER_UP_ANGLE35         = '#ROLLER_UP_ANGLE35#',
       ROLLER_DOWN_ANGLE31       = '#ROLLER_DOWN_ANGLE31#',
       ROLLER_DOWN_ANGLE32       = '#ROLLER_DOWN_ANGLE32#',
       ROLLER_DOWN_ANGLE33       = '#ROLLER_DOWN_ANGLE33#',
       ROLLER_DOWN_ANGLE34       = '#ROLLER_DOWN_ANGLE34#',
       ROLLER_DOWN_ANGLE35       = '#ROLLER_DOWN_ANGLE35#',
       ROLLER_SPACE31            = '#ROLLER_SPACE31#',
       ROLLER_SPACE32            = '#ROLLER_SPACE32#',
       ROLLER_SPACE33            = '#ROLLER_SPACE33#',
       ROLLER_SPACE34            = '#ROLLER_SPACE34#',
       ROLLER_SPACE35            = '#ROLLER_SPACE35#',
       ROLLER_ENTER_UP_ANGLE1    = '#ROLLER_ENTER_UP_ANGLE1#',
       ROLLER_ENTER_UP_ANGLE2    = '#ROLLER_ENTER_UP_ANGLE2#',
       ROLLER_ENTER_DOWN_ANGLE1  = '#ROLLER_ENTER_DOWN_ANGLE1#',
       ROLLER_ENTER_DOWN_ANGLE2  = '#ROLLER_ENTER_DOWN_ANGLE2#',
       ROLLER_MIDDLE_UP_ANGLE1   = '#ROLLER_MIDDLE_UP_ANGLE1#',
       ROLLER_MIDDLE_UP_ANGLE2   = '#ROLLER_MIDDLE_UP_ANGLE2#',
       ROLLER_MIDDLE_DOWN_ANGLE1 = '#ROLLER_MIDDLE_DOWN_ANGLE1#',
       ROLLER_MIDDLE_DOWN_ANGLE2 = '#ROLLER_MIDDLE_DOWN_ANGLE2#',
       ROLLER_EXIT_UP_ANGLE1     = '#ROLLER_EXIT_UP_ANGLE1#',
       ROLLER_EXIT_UP_ANGLE2     = '#ROLLER_EXIT_UP_ANGLE2#',
       ROLLER_EXIT_DOWN_ANGLE1   = '#ROLLER_EXIT_DOWN_ANGLE1#',
       ROLLER_EXIT_DOWN_ANGLE2   = '#ROLLER_EXIT_DOWN_ANGLE2#',
       ROLLER_ENTER_SPACE1       = '#ROLLER_ENTER_SPACE1#',
       ROLLER_ENTER_SPACE2       = '#ROLLER_ENTER_SPACE2#',
       ROLLER_MIDDLE_SPACE1      = '#ROLLER_MIDDLE_SPACE1#',
       ROLLER_MIDDLE_SPACE2      = '#ROLLER_MIDDLE_SPACE2#',
       ROLLER_EXIT_SPACE1        = '#ROLLER_EXIT_SPACE1#',
       ROLLER_EXIT_SPACE2        = '#ROLLER_EXIT_SPACE2#',
       MIDDLE_ROLLER_SPACE       = '#MIDDLE_ROLLER_SPACE#',
       MIDDLE_ROLLER_SPACE2      = '#MIDDLE_ROLLER_SPACE2#',
       MAIN_MOTOR_SPEED          = '#MAIN_MOTOR_SPEED#',
       MAIN_MOTOR_SPEED2         = '#MAIN_MOTOR_SPEED2#',
       ROLLING_SPEED             = '#ROLLING_SPEED#',
       ROLLING_SPEED2            = '#ROLLING_SPEED2#',
       ROLLING_SPEED3            = '#ROLLING_SPEED3#',
       DEFLECTION                = '#DEFLECTION#',
       DEFLECTION2               = '#DEFLECTION2#',
       DEFLECTION3               = '#DEFLECTION3#',
       ENTRANCE_SPEED            = '#ENTRANCE_SPEED#',
       EXIT_SPEED                = '#EXIT_SPEED#',
       SOOT_BLOWING_TIME         = '#SOOT_BLOWING_TIME#',
       START_TIME                = to_date('#START_TIME#',
                                           'yyyy-mm-dd hh24:mi:ss'),
       EXECUTIVE_PRODUCER        = '#EXECUTIVE_PRODUCER#',
       PRODUCER_TEL              = '#PRODUCER_TEL#',
       REMARK                    = '#REMARK#'
 WHERE JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
        ]]>
        </query>
        <query id="MilStraight.UpdateNodeFurStatue" desc="修改结炉状体及结炉时间">
        update Mil_Straightening_Result
   SET node_fur_flag = '1',
       end_time      = SYSDATE,
       QUALIFIED_NUM = '#QUALIFIED_NUM#',
       IN_MAT_NUM    = '#IN_MAT_NUM#'
 WHERE JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
        </query>
        <query id="MilStraight.UpdateMainStatus" desc="修改主表状态">
        Update mil_plan
   SET NODE_STATUS = '80'
 WHERE JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
        </query>
        <query id="MilStraight.UpdateRackShift" desc="">
        UPDATE MIL_STRAIGH_RACK T
   SET T.COL_USER  = '#COL_USER#',
       T.COL_SHIFT = '#COL_SHIFT#',
       T.COL_GROUP = '#COL_GROUP#'
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(T.PRO_PLAN_ID,'/') = NVL('#PRO_PLAN_ID#','/')
   AND NVL(T.GX_PLAN_NO,'/') = NVL('#GX_PLAN_NO#','/')
   AND T.COL_USER is null
   AND T.COL_SHIFT is null
   AND T.COL_GROUP is null
   AND T.MAT_NO is not null
        </query>
	<query id="MilStraight.UpdateResultShift" desc="">
	UPDATE MIL_STRAIGHTENING_RESULT T
   SET T.COL_SHIFT = '#COL_SHIFT#',
       T.COL_GROUP = '#COL_GROUP#',
       T.COL_USER  = '#COL_USER#'
 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
 AND NVL(T.PRO_PLAN_ID,'/') = NVL('#PRO_PLAN_ID#','/')
   AND NVL(T.GX_PLAN_NO,'/') = NVL('#GX_PLAN_NO#','/')
	</query>
		<query id="MilStraight.AddScrapSlabSeq" desc="新增管号剔除序号表">
        <![CDATA[
       INSERT INTO MIL_SLAB_SCRAP_SEQ
  (JUDGE_STOVE_NO,
   PROCESS_NO,
   SEQ,
   TIME,
   FLAG,
   REMARK,
   COL_MODE,
   COL_TIME,
   COL_USER,
   COL_SHIFT,
   COL_GROUP,
   COL_NO,
   PRO_PLAN_ID,
   GX_PLAN_NO)
VALUES
  ('#JUDGE_STOVE_NO#',
   '#PROCESS_NO#',
   '#SEQ#',
   SYSDATE,
   '#FLAG#',
   '#REMARK#',
   '#COL_MODE#',
   SYSDATE,
   '#COL_USER#',
   '#COL_SHIFT#',
   '#COL_GROUP#',
   '#COL_NO#',
   '#PRO_PLAN_ID#',
   '#GX_PLAN_NO#')
        ]]>
	</query>
			<query id="MilStraight.UpdateFurStatue" desc="加热炉管坯状态">
        <![CDATA[
         UPDATE MIL_STRAIGH_RACK T
   SET T.STATUS       = '1',
       T.SCRAP_TIME   = SYSDATE,
       T.SCRAP_REASON = '#SCRAP_REASON#'
 WHERE seq = '#SEQ#'
   AND JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
        ]]>
	</query>
	
	<query id="MilStraight.UpdateFurScrapNum" desc="修改加热炉实绩表剔除支数">
        <![CDATA[
        UPDATE mil_straightening_result SET 
        SCRAP_NUM = SCRAP_NUM + 1,
        QUALIFIED_NUM=(case nvl(QUALIFIED_NUM,0) WHEN 0 THEN 0 ELSE QUALIFIED_NUM-1 END)
        WHERE 
        JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
        AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
        ]]>
	</query>
	<query id="MilStraight.UpdateFurScrapNum1" desc="修改1‘操作台矫废支数">
	UPDATE mil_straightening_result SET 
        SCRAP_NUM1 = SCRAP_NUM1 + 1,
        QUALIFIED_NUM1=(case nvl(QUALIFIED_NUM1,0) WHEN 0 THEN 0 ELSE QUALIFIED_NUM1-1 END)
        WHERE 
        JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
        AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
	</query>
	<query id="MilStraight.UpdateFurScrapNum2" desc="修改1‘操作台矫废支数">
	UPDATE mil_straightening_result SET 
        SCRAP_NUM2 = SCRAP_NUM2 + 1,
        QUALIFIED_NUM2=(case nvl(QUALIFIED_NUM2,0) WHEN 0 THEN 0 ELSE QUALIFIED_NUM2-1 END)
        WHERE 
        JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
        AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
	</query>
	<query id="MilStraight.UpdateFurScrapNum3" desc="修改3‘操作台矫废支数">
	UPDATE mil_straightening_result SET 
        SCRAP_NUM3 = SCRAP_NUM3 + 1,
        QUALIFIED_NUM3=(case nvl(QUALIFIED_NUM3,0) WHEN 0 THEN 0 ELSE QUALIFIED_NUM3-1 END)
        WHERE 
        JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
        AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/')
	</query>
	
	
	<query id="MilStraight.SingleMilStraightQuery" desc="加热炉实绩">
        <![CDATA[
SELECT CHANGE_NUM,
       ROLLER_UP_ANGLE26,
       ROLLER_DOWN_ANGLE26,
       ROLLER_SPACE22,
       ROLLER_SPACE23,
       ROLLER_SPACE24,
       ROLLER_SPACE25,
       QUALIFIED_NUM3,
       SCRAP_NUM3,
       ROLLER_UP_ANGLE31,
       ROLLER_UP_ANGLE32,
       ROLLER_UP_ANGLE33,
       ROLLER_UP_ANGLE34,
       ROLLER_UP_ANGLE35,
       ROLLER_DOWN_ANGLE31,
       ROLLER_DOWN_ANGLE32,
       ROLLER_DOWN_ANGLE33,
       ROLLER_DOWN_ANGLE34,
       ROLLER_DOWN_ANGLE35,
       ROLLER_SPACE31,
       ROLLER_SPACE32,
       ROLLER_SPACE33,
       ROLLER_SPACE34,
       ROLLER_SPACE35,
       ROLLER_ENTER_UP_ANGLE1,
       ROLLER_ENTER_UP_ANGLE2,
       ROLLER_ENTER_DOWN_ANGLE1,
       ROLLER_ENTER_DOWN_ANGLE2,
       ROLLER_MIDDLE_UP_ANGLE1,
       ROLLER_MIDDLE_UP_ANGLE2,
       ROLLER_MIDDLE_DOWN_ANGLE1,
       ROLLER_MIDDLE_DOWN_ANGLE2,
       ROLLER_EXIT_UP_ANGLE1,
       ROLLER_EXIT_UP_ANGLE2,
       ROLLER_EXIT_DOWN_ANGLE1,
       ROLLER_EXIT_DOWN_ANGLE2,
       ROLLER_ENTER_SPACE1,
       ROLLER_ENTER_SPACE2,
       ROLLER_MIDDLE_SPACE1,
       ROLLER_MIDDLE_SPACE2,
       ROLLER_EXIT_SPACE1,
       ROLLER_EXIT_SPACE2,
       MIDDLE_ROLLER_SPACE,
       MIDDLE_ROLLER_SPACE2,
       MAIN_MOTOR_SPEED,
       MAIN_MOTOR_SPEED2,
       ROLLING_SPEED,
       IN_MAT_NUM,
       SCRAP_NUM,
       QUALIFIED_NUM,
       DEFLECTION,
       ENTRANCE_SPEED,
       EXIT_SPEED,
       SOOT_BLOWING_TIME,
       TO_CHAR(START_TIME, 'YYYY-MM-DD HH24:MI:SS') START_TIME,
       TO_CHAR(END_TIME, 'YYYY-MM-DD HH24:MI:SS') END_TIME,
       EXECUTIVE_PRODUCER,
       TO_CHAR(PRODUCER_TIME, 'YYYY-MM-DD HH24:MI:SS') PRODUCER_TIME,
       PRODUCER_TEL,
       NODE_FUR_FLAG,
       REMARK,
       COL_MODE,
       TO_CHAR(COL_TIME, 'YYYY-MM-DD HH24:MI:SS') COL_TIME,
       COL_USER,
       COL_SHIFT,
       COL_GROUP,
       RESULT_NO,
       LOT_NO,
       STOVE_NO,
       JUDGE_STOVE_NO,
       PLINE_CODE,
       SCRAP_NUM1,
       QUALIFIED_NUM1,
       ROLLER_UP_ANGLE11,
       ROLLER_UP_ANGLE12,
       ROLLER_UP_ANGLE13,
       ROLLER_UP_ANGLE14,
       ROLLER_UP_ANGLE15,
       ROLLER_DOWN_ANGLE11,
       ROLLER_DOWN_ANGLE12,
       ROLLER_DOWN_ANGLE13,
       ROLLER_DOWN_ANGLE14,
       ROLLER_DOWN_ANGLE15,
       ROLLER_SPACE11,
       ROLLER_SPACE12,
       ROLLER_SPACE13,
       ROLLER_SPACE14,
       ROLLER_SPACE15,
       SCRAP_NUM2,
       QUALIFIED_NUM2,
       ROLLER_UP_ANGLE21,
       ROLLER_UP_ANGLE22,
       ROLLER_UP_ANGLE23,
       ROLLER_UP_ANGLE24,
       ROLLER_UP_ANGLE25,
       ROLLER_DOWN_ANGLE21,
       ROLLER_DOWN_ANGLE22,
       ROLLER_DOWN_ANGLE23,
       ROLLER_DOWN_ANGLE24,
       ROLLER_DOWN_ANGLE25,
       ROLLER_SPACE21,
       ROLLER_UP_ANGLE16,
       ROLLER_DOWN_ANGLE16
  FROM MIL_STRAIGHTENING_RESULT
 WHERE JUDGE_STOVE_NO = ?
   AND PRO_PLAN_ID || '&' LIKE '%' || ? || '%'
   AND GX_PLAN_NO || '&' LIKE '%' || ? || '%'
		]]>
	</query>
	<query id="MilStraight.SingleFeedSawResult" desc="判断上一个工序是否结炉">
        <![CDATA[
       SELECT NODE_FUR_FLAG
  FROM mil_saw_result
 WHERE JUDGE_STOVE_NO = ?
   AND PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
        ]]>
	</query>
	<query id="MilStraight.GetStraightResultNodeQuery" desc="结炉实绩查询">
	SELECT 
	RESULT_NO,
	LOT_NO,
	STOVE_NO,
	JUDGE_STOVE_NO,
	PLINE_CODE,
	SCRAP_NUM1,
	QUALIFIED_NUM1,
	SCRAP_NUM2,
	QUALIFIED_NUM2,
	SCRAP_NUM3,
	QUALIFIED_NUM3,
	IN_MAT_NUM,
	SCRAP_NUM,
	QUALIFIED_NUM,
	REMARK,
	COL_USER,
	case COL_SHIFT 
       WHEN '0' THEN '常白班'
       WHEN '1' THEN '早班'
       WHEN '2' THEN '中班'
       WHEN '3' THEN '晚班'
                end as COL_SHIFT,
       case COL_GROUP
       WHEN '1' THEN '甲'
       WHEN '2' THEN '乙'
       WHEN '3' THEN '丙'
       WHEN '4' THEN '丁'
               end as COL_GROUP,
               QA_TON,
               CHANGE_NUM
	FROM Mil_Straightening_Result
	 WHERE
       1=1
       AND PLINE_CODE=?
       AND COL_SHIFT=?
       AND COL_GROUP=?
       AND END_TIME BETWEEN TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') AND TO_DATE(?,'YYYY-MM-DD HH24:MI:SS')
       AND NODE_FUR_FLAG='1'
	</query>
	<query id="MilStraight.Qunum" desc="">
	update Mil_Straightening_Result
   SET QUALIFIED_NUM3 = '#QUALIFIED_NUM3#',
       IN_MAT_NUM     = '#IN_MAT_NUM#',
       QUALIFIED_NUM  = '#QUALIFIED_NUM#',
       QUALIFIED_NUM1 = '#QUALIFIED_NUM1#',
       QUALIFIED_NUM2 = '#QUALIFIED_NUM2#',
       QA_TON         = '#QA_TON#'
 WHERE JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
   AND NVL(PRO_PLAN_ID, '/') = NVL('#PRO_PLAN_ID#', '/')
   AND NVL(GX_PLAN_NO, '/') = NVL('#GX_PLAN_NO#', '/') 
	</query>
	<query id = "FrmStraighteningResult.doQueryOffline" desc = "查询探伤是否有下线">
	<![CDATA[
    SELECT T.JUDGE_STOVE_NO
  FROM MIL_OFFLINE_RESLUT T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO || '&' LIKE '%' || ? || '%'
   AND T.OFFLINE_PRO = 'TS'
   ]]>
	</query>
	<query id = "updateProcessL.selectScrap" desc = "查询剔除管子信息">
	<![CDATA[
	SELECT T.PROCESS_NO,
       T.SEQ,
       T.JUDGE_STOVE_NO,
       T.COL_TYPE,
       T.OFFLINE_TYPE,
       T.MAT_NO
  FROM MIL_SLAB_SCRAP_SEQ T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PROCESS_NO = ?
   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
 order by t.col_type asc
 ]]>
	</query>
	<query id = "updateProcessL.selectSample" desc = "查询留样管信息">
	<![CDATA[
	SELECT T.SEQ, T.JUDGE_STOVE_NO, T.PRO_PLAN_ID, T.GX_PLAN_NO
  FROM MIL_TESTING_RACK T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
   AND T.SAMPLE_FLAG = '1'
   ]]>
	</query>
	<query id = "updateProcessL.selectCutLength" desc = "查询子管再切长度">
	<![CDATA[
	SELECT T.SEQ, T.RECUT_LENGTH, T.JUDGE_STOVE_NO, T.PRO_PLAN_ID, T.GX_PLAN_NO
  FROM MIL_TESTING_RACK T
 WHERE T.RECUT_LENGTH IS NOT NULL
   AND T.RECUT_FLAG = '1'
   AND T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
   ]]>
	</query>
	<query id = "updateProcessL.UpdateFlag" desc = "结炉写进程表">
	DECLARE
  V_ROLLING_STATUS MIL_PLAN.ROLLING_STATUS%TYPE := NULL;
BEGIN
  IF (#COL_TYPE# = 1) THEN
      IF (#OFFLINE_TYPE# = 1) THEN
        UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
           SET T.STATUS       = '3',
               T.OP_PROCESS   = '#OP_PROCESS#',
               T.Offline_Type = '1'
         WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
           AND T.MAT_NO = '#MAT_NO#';
      ELSIF (#OFFLINE_TYPE# = 2) THEN
        UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
           SET T.STATUS       = '3',
               T.OP_PROCESS   = '#OP_PROCESS#',
               T.Offline_Type = '2'
         WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
           AND T.MAT_NO = '#MAT_NO#';
      ELSE
        UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
           SET T.STATUS       = '3',
               T.OP_PROCESS   = '#OP_PROCESS#',
               T.Offline_Type = '0'
         WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
           AND T.MAT_NO = '#MAT_NO#';
      END IF;
  ELSE
      UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
         SET T.STATUS = '2', T.OP_PROCESS = '#OP_PROCESS#'
       WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
         AND T.MAT_NO = '#MAT_NO#';
  END IF;
END;
	</query>
	<!-- T.IS_SAMPLE_PIPE,T.IS_SAMPLE_PIPE, -->
	<query id = "updateProcessSam.UpdateFlag" desc = "写留样管信息进进程表">
	DECLARE
BEGIN
  FOR MYROW IN (SELECT MAT_NO
                  FROM (SELECT ROWNUM SEQ, MAT_NO
                          FROM (SELECT T.MAT_NO
                                  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
                                 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                                   AND NVL(T.PRO_PLAN_ID,'/') = NVL('#PRO_PLAN_ID#','/')
                                   AND NVL(T.GX_PLAN_NO,'/') = NVL('#GX_PLAN_NO#','/')
                                   AND (T.OP_PROCESS IS NULL OR
                                       T.OP_PROCESS = '#OP_PROCESS#')
                                   AND T.INSTORE_FLAG = '0'
                                   AND T.STATUS = '0'
                                 ORDER BY T.IS_SAMPLE_PIPE, T.MAT_NO ASC))
                --WHERE SEQ = '#SEQ#'
                 WHERE ROWNUM = 1) LOOP
    UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
       SET T.STATUS = '5', T.OP_PROCESS = '#OP_PROCESS#'
     WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
       AND NVL(T.PRO_PLAN_ID,'/') = NVL('#PRO_PLAN_ID#','/')
       AND NVL(T.GX_PLAN_NO,'/') = NVL('#GX_PLAN_NO#','/')
       AND T.MAT_NO = MYROW.MAT_NO;
  END LOOP;
END;
	</query>
	<!--
	FOR MYROW IN (SELECT MAT_NO FROM (SELECT ROWNUM SEQ,MAT_NO FROM (SELECT T.MAT_NO
                  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
                 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                 AND (T.OP_PROCESS IS NULL OR T.OP_PROCESS = '#OP_PROCESS#')
                 AND T.IS_SAMPLE_PIPE = '0'
                 AND T.INSTORE_FLAG = '0'
                 GROUP BY T.MAT_NO ORDER BY T.MAT_NO ASC)) WHERE SEQ = '#SEQ#') LOOP
  UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T SET T.STATUS = '5',T.OP_PROCESS = '#OP_PROCESS#' WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#' AND T.MAT_NO = MYROW.MAT_NO;
 END LOOP; 
	 -->
	<query id = "updateProcessCutLength.UpdateFlag" desc = "写再切长度信息进进程表">
	DECLARE
BEGIN
  FOR MYROW IN (SELECT MAT_NO
                  FROM (SELECT ROWNUM SEQ, MAT_NO
                          FROM (SELECT T.MAT_NO
                                  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
                                 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                                   AND NVL(T.PRO_PLAN_ID,'/') = NVL('#PRO_PLAN_ID#','/')
                                   AND NVL(T.GX_PLAN_NO,'/') = NVL('#GX_PLAN_NO#','/')
                                   AND (T.OP_PROCESS IS NULL OR
                                       T.OP_PROCESS = '#OP_PROCESS#')
                                   AND T.INSTORE_FLAG = '0'
                                   AND T.STATUS = '0'
                                 ORDER BY T.IS_SAMPLE_PIPE, T.MAT_NO ASC))
                --WHERE SEQ = '#SEQ#'
                 WHERE ROWNUM = 1) LOOP
    UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
       SET T.RECUT_LENGTH          = '#RECUT_LENGTH#',
           T.CUT_ACT_THEORY_WEIGHT =
           (T.ACT_THEORY_WEIGHT / T.ORDER_LENGTH) *
           TO_NUMBER('#RECUT_LENGTH#')
     WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
       AND NVL(T.PRO_PLAN_ID,'/') = NVL('#PRO_PLAN_ID#','/')
       AND NVL(T.GX_PLAN_NO,'/') = NVL('#GX_PLAN_NO#','/')
       AND T.MAT_NO = MYROW.MAT_NO;
  END LOOP;
END;
	</query>
	<!-- SELECT MAT_NO FROM (SELECT ROWNUM SEQ,MAT_NO FROM (SELECT T.MAT_NO
                  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
                 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                 AND (T.OP_PROCESS IS NULL OR T.OP_PROCESS = '#OP_PROCESS#')
                 AND T.IS_SAMPLE_PIPE = '0'
                 AND T.INSTORE_FLAG = '0'
                 GROUP BY T.MAT_NO ORDER BY T.MAT_NO ASC)) WHERE SEQ = '#SEQ#' -->
	<query id = "FrmStraighteningResult.assignmentMatNo" desc = "复制材料号">
	<![CDATA[
	DECLARE
  CURSOR OPOrder_Cursor IS
    SELECT ROWNUM SEQ, MAT_NO, Order_Length
      from (SELECT T.SEQ, T.MAT_NO, Order_Length
              FROM PORT_MIL_BATCH_SAMPLE_RESULT T
             WHERE T.JUDGE_STOVE_NO = ?
               AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
               AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
               AND (T.STATUS = '0' OR T.STATUS = '3' AND T.OP_PROCESS = '12')
             ORDER BY T.BATCH_NO DESC, T.IS_SAMPLE_PIPE, T.SEQ ASC);
  curOPOrder OPOrder_Cursor%RowType;
BEGIN
  open OPOrder_Cursor;
  LOOP
    fetch OPOrder_Cursor
      into curOPOrder;
    EXIT WHEN OPOrder_Cursor%NOTFOUND;
    UPDATE MIL_TESTING_RACK T
       SET T.MAT_NO      = curOPOrder.MAT_NO,
           T.PIPE_LENGTH = curOPOrder.Order_Length
     WHERE T.JUDGE_STOVE_NO = ?
       AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
       AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
       AND T.SEQ = curOPOrder.SEQ;
  END LOOP;
  close OPOrder_Cursor;
END;
]]>
	</query>
	<query id = "FrmStraighteningResult.insertScrapSlab" desc = "插入废管子表">
	<![CDATA[
	DECLARE
  CURSOR OPOrder_Cursor IS
    SELECT ROWNUM SEQ, MAT_NO, PIPE_LENGTH, JUDGE_STOVE_NO
      from (SELECT T.SEQ, T.MAT_NO, T.PIPE_LENGTH, T.JUDGE_STOVE_NO
              FROM MIL_STRAIGH_RACK T
             WHERE T.JUDGE_STOVE_NO = ?
               AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
               AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
               AND T.STATUS = '1'
             ORDER BY T.SEQ ASC);
  curOPOrder OPOrder_Cursor%RowType;
BEGIN
  open OPOrder_Cursor;
  LOOP
    fetch OPOrder_Cursor
      into curOPOrder;
    EXIT WHEN OPOrder_Cursor%NOTFOUND;
    insert into mil_slab_scrap
      (judge_stove_no,
       process_no,
       mat_no,
       pline_code,
       PRO_PLAN_ID,
       GX_PLAN_NO)
    values
      (curOPOrder.JUDGE_STOVE_NO, '9', curOPOrder.MAT_NO, ?, ?, ?);
  END LOOP;
  close OPOrder_Cursor;
END;
]]>
	</query>
	<query id = "FrmStraighteningResult.getSingePlanFlag" desc = "查询计划标识">
	<![CDATA[
	SELECT T.BACK_PLAN_FLAG, T.BRANCH
  FROM MIL_PLAN T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO || '&' LIKE '%' || ? || '%'
   ]]>
	</query>
	<query id = "updateProcessL.SelectPortBacthSampleNum" desc = "查询进程表合格支数">
	<![CDATA[
	SELECT NVL(SUM(T.ACT_COUNT), 0) ACTCOUNT
  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
   AND T.STATUS = '0'
   --AND T.INSTORE_FLAG = '0'
   ]]>
	</query>
	
	<query id = "updateProcessL.SelectQualifNum" desc = "已交库支数">
	<![CDATA[
	SELECT T.*
  FROM MIL_INSTORE_RESULT T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO || '&' LIKE '%' || ? || '%'
   ]]>
	</query>
	<query id = "FrmStraighteningResult.updateMilSlab" desc = "结炉赋值给剔废表">
	<![CDATA[
	DECLARE
BEGIN
  FOR MYROW IN (SELECT T.SEQ,
                       T.MAT_NO,
                       T.JUDGE_STOVE_NO,
                       T.PRO_PLAN_ID,
                       T.GX_PLAN_NO
                  FROM #RACK# T
                 WHERE T.JUDGE_STOVE_NO = ?
                   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
                   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
                   AND (T.STATUS = '1' OR T.OFFLINE_FLAG = '1')
                 ORDER BY T.SEQ) LOOP
    UPDATE MIL_SLAB_SCRAP_SEQ T
       SET T.MAT_NO = MYROW.MAT_NO
     WHERE T.JUDGE_STOVE_NO = MYROW.JUDGE_STOVE_NO
       AND NVL(T.PRO_PLAN_ID,'/') = NVL(MYROW.PRO_PLAN_ID,'/')
       AND NVL(T.GX_PLAN_NO,'/') = NVL(MYROW.GX_PLAN_NO,'/')
       AND T.SEQ = MYROW.SEQ
       AND T.PROCESS_NO = ?;
  END LOOP;
END;
]]>
	</query>
	<query id = "FrmStraighteningResult.updateRackMatNo" desc = "结炉时判断该材料号是否已交库">
	
	</query>
	<query id = "updateMilSlab.SelectRack" desc = "查询Rack表中异常支数">
	<![CDATA[
	SELECT NVL(COUNT(1), 0) ACOUNT
  FROM #RACK# T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
   AND (T.STATUS = '1' OR T.OFFLINE_FLAG = '1')
   ]]>
	</query>
	<query id = "updateMilSlab.SelectProcess" desc = "查询进程表未交库合格支数">
	<![CDATA[
	SELECT NVL(COUNT(1), 0) ACOUNT
  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
   AND T.STATUS = '0'
   AND T.INSTORE_FLAG = '0'
   ]]>
	</query>
	<query id = "FrmStraighteningResult.updatePorcessOcupStaus" desc = "剔废时占用进程表">
	<![CDATA[
	DECLARE
BEGIN
  FOR MYROW IN (SELECT * FROM (SELECT T.MAT_NO,T.JUDGE_STOVE_NO
                  FROM PORT_MIL_BATCH_SAMPLE_RESULT T
                 WHERE T.JUDGE_STOVE_NO = '#JUDGE_STOVE_NO#'
                 ORDER BY T.IS_SAMPLE_PIPE, T.MAT_NO ASC) WHERE ROWNUM <=1) LOOP
    UPDATE PORT_MIL_BATCH_SAMPLE_RESULT T
       SET T.OCUP_STAUS = '1',T.OCUP_OP_PROCESS = '9'
     WHERE T.JUDGE_STOVE_NO = MYROW.JUDGE_STOVE_NO
       AND T.MAT_NO = MYROW.MAT_NO;
  END LOOP;
END;
]]>
	</query>
	
	<query id = "FrmStraighteningResult.doQueryStraighteningOfflineBack" desc = "查询矫直离线数据是否返线">
	<![CDATA[
	SELECT T.JUDGE_STOVE_NO, T.BACKLINE_NUM + T.GROUP_NUM BACKLINE_NUM
  FROM MIL_OFFLINE_RESLUT T
 WHERE T.JUDGE_STOVE_NO = ?
   AND T.PRO_PLAN_ID  || '&' LIKE '%' || ? || '%'
   AND T.GX_PLAN_NO  || '&' LIKE '%' || ? || '%'
   AND T.OFFLINE_PRO = 'JZ'
   AND T.BACKLINE_NUM + T.GROUP_NUM > 0
	]]>
	</query>
</queryMap>