<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
<query id="CoreDlgTransitPlan.ADD" desc="新增">
		<![CDATA[
			 insert into SLM_ORDER_DELIVERY_TRANSIT(
					            ORD_PK,ORD_LN_PK,ORD_LN_DLY_PK,
					            AGENCY_FL,LV_FACTY_TYP,DESTINATION,STATION_NO,
					            SPCL_LN_NO,PORT_NO,CARRIER_UNIT,RECEIVOR,
					            TRANSIT_LN_MNY,VALIDFLAG,CREATE_NAME,CREATE_TIME,INDEX_SEQ  
								) 
					            values
					            (
					            ?,?,?,?,
					            ?,
					            ?,?,?,
					            ?,?,
					            ?,?,1,?,
					            SYSDATE,?)
		]]>
	</query>
	<query id="CoreDlgTransitPlan.MODIFY" desc="修改">
		<![CDATA[
			UPDATE SLM_ORDER_DELIVERY_TRANSIT set
							AGENCY_FL=?,
							LV_FACTY_TYP=?,
				            DESTINATION=?,
				            STATION_NO=?,
				            SPCL_LN_NO=?,
				            PORT_NO=?,
				            CARRIER_UNIT=?,
				            RECEIVOR=?,
				            TRANSIT_LN_MNY=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=SYSDATE
							WHERE 
							ORD_PK = ? and ORD_LN_PK = ? and ORD_LN_DLY_PK = ?
		]]>
	</query>
	
	<query id="CoreDlgTransitPlan.doDelete" desc="删除">
		<![CDATA[
			 DELETE SLM_ORDER_DELIVERY_TRANSIT WHERE ORD_PK = ? and ORD_LN_PK = ? and ORD_LN_DLY_PK = ?
		]]>
	</query>
	
	<query id="CoreDlgTransitPlan.doQueryComBaseInfo" desc="查询combaseinfo">
		<![CDATA[
			 SELECT BASECODE,BASENAME FROM COM_BASE_INFO WHERE BASECODE = ? ORDER BY BASECODE
		]]>
	</query>
	
	<query id="CoreDlgTransitPlan.doQuery" desc="查询">
		<![CDATA[
			SELECT 
			'FALSE' CHK,
			ORD_PK,ORD_LN_PK,ORD_LN_DLY_PK,
			INDEX_SEQ,AGENCY_FL,LV_FACTY_TYP,
			(SELECT BASENAME FROM COM_BASE_INFO WHERE BASECODE=LV_FACTY_TYP) TRANSIT_TYP,
			DESTINATION,
      		STATION_NO,
			(SELECT STATION_NM FROM SLM_BASE_STATION WHERE STATION_NO=b.STATION_NO) STATION_NM,
			SPCL_LN_NO,
			(SELECT SPCL_LN_NM FROM SLM_BASE_SPCL_LN WHERE SPCL_LN_NO=b.SPCL_LN_NO) SPCL_LN_NM,
			PORT_NO,
			(SELECT BASENAME FROM COM_BASE_INFO WHERE BASECODE=PORT_NO) PORT_DESC,
			(SELECT BASENAME FROM COM_BASE_INFO WHERE BASECODE=CARRIER_UNIT) CARRIER_UNIT,
			RECEIVOR,TRANSIT_LN_MNY,VALIDFLAG,CREATE_NAME,
			CREATE_TIME,UPDATE_NAME,UPDATE_TIME,DELETE_NAME,DELETE_TIME
			FROM SLM_ORDER_DELIVERY_TRANSIT b
			WHERE ORD_PK = ? and ORD_LN_PK=? 
		]]>
	</query>
	
	<query id="CoreDlgTransitPlan.GetMaxIndexSeq" desc="查询">
		<![CDATA[
			SELECT 
			MAX(INDEX_SEQ)
			FROM SLM_ORDER_DELIVERY_TRANSIT
			WHERE ORD_PK = ? and ORD_LN_PK = ? and ORD_LN_DLY_PK = ?
		]]>
	</query>
	<query id="CoreDlgTransitPlan.GetMaxordlndlypk" desc="查询内部顺序">
		<![CDATA[
			 SELECT DECODE (MAX (ord_ln_dly_pk),
                '', ? || '001',
                   MAX (ord_ln_pk)
                || LPAD (SUBSTR (MAX (ord_ln_dly_pk), 36) + 1, 3, '0')
               )
			   FROM slm_order_delivery_transit
			  WHERE ord_ln_pk = ?
		]]>
	</query>
</queryMap>