<?xml version="1.0" encoding="UTF-8"?>

<queryMap  desc = "技术要求差异">

	<query id = "CoreOrdDesignResultDiff.Query" desc = "查询">
	<![CDATA[
	
		SELECT T1.ORDER_NO,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORDER_SEQ,
       T.PSC,
       T.PSC_DESC,
       T.MSC,
       T.MSC_DESC,
       T.MSC_STYLE,
       T.USE_CODE,
       T.USE_DESC,
       (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.PRD_CLS) PRD_CLS,
       T.PRODUCCODE,
       T.PRODUCNAME,
       T.STD_CODE,
       T.STD_NAME,
       T.STEELCODE,
       T.STEELNAME,
       T.STD_STYLE,
       T.STD_STYLE_DESC,
       T.ORDER_SPEC_CODE,
       T.ORDER_SPEC_DESC,
       T.SPEC_CODE,
       T.SPEC_NAME,
       T.DIMATER,
       T.HEIGHT,
       T.MODEL_CODE,
       T.MODEL_DESC,
       T.LEN_NO,
       T.LEN_DESC,
       T.LEN_UNIT,
       T.LEN_MIN,
       T.LEN_MAX,
       T.SHRT_LEN_RATO,
       T.SHORTEST,
       T.LONG_LEN_RATO,
       T.LONGEST,
       T.SHRT_STOVE,
       T.AVG_LEN_MIN,
       T.DIFRNC_LEN_MAX,
       T.ENDLEN_SPECSTD,
       T.SIGL_LEN,
       T.ORDER_UNIT,
       T.ORDER_QTY,
       T.ORD_ENSU_TOTL_LEN,
       T.PRDCT_WGT,
       '(-' || TO_CHAR(T.DELVRY_RANGE_MIN) ||
                DECODE(T.DELVRY_RANGE_TPE, '%', '%', '') || ',' ||
                TO_CHAR(T.DELVRY_RANGE_MAX) ||
                DECODE(T.DELVRY_RANGE_TPE, '%', '%', '') || ')' DELVRY_RANGE_TPE,
       T.DELVRY_RANGE_MIN,
       T.DELVRY_RANGE_MAX,
       T.FINAL_USER,
       T.FINAL_USER_DESC,
       (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.OUTS_BILLET_FL) OUTS_BILLET_FL,
       (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.OUTS_STL_PIPE_FL) OUTS_STL_PIPE_FL,
       DECODE(T.ASSEL_FL,'1','是','否') ASSEL_FL,
       T.DELVRY_DESC,
       T.ORDER_ADD_DESC,
       T.ORDER_SPECIAL_DESC,
       T.TRANS_PRICE,
       T.OUT_PRICE,
       T.BALNCE_PRICE,
       (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.ORDER_LN_STATUS) ORDER_LN_STATUS,
       T.CREATE_NAME,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       DECODE(T.BALNCE_PRICE_STS,'1','确认','未确认') BALNCE_PRICE_STS,
       T.PAK_PRICE,
       T.AW,
       DECODE(T.MAN_INSPECTION,'1','可手探','不可手探') MAN_INSPECTION,
       (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.QUALITY_USER) QUALITY_USER_DESC,
       (SELECT BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.OUTPUT_STD_NO) OUTPUT_STD_NO ,
       T.PROJECT_NO
  FROM SLM_ORDER_LINE T, SLM_ORDER_HEAD T1
 WHERE T.ORD_PK = T1.ORD_PK
   AND T1.VALIDFLAG = '1'
   AND T.VALIDFLAG = '1'
   AND T1.ORDER_NO LIKE '%' || ? || '%'
   AND T.CREATE_NAME IS NOT NULL
   AND T1.CREATE_NAME IS NOT NULL
   AND T1.ORDER_TYP IN ('120101', '120103', '120106','120108')
   AND T.ORDER_LN_STATUS >='12020201'	

	]]>
	
	</query>
	
	<query id="CoreOrdDesignResultDiff.QueryCic" desc="查询交货行变更表 ">
		<![CDATA[
		
	 	 SELECT T.DESIGN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ITEM_NAME,
       T.STDMIN_SIGN,
       T.STDMIN,
       T.STDMAX_SIGN,
       T.STDMAX,
       T.STDMIN_SIGN1,
       T.ITEM_CODE,
       T.STDMIN1,
       T.STDMAX_SIGN1,
       T.STDMAX1,
       ROUND(T.DIFFERENT_VALUE_MAX,4) DIFFERENT_VALUE_MAX,
       T.CIC,
       T.CIC1,
       ROUND(T.DIFFERENT_VALUE_MIN,4) DIFFERENT_VALUE_MIN
  FROM SLM_ORD_DESIGN_CIC_DIFF T
  WHERE T.ORD_LN_PK = ?
        AND T.DIFF_FLAG = '1'
    
	 	]]>
	</query>
	
	<query id="CoreOrdDesignResultDiff.QueryPic" desc="查询交货行变更表 ">
		<![CDATA[
		
	 	 SELECT 
       T.DESIGN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ITEM_NAME,
       T.STDMIN_SIGN,
       T.STDMIN,
       T.STDMAX_SIGN,
       T.STDMAX,
       T.STDMIN_SIGN1,
       T.ITEM_CODE,
       T.STDMIN1,
       T.STDMAX_SIGN1,
       T.STDMAX1,
       ROUND(T.DIFFERENT_VALUE_MAX,4) DIFFERENT_VALUE_MAX,
       T.PIC,
       T.PIC1,
       ROUND(T.DIFFERENT_VALUE_MIN,4) DIFFERENT_VALUE_MIN
 FROM SLM_ORD_DESIGN_PIC_DIFF T
 WHERE T.ORD_LN_PK = ?
       AND T.DIFF_FLAG = '1'
    
	 	]]>
	</query>
	
	<query id ="CoreOrdDesignResultDiff.QueryWic" desc = "查询水压">
	
	<![CDATA[
	
	 SELECT 
       T.DESIGN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.WIC,
       T.WIC1,
       T.PRESSURE_Y,
       T.PRESSURE,
       T.FORMULA,
       T.SAVE_TIME,
       T.MAX_PRESS,
       T.PRESSURE_Y1,
       T.PRESSURE1,
       T.FORMULA1,
       T.SAVE_TIME1,
       T.MAX_PRESS1,
       T.DIFF_VALUE
 FROM SLM_ORD_DESIGN_WIC_DIFF T
 WHERE  T.ORD_LN_PK  =  ?
        AND T.DIFF_FLAG = '1'
	
	]]>
	</query>
	
	<query id ="CoreOrdDesignResultDiff.QueryDic" desc = "探伤">
	<![CDATA[
	
	 SELECT 
       T.DESIGN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.DIC,
       T.DIC1,
       T.PHY_CODE,
       T.PHY_NAME,
       T.POSITION_CODE,
       T.POSITION_DESC,
       T.STD_DESC,
       T.LV_CODE,
       T.LV_DESC,
       T.GROOVE_POS,
       T.GROOVE_DIR,
       T.COVERAGE,
       T.RATE,
       T.DESC_RATE,
       T.DESC_VAL,
       T.POSITION_CODE1,
       T.POSITION_DESC1,
       T.STD_DESC1,
       T.LV_CODE1,
       T.LV_DESC1,
       T.GROOVE_POS1,
       T.GROOVE_DIR1,
       T.COVERAGE1,
       T.RATE1,
       T.DESC_RATE1,
       T.DESC_VAL1
 FROM SLM_ORD_DESIGN_DIC_DIFF T
 WHERE  T.ORD_LN_PK  =  ?
       AND T.DIFF_FLAG = '1'
	
	]]>
	</query>
	
	<query id ="CoreOrdDesignResultDiff.QuerySic" desc = "公差">
	<![CDATA[
	
	 SELECT 
       T.DESIGN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.SIC,
       T.SIC1,
       T.PHY_CODE,
       T.PHY_NAME,
       T.STD_MIN_VAL,
       T.STD_MAX_VAL,
       T.STD_MIN_PERCENT,
       T.STD_MAX_PERCENT,
       T.STD_MIN_FORMULA,
       T.STD_MAX_FORMULA,
       T.STD_MIN_VAL1,
       T.STD_MAX_VAL1,
       T.STD_MIN_PERCENT1,
       T.STD_MAX_PERCENT1,
       T.STD_MIN_FORMULA1,
       T.STD_MAX_FORMULA1,
       T.DIFF_VALUE_MIN,
       T.DIFF_VALUE_MAX
 FROM SLM_ORD_DESIGN_SIC_DIFF T
 WHERE T.ORD_LN_PK  =  ?
      AND T.DIFF_FLAG = '1'
	
	]]>
	</query>
	
	<query id ="CoreOrdDesignResultDiff.QueryGic" desc = "加工">
	<![CDATA[
	
	 SELECT 
       T.DESIGN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.PROCESS_CODE,
       T.PROCESS_NAME,
       T.STATION_CODE,
       T.STATION_NAME,
       T.VALUE_TEXT,
       T.VALUE_NUM,
       T.VALUE_TEXT1,
       T.VALUE_NUM1,
       T.GIC,
       T.GIC1
 FROM SLM_ORD_DESIGN_GIC_DIFF T
 WHERE T.ORD_LN_PK  =  ?
       AND DIFF_FLAG = '1'
	
	]]>
	</query>
	
	<query id ="CoreOrdDesignResultDiff.QueryAsk" desc = "加工">
	<![CDATA[
	
	 SELECT 
       T.DESIGN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ADD_ASK_NO,
       T.ASK_ITME,
       T.ASK_ITME_DESC,
       T.ASK_SUB_ITME,
       T.ASK_SUB_ITME_DESC,
       T.ASK_SUB_ITME_VAL,
       T.ASK_SUB_ITME_VAL_DESC,
       DECODE(T.DIFF_FLAG,'1','无','0','有','') DIFF_FLAG,
       T.STD_CODE,
       T.STD_NAME,
       T.ASK_SUB_ITME_VAL1,
       T.ASK_SUB_ITME_VAL_DESC1
 FROM SLM_ORD_DESIGN_ADD_ASK_DIFF T
 WHERE T.ORD_LN_PK  =  ?
      AND T.DIFF_FLAG = '1'
	 
	
	]]>
	</query>


</queryMap>