<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="质量设计MSC">
    
	<query id="SlmOrdDesignMscDAL.query" desc="查询质量设计MSC">
		<![CDATA[
SELECT T.DESGIN_KEY,
       T.ORD_PK,
       T.ORD_LN_PK,
       T.ORDER_SEQ,
       T.CUST_ALPHA_NO,
       T.PSC,
       T.PSC_DESC,
       T.MSC,
       T.MSC_DESC,
       T.MSC_STYLE,
       DECODE(T.MSC_STYLE, 'A', '钢管（管坯）', 'B', '钢管+接箍', 'C', '短节+附件', 'D', '接箍', 'E', '双公短节') MSC_STYLE_DESC,
       T.USE_CODE,
       T.USE_DESC,
       T.PRD_CLS,
       A.BASENAME PRD_CLS_DESC,
       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,
       T.DELVRY_RANGE_TPE,
       T.DELVRY_RANGE_MIN,
       T.DELVRY_RANGE_MAX,
       T.FINAL_USER,
       T.FINAL_USER_DESC,
       T.OUTS_BILLET_FL,
       T.OUTS_STL_PIPE_FL,
       T.ASSEL_FL,
       T.PRODUCER_FL,
       T.PRDCR_NO,
       T.PRDCR_DESC,
       T.MPS_FL,
       T.MPS_NO,
       T.MPS_DESC,
       TO_CHAR(T.DELVRY_BDATE, 'YYYY-MM-DD HH24:MI:SS') DELVRY_BDATE,
       TO_CHAR(T.DELVRY_EDATE, 'YYYY-MM-DD HH24:MI:SS') 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,
       T.BE_ORDER_LN_STATUS,
       T.BE_OBJ_STS_OP,
       T.ORDER_LN_STATUS,
       T.OBJ_STS_OP,
       T.MEMO,
       T.PRD_LEN,
       T.LOSS_RATE,
       T.VALIDFLAG,
       DECODE(T.VALIDFLAG, '1', '有效', '0', '无效', '未识别') VALIDFLAG_DESC,
       T.CREATE_NAME,
       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_LN_PK_OLD
  FROM SLM_ORD_DESIGN_MSC T
  LEFT JOIN COM_BASE_INFO A ON A.BASECODE = T.PRD_CLS AND A.VALIDFLAG = '1'
 WHERE T.DESGIN_KEY = '#DESGIN_KEY#'
 AND T.VALIDFLAG = '1'
		]]>
	</query>
	
	<query id="SlmOrdDesignMscDAL.queryMscByDesignKey" desc="查询质量设计MSC">
		<![CDATA[
SELECT T.MSC,
       T.DESGIN_KEY
  FROM SLM_ORD_DESIGN_MSC T
 WHERE T.DESGIN_KEY = '#DESGIN_KEY#'
 AND T.VALIDFLAG = '1'
		]]>
	</query>
</queryMap>