<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="合同行">
	<query id="CorePscSelect.doQueryJGweight" desc="查询接箍单重">
		<![CDATA[
			SELECT  DECODE(WEIGHT_JG,0,0.003,NULL,0.003,WEIGHT_JG*0.001) JG_WEIGHT
			  FROM COM_MSC_JG
			  WHERE PRODUCCODE_JG =?
			    AND STEELCODE_JG =?
			    AND SPEC_JG =?
			    AND MODEL_CODE=?
			    AND ROWNUM = 1
		]]>
	</query>
	
	<query id="CorePscSelect.doQuerySpecOrder" desc="查询订货规格">
		<![CDATA[
			SELECT ER.SPEC_CODE, ER.SPEC_NAME, ER.ORDER_SPEC_CODE, ER.ORDER_SPEC_DESC,
             EC.DIMATER, EC.HEIGHT
             FROM COM_BASE_SPEC_ORDER ER LEFT JOIN COM_BASE_SPEC EC
             ON ER.SPEC_CODE = EC.SPEC_CODE
             WHERE ER.VALIDFLAG = '1' AND EC.VALIDFLAG = '1'
             ORDER BY ER.SPEC_NAME
		]]>
	</query>
	<query id="CorePscSelect.doQueryBaseModel" desc="查询扣型">
		<![CDATA[
			SELECT MODEL_CODE,MODEL_DESC FROM COM_BASE_MODEL WHERE VALIDFLAG='1' ORDER BY MODEL_CODE
		]]>
	</query>

	<query id="CoreOrderLine.BindSpecOrder" desc="订货规格">
		<![CDATA[
			SELECT   'FALSE' CB, PC.SPEC_CODE, PC.SPEC_NAME,ER.ORDER_SPEC_CODE,ER.ORDER_SPEC_DESC,PC.DIMATER, PC.HEIGHT, PC.WEIGHT, PC.MSC_STYLE,
                 PC.CREATE_NAME,
                 TO_CHAR (PC.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
                 PC.UPDATE_NAME,
                 TO_CHAR (PC.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
                 PC.DELETE_NAME,
                 TO_CHAR (PC.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
                 PC.VALIDFLAG, DECODE (PC.VALIDFLAG, '1', '有效', '无效') VALIDFLAGNAME,
                 PC.MEMO
            FROM COM_BASE_SPEC PC INNER JOIN COM_BASE_SPEC_ORDER ER ON
             PC.VALIDFLAG IN ('1',?) 
             AND ER.VALIDFLAG IN ('1') 
             AND INSTR(ER.ORDER_SPEC_DESC,NVL(?,ER.ORDER_SPEC_DESC))>0
             AND PC.MSC_STYLE IN (?)
             AND PC.SPEC_CODE = ER.SPEC_CODE
        ORDER BY PC.SPEC_CODE
		]]>
	</query>

	<query id="CoreOrderLine.SlmBaseInfo" desc="查询品名类型">
		<![CDATA[
			SELECT BASECODE  FROM COM_BASE_INFO WHERE BASECODE = (
			SELECT PRODUC_STYLE FROM COM_BASE_PRODUCT WHERE PRODUCCODE = (SELECT PRODUCCODE FROM COM_PSC WHERE PSC = ?))
		]]>
	</query>

	<query id="CoreOrderLine.getMscInfo" desc="查询品名类型">
		<![CDATA[
			 SELECT MSC_DESC ,USE_CODE,USE_DESC,MSC_STYLE
			 FROM COM_MSC 
			 WHERE MSC = ? AND VALIDFLAG != 'D'
			 
		]]>
	</query>

	<query id="CoreOrderLine.getSpecInfo" desc="查询品名类型">
		<![CDATA[
			 SELECT SPEC_CODE, SPEC_NAME, DIMATER, HEIGHT, MSC_STYLE
       FROM COM_BASE_SPEC T
       WHERE VALIDFLAG = '1'
			 
		]]>
	</query>


	<query id="CoreOrderLine.getOrderSpecInfo" desc="查询品名类型">
		<![CDATA[
	 SELECT ORDER_SPEC_CODE, ORDER_SPEC_DESC
     FROM COM_BASE_SPEC_ORDER T
     WHERE SPEC_CODE = ?
     AND VALIDFLAG = '1'
 
		]]>
	</query>

	<query id="CoreOrderLine.getBindOrderSpecInfo" desc="查询品名类型">
		<![CDATA[
	 SELECT T.ORDER_SPEC_CODE,
       T.ORDER_SPEC_DESC,
       T1.SPEC_CODE,
       T1.SPEC_NAME,
       T1.HEIGHT,
       T1.WEIGHT
   FROM COM_BASE_SPEC_ORDER T, COM_BASE_SPEC T1
  WHERE T.SPEC_CODE = ?
   AND T.VALIDFLAG = '1'
   AND T1.VALIDFLAG = '1'
   AND T1.SPEC_CODE = T.SPEC_CODE
   AND INSTR(T.ORDER_SPEC_DESC,NVL(?,T.ORDER_SPEC_DESC))>0
   
		]]>
	</query>

	<query id="CoreOrderLine.getOrderDlyTransit" desc="查询品名类型">
		<![CDATA[
	     SELECT ORD_PK,
       ORD_LN_PK,
       ORD_LN_DLY_PK,
       INDEX_SEQ,
       AGENCY_FL,
       (SELECT BASENAME
          FROM COM_BASE_INFO
         WHERE BASECODE = TRANSIT_TYP
           AND VALIDFLAG = '1') TRANSIT_TYP,
       DESTINATION,
       STATION_NO,
       (SELECT STATION_NM
          FROM SLM_BASE_STATION A
         WHERE A.STATION_NO = T.STATION_NO) STATION_NM,
       SPCL_LN_NO,
       (SELECT SPCL_LN_NM
          FROM SLM_BASE_SPCL_LN B
         WHERE B.SPCL_LN_NO = T.SPCL_LN_NO) SPCL_LN_NM,
       PORT_NO,
       (SELECT BASENAME
          FROM COM_BASE_INFO
         WHERE BASECODE = PORT_NO
           AND VALIDFLAG = '1') PORT_DESC,
       (SELECT BASENAME
          FROM COM_BASE_INFO
         WHERE BASECODE = CARRIER_UNIT
           AND VALIDFLAG = '1') CARRIER_UNIT,
       RECEIVOR,
       TRANSIT_LN_MNY,
       VALIDFLAG,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME,
       LV_FACTY_TYP
   FROM SLM_ORDER_DELIVERY_TRANSIT T
   WHERE T.ORD_LN_DLY_PK= ? AND T.VALIDFLAG = '1'
 
		]]>
	</query>

</queryMap>