<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="合同综合信息">
	<query id="CoreOrderCraftInfo.getOrderHeadInfo" desc="查询合同头信息">
		<![CDATA[
		SELECT T.ORD_PK,
       T.MANAG_NO,
       T.ORDER_NO,
       T.CUSTM_ORDER_NO,
       T.REVW_RPT_NO,
       T.ORDER_TYP,
       T.ORDER_TYP_DESC,
       T.PROTCL_NO,
       T.CUSTOMER_NO,
       T.CUSTOMER_NM,
       T.MARKET_SYS,
       T.MARKET_SYS_DESC,
       T.ABRVITION,
       (SELECT A.BASENAME
          FROM COM_BASE_INFO A
         WHERE A.BASECODE = T.SUPPLY_UNIT) SUPPLY_UNIT,
       (SELECT A.BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.PRICE_FL) PRICE_FL,
       (SELECT A.BASENAME FROM COM_BASE_INFO A WHERE A.BASECODE = T.CURRENCY) CURRENCY,
       (SELECT A.BASENAME
          FROM COM_BASE_INFO A
         WHERE A.BASECODE = T.MNY_ASK_TYP) MNY_ASK_TYP,
       T.STLMT_UNIT_NO,
       T.STLMT_UNIT_NM,
       (SELECT A.BASENAME
          FROM COM_BASE_INFO A
         WHERE A.BASECODE = T.FST_DRAWEE_UNIT) FST_DRAWEE_UNIT,
       T.LEGAL_PSN,
       T.AGENT,
       T.ADDRESS,
       T.ZIP_CODE,
       T.BANK,
       T.ACCOUNT,
       T.TAX_ID,
       T.PHONE,
       T.FAX,
       T.ORDER_WGT,
       T.ORDER_MNY_TAX,
       T.ORDER_MNY_NTAX,
       T.MNY_ASK_DESC,
       T.SIGN_PERSON,
       TO_CHAR(T.SIGN_DATE, 'YYYY-MM-DD') SIGN_DATE,
       T.SIGN_ADDRESS,
       T.ORDER_YEAR,
       T.ORDER_BDATE,
       T.ORDER_EDATE,
       T.ORDER_SCAN_NO,
       DECODE(T.CUSTOMER_MODEL_FL,'1','True','False') CUSTOMER_MODEL_FL,
       T.ORDER_MODEL_NO,
       T.ORDER_MODEL_DESC,
       T.SALE_ORG,
       T.SALE_ORG_DESC,
       T.SALE_AREA_NO,
       T.SALE_AREA_DESC,
       T.MEMO,
       T.BE_ORDER_STS,
       T.ORDER_STS,
       T.ORDER_STS_DESC,
       T.OBJ_STS_OP,
       T.APPROVAL_MAN,
       TO_CHAR(T.APPROVAL_TIME, 'YYYY-MM-DD HH24:MI:SS') APPROVAL_TIME,
       T.EFFECT_MAN,
       TO_CHAR(T.EFFECT_TIME, 'YYYY-MM-DD HH24:MI:SS') EFFECT_TIME,
       T.CLOSE_MAN,
       TO_CHAR(T.CLOSE_TIME, 'YYYY-MM-DD HH24:MI:SS') CLOSE_TIME,
       T.VALIDFLAG,
       T.CREATE_NAME,
       T.CREATE_DEPT,
       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       T.UPDATE_NAME,
       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       T.DELETE_NAME,
       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       T.ORD_PK_OLD,
       T.BE_ORDER_STS_DESC,
       T.PRICE_NO
  FROM SLM_ORDER_HEAD T
 WHERE UPPER(T.ORDER_NO) || '&' LIKE UPPER('%' || ? || '%')
   AND T.CREATE_TIME BETWEEN
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS') AND
       TO_DATE(?, 'YYYY-MM-DD HH24:MI:SS')
   AND T.VALIDFLAG = '1'
   AND T.ORDER_STS IN ('12020301','12020302','12020401','12020402')
   ORDER BY T.SALE_AREA_DESC,T.SALE_ORG_DESC,T.ORDER_NO,T.CREATE_NAME,T.CREATE_TIME
		]]>
	</query>

	<query id="CoreOrderCraftInfo.getOrderLineInfo" desc="查询合同行信息">
		<![CDATA[
		SELECT T.ORD_PK,
		       T.ORD_LN_PK,
		       T.ORDER_NO,
		       T.ORDER_SEQ,
		       T.CUST_ALPHA_NO,
		       T.PSC,
		       T.PSC_DESC,
		       T.MSC,
		       T.MSC_DESC,
		       DECODE(T.MSC_STYLE,
		              'A',
		              '钢管(坯)',
		              'B',
		              '套管+接箍',
		              'C',
		              '附件短节',
		              'D',
		              '接箍',
		              'E',
		              '双公短节',
		              '数据异常') MSC_STYLE,
		       T.USE_CODE,
		       T.USE_DESC,
		       T.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,
		       TO_CHAR(T.SIGL_LEN,'9990.990') SIGL_LEN,
		       T.ORDER_UNIT,
		       TO_CHAR(T.ORDER_QTY,'99999990.0') ORDER_QTY,
		       TO_CHAR(T.ORD_ENSU_TOTL_LEN,'99999990.0') ORD_ENSU_TOTL_LEN,
		       TO_CHAR(T.PRDCT_WGT,'99999990.990') PRDCT_WGT,
		       DECODE(T.DELVRY_RANGE_TPE,'%','-'||T.DELVRY_RANGE_MIN||'%'||',+'||T.DELVRY_RANGE_MAX||'%', '('|| T.DELVRY_RANGE_MIN||','||T.DELVRY_RANGE_MAX||')') DELVRY_RANGE_TPE,
		       T.DELVRY_RANGE_MIN,
		       T.DELVRY_RANGE_MAX,
		       T.FINAL_USER,
		       T.FINAL_USER_DESC,
		       (SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=T.OUTS_BILLET_FL) OUTS_BILLET_FL,
		       (SELECT T1.BASENAME FROM COM_BASE_INFO T1 WHERE T1.BASECODE=T.OUTS_STL_PIPE_FL) OUTS_STL_PIPE_FL,
		       DECODE(T.ASSEL_FL,'1','True','False') ASSEL_FL,
		       DECODE(T.PRODUCER_FL,'1','True','False') PRODUCER_FL,
		       T.PRDCR_NO,
		       (SELECT C.BASENAME FROM SLM_ORDER_LINE_PRDCR F,COM_BASE_INFO C WHERE C.BASECODE=F.PRDCR_DESC AND F.PRDCR_NO=T.PRDCR_NO) PRDCR_DESC,
		       DECODE(T.MPS_FL,'1','True','False') MPS_FL,
		       T.MPS_NO,
		       T.MPS_DESC,
		       T.DELVRY_BDATE,
		       T.DELVRY_EDATE,
		       T.DELVRY_DESC,
		       T.TRANS_DESC,
		       T.ADD_ASK_NO,
		       T.ORDER_ADD_DESC,
		       T.ORDER_SPECIAL_FL,
		       T.ORDER_SPECIAL_HEAD,
		       T.ORDER_SPECIAL_PATH,
		       T.ORDER_SPECIAL_DESC,
		       T.ZBS,
		       T.ORDER_PRICE,
		       T.TRANS_PRICE,
		       T.TEST_ID,
		       T.TEST_PRICE,
		       T.OUT_PRICE,
		       T.BALNCE_PRICE,
		       (SELECT T1.BASENAME
		          FROM COM_BASE_INFO T1
		         WHERE T1.BASECODE = T.BE_ORDER_LN_STATUS) BE_ORDER_LN_STATUS,
		       T.BE_OBJ_STS_OP,
		        (SELECT T1.BASENAME
		          FROM COM_BASE_INFO T1
		         WHERE T1.BASECODE = T.ORDER_LN_STATUS) ORDER_LN_STATUS,
		       T.OBJ_STS_OP,
		       T.MEMO,
		       DECODE(T.VALIDFLAG,'1','有效','0','无效') VALIDFLAG,
		       T.CREATE_NAME,
		       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH:MI:SS') CREATE_TIME,
		       T.UPDATE_NAME,
		       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH:MI:SS') UPDATE_TIME,
		       T.DELETE_NAME,
		       TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH:MI:SS') DELETE_TIME,
		       T.ORD_LN_PK_OLD,
		       (T1.ORDER_NO || '/' || T1.ORDER_SEQ) ORDERLINE
		   FROM (SELECT A.*, B.ORDER_NO
		          FROM SLM_ORDER_LINE A, SLM_ORDER_HEAD B
		         WHERE A.ORD_PK = B.ORD_PK
		           AND A.VALIDFLAG = '1') T,
		       PLN_ORD_CRAFT_FILE T1
		     WHERE T.ORDER_NO = T1.ORDER_NO 
		       AND T.ORDER_SEQ = T1.ORDER_SEQ
		 AND T1.CRAFT_FILE_NO LIKE '%'|| ? ||'%'
		 AND (T1.ORDER_NO||'/'||T1.ORDER_SEQ) LIKE '%'|| ? ||'%'
		   AND TO_DATE(TO_CHAR(T1.CRAFT_FILE_UPTIME, 'YYYY-MM-DD'), 'YYYY-MM-DD') BETWEEN
		       TO_DATE(?, 'YYYY-MM-DD') AND TO_DATE(?, 'YYYY-MM-DD')
		     ORDER BY ORDER_SEQ
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getCraftfileInfo" desc="查询工艺文件信息">
		<![CDATA[
			SELECT CRAFT_FILE_NO,
			       CRAFT_FILE_MAN,
			       ORDER_NO,
			       ORDER_SEQ,
			       (ORDER_NO || '/' || ORDER_SEQ) ORDERLINE,
			       VERSION_NO,
			       VERSION_DESC,
			       PRODUC_JX,
			       STD_LG_NO,
			       STD_ZG_NO,
			       STD_GJG_NO,
			       STEELCODE,
			       STEELNAME,
			       GRADECODE,
			       OUTDIAMETER,
			       WALLTHICK,
			       MODEL_CODE,
			       MODEL_DESC,
			       BJ_TYPE,
			       S_DIV_D,
			       HEIGHT_NK_MIN,
			       HEIGHT_NK_MAX,
			       LENGTH_EXTENT,
			       CRAFT_PATH,
			       RCL_INFO,
			       PAYDOWN_DPT,
			       MONITOR_INFO,
			       HOLE_MODAL_INFO,
			       CRAFT_FILE_TYPE_CODE,
			       CRAFT_FILE_TYPE_NM,
			       CRAFT_FILE_PATH,
			       CRAFT_FILE_FLAG_CODE,
			       CRAFT_FILE_FLAG_NM,
			       TO_CHAR(T.CRAFT_FILE_UPTIME, 'YYYY-MM-DD HH:MI:SS') CRAFT_FILE_UPTIME,
			       CREATE_NAME,
			       TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH:MI:SS') CREATE_TIME,
			       UPDATE_NAME,
			       TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH:MI:SS') UPDATE_TIME
			  FROM PLN_ORD_CRAFT_FILE T
			 WHERE (T.CRAFT_FILE_NO LIKE '%'|| ? ||'%' OR T.CRAFT_FILE_NO IS NULL)
			 AND (T.ORDER_NO||'/'||T.ORDER_SEQ) LIKE '%'|| ? ||'%'
			   AND TO_DATE(TO_CHAR(T.CRAFT_FILE_UPTIME, 'YYYY-MM-DD'), 'YYYY-MM-DD') BETWEEN
			       TO_DATE(?, 'YYYY-MM-DD') AND TO_DATE(?, 'YYYY-MM-DD')
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getCraftByOrderno" desc="查询工艺文件信息">
		<![CDATA[
			SELECT * FROM PLN_ORD_CRAFT_FILE T
			 WHERE T.ORDER_NO 	= ? 
		       AND T.ORDER_SEQ	= ?
          ORDER BY TO_NUMBER(T.VERSION_NO) DESC
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getSaleOrderStatus" desc="查询合同状态">
		<![CDATA[
			SELECT T.ORD_PK,
			       T.ORD_LN_PK,
			       T.ORD_LN_DLY_PK,
			       T.INDEX_SEQ,
			       T.STEELCODE,
			       T.STEELNAME,
			       T.PRODUCCODE,
			       T.PRODUCNAME,
			       T.OUTDIAMETER,
			       T.WALLTHICK,
			       T.MODEL_CODE,
			       T.MODEL_DESC,
			       T.LENGTHDISC,
			       T.GRADECODE_ALL,
			       T.GRADECODE,
			       T.BJ_TYPE,
			       T.ENDGXNAME,
			       T.HEIGHT_NK_MIN,
			       T.HEIGHT_NK_MAX,
			       T.MONITORDEMAND
			  FROM PLN_SALEORDER T
			 WHERE T.ORDER_NO = ?
			   AND T.ORDER_SEQ = ?
			   AND T.PORDERSTATUS != '0'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getOrderCraftpath" desc="查询合同工艺路线">
		<![CDATA[
		 SELECT T1.PROCESS_CODE_C, T1.PROCESS_DESC_C, T1.PROCESS_CODE
		   FROM SLM_ORD_DESIGN_MSC_PL_PRC T1, SLM_ORD_DESIGN_MSC T
		  WHERE T1.DESGIN_KEY = T.DESGIN_KEY
		    AND T.VALIDFLAG = '1'
		    AND T.ORD_PK = ?
		    AND T.ORD_LN_PK = ?
		    AND T1.MSC_PLINE = ?
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getOrdCraftStd" desc="查询工艺标准">
		<![CDATA[
		 SELECT T.STD_GJG_NO, T.STD_LG_NO, T.STD_ZG_NO
		  FROM PLN_ORD_CRAFT_FILE T
		 WHERE T.CRAFT_FILE_NO = ? AND T.ORDER_NO = ? AND T.ORDER_SEQ = ?
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getCraftfileByTime" desc="查询工艺文件信息">
		<![CDATA[
			SELECT T.CRAFT_FILE_NO FROM PLN_ORD_CRAFT_FILE T
			 WHERE TO_DATE(TO_CHAR(T.CRAFT_FILE_UPTIME, 'YYYY-MM-DD'), 'YYYY-MM-DD') BETWEEN
			       TO_DATE(?, 'YYYY-MM-DD') AND TO_DATE(?, 'YYYY-MM-DD')
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getBaseInfo2002"
		desc="查询工艺文件类型">
		<![CDATA[	
		SELECT T.BASECODE, T.BASENAME
  FROM COM_BASE_INFO T
 WHERE T.SORTCODE = '2002'
   AND T.VALIDFLAG = '1'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getBaseInfo2003"
		desc="查询工艺文件状态">
		<![CDATA[	
		SELECT T.BASECODE, T.BASENAME
  FROM COM_BASE_INFO T
 WHERE T.SORTCODE = '2003'
   AND T.VALIDFLAG = '1'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getBaseModel" desc="查询扣型">
		<![CDATA[
			SELECT T.MODEL_CODE,T.MODEL_DESC FROM COM_BASE_MODEL T WHERE T.VALIDFLAG='1'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getBaseSteel" desc="查询钢级">
		<![CDATA[
			SELECT T.STEELCODE,T.STEELNAME FROM COM_BASE_STEEL T WHERE T.VALIDFLAG='1'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getBjProcessC" desc="查询变径类型">
		<![CDATA[
			SELECT PROCESS_CDOE_C, PROCESS_DESC_C, PROCESS_CDOE, PROCESS_DESC
			  FROM COM_BASE_PROCESS_C T
			 WHERE VALIDFLAG = '1'
			   AND T.PROCESS_CDOE = 'E'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getBaseProduct" desc="查询品种">
		<![CDATA[
			SELECT T.PRODUCCODE,T.PRODUCNAME,T.PRODUC_JX FROM COM_BASE_PRODUCT T WHERE T.VALIDFLAG='1'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getCraftFileByOrdLnPk"
		desc="查询工艺文件">
		<![CDATA[	
			SELECT T.ORDER_SEQ
			  FROM PLN_ORD_CRAFT_FILE T
			 WHERE T.ORDER_NO = ?
			   AND T.ORDER_SEQ = ?
			   AND T.CRAFT_FILE_NO = ?
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.addCraftFile"
		desc="新增工艺文件">
		<![CDATA[	
			INSERT INTO PLN_ORD_CRAFT_FILE T
		        (T.PRODUC_JX,
		         T.ORDER_NO,
		         T.ORDER_SEQ,
		         T.CRAFT_FILE_NO,
		         T.CRAFT_FILE_MAN,
		         T.STD_LG_NO,
		         T.STD_ZG_NO,
		         T.STD_GJG_NO,
		         T.STEELCODE,
		         T.STEELNAME,
		         T.GRADECODE,
		         T.OUTDIAMETER,
		         T.WALLTHICK,
		         T.MODEL_CODE,
		         T.MODEL_DESC,
		         T.BJ_TYPE,
		         T.S_DIV_D,
		         T.HEIGHT_NK_MAX,
		         T.HEIGHT_NK_MIN,
		         T.LENGTH_EXTENT,
		         T.CRAFT_PATH,
		         T.RCL_INFO,
		         T.PAYDOWN_DPT,
		         T.MONITOR_INFO,
		         T.HOLE_MODAL_INFO,
		         T.VERSION_NO,
		         T.VERSION_DESC,
		         T.CRAFT_FILE_TYPE_CODE,
		         T.CRAFT_FILE_TYPE_NM,
		         T.CRAFT_FILE_PATH,
		         T.CRAFT_FILE_FLAG_CODE,
		         T.CRAFT_FILE_FLAG_NM,
		         T.CRAFT_FILE_UPTIME,
		         T.CREATE_NAME,
		         T.CREATE_TIME)
		      VALUES
		        ('#PRODUC_JX#',
		         '#ORDER_NO#',
		         '#ORDER_SEQ#',
		         '#CRAFT_FILE_NO#',
		         '#CRAFT_FILE_MAN#',
		         '#STD_LG_NO#',
		         '#STD_ZG_NO#',
		         '#STD_GJG_NO#',
		         '#STEELCODE#',
		         '#STEELNAME#',
		         '#GRADECODE#',
		         '#OUTDIAMETER#',
		         '#WALLTHICK#',
		         '#MODEL_CODE#',
		         '#MODEL_DESC#',
		         '#BJ_TYPE#',
		         '#S_DIV_D#',
		         '#HEIGHT_NK_MAX#',
		         '#HEIGHT_NK_MIN#',
		         '#LENGTH_EXTENT#',
		         '#CRAFT_PATH#',
		         '#RCL_INFO#',
		         '#PAYDOWN_DPT#',
		         '#MONITOR_INFO#',
		         '#HOLE_MODAL_INFO#',
		         (SELECT LPAD(TO_CHAR(COUNT(T.CRAFT_FILE_NO) + 1), 3, '0')
				  FROM PLN_ORD_CRAFT_FILE T
				 WHERE T.ORDER_NO = '#ORDER_NO#'
				   AND T.ORDER_SEQ = '#ORDER_SEQ#'),
		         '#VERSION_DESC#',
		         '#CRAFT_FILE_TYPE_CODE#',
		         '#CRAFT_FILE_TYPE_NM#',
		         '#CRAFT_FILE_PATH#',
		         '#CRAFT_FILE_FLAG_CODE#',
		         '#CRAFT_FILE_FLAG_NM#',
		         SYSDATE,
		         '#CREATE_NAME#',
		         SYSDATE)
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.updateCraftFile"
		desc="修改工艺文件">
		<![CDATA[	
			UPDATE PLN_ORD_CRAFT_FILE T
			   SET T.PRODUC_JX            = '#PRODUC_JX#',
			       T.CRAFT_FILE_MAN       = '#CRAFT_FILE_MAN#',
			       T.STD_LG_NO            = '#STD_LG_NO#',
			       T.STD_ZG_NO            = '#STD_ZG_NO#',
			       T.STD_GJG_NO           = '#STD_GJG_NO#',
			       T.STEELCODE            = '#STEELCODE#',
			       T.STEELNAME            = '#STEELNAME#',
			       T.GRADECODE            = '#GRADECODE#',
			       T.OUTDIAMETER          = '#OUTDIAMETER#',
			       T.WALLTHICK            = '#WALLTHICK#',
			       T.MODEL_CODE           = '#MODEL_CODE#',
			       T.MODEL_DESC           = '#MODEL_DESC#',
			       T.BJ_TYPE              = '#BJ_TYPE#',
			       T.S_DIV_D              = '#S_DIV_D#',
			       T.HEIGHT_NK_MAX        = '#HEIGHT_NK_MAX#',
			       T.HEIGHT_NK_MIN        = '#HEIGHT_NK_MIN#',
			       T.LENGTH_EXTENT        = '#LENGTH_EXTENT#',
			       T.CRAFT_PATH           = '#CRAFT_PATH#',
			       T.RCL_INFO             = '#RCL_INFO#',
			       T.PAYDOWN_DPT          = '#PAYDOWN_DPT#',
			       T.MONITOR_INFO         = '#MONITOR_INFO#',
			       T.HOLE_MODAL_INFO      = '#HOLE_MODAL_INFO#',
		           T.VERSION_DESC		  = '#VERSION_DESC#',
			       T.CRAFT_FILE_TYPE_CODE = '#CRAFT_FILE_TYPE_CODE#',
			       T.CRAFT_FILE_TYPE_NM   = '#CRAFT_FILE_TYPE_NM#',
			       T.CRAFT_FILE_PATH      = '#CRAFT_FILE_PATH#',
			       T.CRAFT_FILE_FLAG_CODE = '#CRAFT_FILE_FLAG_CODE#',
			       T.CRAFT_FILE_FLAG_NM   = '#CRAFT_FILE_FLAG_NM#',
			       T.CRAFT_FILE_UPTIME    = SYSDATE,
			       T.UPDATE_NAME          = '#UPDATE_NAME#',
			       T.UPDATE_TIME          = SYSDATE
			 WHERE T.ORDER_NO = '#ORDER_NO#'
			   AND T.ORDER_SEQ = '#ORDER_SEQ#'
			   AND T.CRAFT_FILE_NO = '#CRAFT_FILE_NO#'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.updateCraftFileChange"
		desc="修改工艺文件，版本变动">
		<![CDATA[	
			UPDATE PLN_ORD_CRAFT_FILE T
			   SET T.PRODUC_JX            = '#PRODUC_JX#',
			       T.CRAFT_FILE_NO        = '#CRAFT_FILE_NO#',
			       T.CRAFT_FILE_MAN       = '#CRAFT_FILE_MAN#',
			       T.STD_LG_NO            = '#STD_LG_NO#',
			       T.STD_ZG_NO            = '#STD_ZG_NO#',
			       T.STD_GJG_NO           = '#STD_GJG_NO#',
			       T.STEELCODE            = '#STEELCODE#',
			       T.STEELNAME            = '#STEELNAME#',
			       T.GRADECODE            = '#GRADECODE#',
			       T.OUTDIAMETER          = '#OUTDIAMETER#',
			       T.WALLTHICK            = '#WALLTHICK#',
			       T.MODEL_CODE           = '#MODEL_CODE#',
			       T.MODEL_DESC           = '#MODEL_DESC#',
			       T.BJ_TYPE              = '#BJ_TYPE#',
			       T.S_DIV_D              = '#S_DIV_D#',
			       T.HEIGHT_NK_MAX        = '#HEIGHT_NK_MAX#',
			       T.HEIGHT_NK_MIN        = '#HEIGHT_NK_MIN#',
			       T.LENGTH_EXTENT        = '#LENGTH_EXTENT#',
			       T.CRAFT_PATH           = '#CRAFT_PATH#',
			       T.RCL_INFO             = '#RCL_INFO#',
			       T.PAYDOWN_DPT          = '#PAYDOWN_DPT#',
			       T.MONITOR_INFO         = '#MONITOR_INFO#',
			       T.HOLE_MODAL_INFO      = '#HOLE_MODAL_INFO#',
			       T.VERSION_NO			  = (SELECT LPAD(NVL(MAX(T1.VERSION_NO + 1), '001'),
					                                   3,
					                                   '0')
					                         FROM PLN_ORD_CRAFT_FILE T1
											 WHERE T1.ORDER_NO = '#ORDER_NO#'
											   AND T1.ORDER_SEQ = '#ORDER_SEQ#'),
		           T.VERSION_DESC		  = '#VERSION_DESC#',
			       T.CRAFT_FILE_TYPE_CODE = '#CRAFT_FILE_TYPE_CODE#',
			       T.CRAFT_FILE_TYPE_NM   = '#CRAFT_FILE_TYPE_NM#',
			       T.CRAFT_FILE_PATH      = '#CRAFT_FILE_PATH#',
			       T.CRAFT_FILE_FLAG_CODE = '#CRAFT_FILE_FLAG_CODE#',
			       T.CRAFT_FILE_FLAG_NM   = '#CRAFT_FILE_FLAG_NM#',
			       T.CRAFT_FILE_UPTIME    = SYSDATE,
			       T.UPDATE_NAME          = '#UPDATE_NAME#',
			       T.UPDATE_TIME          = SYSDATE
			 WHERE T.ORDER_NO = '#ORDER_NO#'
			   AND T.ORDER_SEQ = '#ORDER_SEQ#'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.saveTypeCraftFile"
		desc="保存工艺文件类型等信息">
		<![CDATA[	
			UPDATE PLN_ORD_CRAFT_FILE T
			   SET T.CRAFT_FILE_FLAG_CODE = '#CRAFT_FILE_FLAG_CODE#',
			       T.CRAFT_FILE_FLAG_NM   = '#CRAFT_FILE_FLAG_NM#',
			       T.CRAFT_FILE_MAN       = '#CRAFT_FILE_MAN#',
			       T.CRAFT_FILE_PATH      = '#CRAFT_FILE_PATH#',
			       T.CRAFT_FILE_TYPE_CODE = '#CRAFT_FILE_TYPE_CODE#',
			       T.CRAFT_FILE_TYPE_NM   = '#CRAFT_FILE_TYPE_NM#',
			       T.CRAFT_FILE_UPTIME    = SYSDATE,
			       T.UPDATE_NAME          = '#UPDATE_NAME#',
			       T.UPDATE_TIME          = SYSDATE
			 WHERE T.ORDER_NO = '#ORDER_NO#'
			   AND T.ORDER_SEQ = '#ORDER_SEQ#'
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.matchCraftfileToPln"
		desc="匹配工艺文件到销售合同提报表">
		<![CDATA[
			UPDATE PLN_SALEORDER T
			   SET T.CRAFT_FILE_NO = ?, T.CRAFT_FILE_MAN = ?
			 WHERE T.ORDER_NO = ?
			   AND T.ORDER_SEQ = ?
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.setCraftFileFlag"
		desc="审核工艺文件">
		<![CDATA[	
			UPDATE PLN_ORD_CRAFT_FILE T
			   SET T.CRAFT_FILE_FLAG_CODE = ?,
			       T.CRAFT_FILE_FLAG_NM   = ?,
			       T.CRAFT_FILE_TYPE_CODE = ?,
			       T.CRAFT_FILE_TYPE_NM   = ?,
			       T.CRAFT_FILE_PATH      = ?
			 WHERE T.ORDER_NO = ?
			   AND T.ORDER_SEQ = ?
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.deleteCraftInfo"
		desc="删除工艺文件">
		<![CDATA[	
			DELETE FROM PLN_ORD_CRAFT_FILE T
			 WHERE T.ORDER_NO = ?
			   AND T.ORDER_SEQ = ?
		]]>
	</query>
	
	<query id="CoreOrderCraftInfo.getOrderLineStatus"
		desc="查询合同行状态">
		<![CDATA[	
			SELECT T.ORDER_LN_STATUS,
			       T.PRODUCNAME,
			       T.STEELNAME,
			       T.STEELCODE,
			       T.DIMATER,
			       T.HEIGHT,
			       T.MODEL_CODE,
			       T.MODEL_DESC,
			       T.LEN_DESC,
			       T.PRDCR_NO
			  from (SELECT A.*, B.ORDER_NO
			          FROM SLM_ORDER_LINE A, SLM_ORDER_HEAD B
			         WHERE A.ORD_PK = B.ORD_PK
			           AND A.VALIDFLAG = '1') T
			 where t.order_no = ?
			   and t.order_seq = ?
		]]>
	</query>

</queryMap>