<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">	
	<query id="CoreTransitLine.doQuery" desc="查询">
		<![CDATA[
			SELECT 
			TRANSIT_NO,TRANSIT_DESC,REGION_NO_B_TYP,
			REGION_NO_B,REGION_NO_E_TYP,REGION_NO_E,
			VALIDFLAG,CREATE_NAME,CREATE_TIME,
			UPDATE_NAME,UPDATE_TIME,
			DELETE_NAME,DELETE_TIME
			FROM SLM_BASE_TRANSIT WHERE LOWER(REGION_NO_B)||'&' 
			LIKE '%'||LOWER(?)||'%' AND 
			LOWER(REGION_NO_E) LIKE '%'||LOWER(?)||'%'
		]]>
	</query>
	
	
	<query id="CoreTransitLine.doQuery_Mode" desc="方案表查询">
		<![CDATA[
			SELECT 
			TRANSIT_NO,
			MODE_NO,
			MODE_DESC,
			TRANSIT_MNY,
			VALIDFLAG,
			CREATE_NAME,
			CREATE_TIME,
			UPDATE_NAME,
			UPDATE_TIME,
			DELETE_NAME,
			DELETE_TIME 
			FROM 
			SLM_BASE_TRANSIT_MODE WHERE TRANSIT_NO=? ORDER BY MODE_NO

		]]>
	</query>
	
	
	<query id="CoreTransitLine.GetSpclNo" desc="专用线">
		<![CDATA[
			SELECT SPCL_LN_NO,SPCL_LN_NM FROM SLM_BASE_SPCL_LN where validflag='1' ORDER BY SPCL_LN_NM
		]]>
	</query>
	
	<query id="CoreTransitLine.GetYsfs" desc="运输方式">
		<![CDATA[
			SELECT BASECODE,BASENAME FROM COM_BASE_INFO WHERE SORTCODE='1105' ORDER BY BASECODE
		]]>
	</query>
	
	<query id="CoreTransitLine.GetCydw" desc="承运单位">
		<![CDATA[
			SELECT BASECODE,BASENAME FROM COM_BASE_INFO WHERE SORTCODE='1109' ORDER BY BASECODE
		]]>
	</query>
	
	<query id="CoreTransitLine.GetType" desc="地域类型数据源绑定">
		<![CDATA[
			SELECT BASECODE,
				   BASENAME 
				   FROM 
				   COM_BASE_INFO 
				   WHERE 
				   SORTCODE='1107' 
				   ORDER BY BASECODE
		]]>
	</query>
	<query id="CoreTransitLine.GetStation" desc="获取到站信息">
		<![CDATA[
			SELECT 
			STATION_NO,
			STATION_NM 
			FROM 
			SLM_BASE_STATION 
			ORDER BY 
			STATION_NO
		]]>
	</query>
	<query id="CoreTransitLine.GetPort" desc="获取港口码头">
		<![CDATA[
			SELECT 
			BASECODE,
			BASENAME 
			FROM 
			COM_BASE_INFO 
			WHERE 
			SORTCODE='1108' 
			ORDER BY BASECODE
		]]>
	</query>
	<query id="CoreTransitLine.isRepeatMain" desc="验证主线路是否已存在">
		<![CDATA[
			SELECT 
			REGION_NO_B,
			REGION_NO_E 
			FROM 
			SLM_BASE_TRANSIT 
			WHERE 
			LOWER(REGION_NO_B)=LOWER(?) 
			AND 
			LOWER(REGION_NO_E)=LOWER(?)
		]]>
	</query>
	
	<query id="CoreTransitLine.isRepeatModeLine" desc="验证明细表，线路是否已存在。">
		<![CDATA[
			SELECT 
			REGION_NO_B,
			REGION_NO_E 
			FROM 
			SLM_BASE_TRANSIT_MODE_LINE 
			WHERE 
	        TRANSIT_NO=? AND MODE_NO=? AND REGION_NO_B = ? AND REGION_NO_E = ?
		]]>
	</query>
	
	
	<query id="CoreTransitLine.isRepeatMode" desc="验证方案描述是否已存在">
		<![CDATA[
			SELECT 
			MODE_DESC 
			FROM 
			SLM_BASE_TRANSIT_MODE 
			WHERE 
			TRANSIT_NO=? 
			AND 
			MODE_DESC=?
			
		]]>
	</query>
	
	
	<query id="CoreTransitLine.GetMaxCode_Main" desc="获取最大主线路编号">
		<![CDATA[
			SELECT 
			MAX(TRANSIT_NO) 
			FROM 
			SLM_BASE_TRANSIT 
			WHERE 
			TRANSIT_NO LIKE ?||'%'
		]]>
	</query>
	
	<query id="CoreTransitLine.GetMaxIndexSeq" desc="获取最大顺序号">
		<![CDATA[
			SELECT MAX(INDEX_SEQ) FROM SLM_BASE_TRANSIT_MODE_LINE WHERE TRANSIT_NO=? AND MODE_NO=?
		]]>
	</query>
	
	<query id="CoreTransitLine.GetMaxCode_Mode" desc="获取当前主线路下最大方案编号">
		<![CDATA[
			SELECT 
			MAX(MODE_NO) 
			FROM 
			SLM_BASE_TRANSIT_MODE 
			WHERE 
			TRANSIT_NO=?
		]]>
	</query>
	
	
	
	<query id="CoreTransitLine.doAdd_Main" desc="主线路新增">
		<![CDATA[
			INSERT INTO SLM_BASE_TRANSIT
							(TRANSIT_NO,
							TRANSIT_DESC,
							REGION_NO_B_TYP,
							REGION_NO_B,
							REGION_NO_E_TYP,
							REGION_NO_E,
							VALIDFLAG,
							CREATE_NAME,
							CREATE_TIME)
							VALUES(
							?,?,?,?,?,?,1,?,SYSDATE)

		]]>
	</query>
	
	<query id="CoreTransitLine.doAdd_Mode" desc="方案新增">
		<![CDATA[		
			INSERT INTO SLM_BASE_TRANSIT_MODE
							(TRANSIT_NO,
							MODE_NO,
							MODE_DESC,
							TRANSIT_MNY,
							VALIDFLAG,
							CREATE_NAME,
							CREATE_TIME)
							VALUES(
							?,?,?,0,1,?,SYSDATE)

		]]>
	</query>
	
	
	<query id="CoreTransitLine.doAdd_ModeLine" desc="线路明细新增">
		<![CDATA[		
			INSERT INTO SLM_BASE_TRANSIT_MODE_LINE(
										TRANSIT_NO,
										MODE_NO,
										MODE_DESC,
										INDEX_SEQ,
										AGENCY_FL,
										TRANSIT_TYP,
										REGION_NO_B_TYP,
										REGION_NO_B,
										REGION_NO_E_TYP,
										REGION_NO_E,
										SPCL_LN_NO,
										CARRIER_UNIT,
										RECEIVOR,
										TRANSIT_LN_MNY,
										VALIDFLAG,
										CREATE_NAME,
										CREATE_TIME
										)
										VALUES
										(?,?,?,?,?,
										?,?,?,?,?,
										?,?,?,?,1,
										?,SYSDATE)

		]]>
	</query>
	
	<query id="CoreTransitLine.doUpdate_Main" desc="主线路修改">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT SET
							TRANSIT_DESC=?,
							REGION_NO_B_TYP=?,
							REGION_NO_B=?,
							REGION_NO_E_TYP=?,
							REGION_NO_E=?,
							UPDATE_NAME=?,
							UPDATE_TIME=SYSDATE 
							WHERE 
							TRANSIT_NO=?

		]]>
	</query>
	
	<query id="CoreTransitLine.doUpdate_Mode" desc="方案修改">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE SET
							MODE_DESC=?,
							UPDATE_NAME=?,
							UPDATE_TIME=SYSDATE 
							WHERE TRANSIT_NO=? AND MODE_NO=?

		]]>
	</query>
	
	<query id="CoreTransitLine.doUpdate_ModeLine" desc="线路明细修改">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE_LINE SET
                                  AGENCY_FL=?,
                                  TRANSIT_TYP=?,
                                  REGION_NO_B_TYP=?,
                                  REGION_NO_B=?,
                                  REGION_NO_E_TYP=?,
                                  REGION_NO_E=?,
                                  SPCL_LN_NO=?,
                                  CARRIER_UNIT=?,
                                  RECEIVOR=?,
                                  TRANSIT_LN_MNY=?,
                                  UPDATE_NAME=?,
                                  UPDATE_TIME=SYSDATE 
                                  WHERE TRANSIT_NO=? AND MODE_NO=? AND INDEX_SEQ=?

		]]>
	</query>
	
	<query id="CoreTransitLine.doQuery_ModeLine" desc="线路明细查询">
		<![CDATA[
			SELECT
			TRANSIT_NO,MODE_NO,MODE_DESC,INDEX_SEQ,AGENCY_FL,
			TRANSIT_TYP,REGION_NO_B_TYP,REGION_NO_B,
			REGION_NO_E_TYP,REGION_NO_E,SPCL_LN_NO,CARRIER_UNIT,
			RECEIVOR,TRANSIT_LN_MNY，VALIDFLAG,CREATE_NAME,
			CREATE_TIME,UPDATE_NAME,UPDATE_TIME,
			DELETE_NAME,DELETE_TIME
			FROM SLM_BASE_TRANSIT_MODE_LINE
			WHERE TRANSIT_NO=? AND MODE_NO=?

		]]>
	</query>
	
	<query id="CoreTransitLine.GetTransitMny" desc="总费用">
		<![CDATA[
			SELECT 
			SUM(TRANSIT_LN_MNY) 
			FROM 
			SLM_BASE_TRANSIT_MODE_LINE 
			WHERE 
			TRANSIT_NO=?
			AND MODE_NO=?
			AND VALIDFLAG=1
		]]>
	</query>
	
	<query id="CoreTransitLine.UpdateTransitMny" desc="总费用更新">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE SET TRANSIT_MNY=? WHERE TRANSIT_NO=? AND MODE_NO=?
		]]>
	</query>
	
	<query id="CoreTransitLine.doDelete_ModeLine" desc="废除线路明细">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE_LINE 
			SET 
			VALIDFLAG=0,
			DELETE_NAME=?,
			DELETE_TIME=SYSDATE
			WHERE 
			TRANSIT_NO=? 
			AND MODE_NO=? 
			AND INDEX_SEQ=?
		]]>
	</query>
	
	<query id="CoreTransitLine.doResume_ModeLine" desc="废除线路明细">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE_LINE 
			SET 
			VALIDFLAG=1,
			DELETE_NAME=?,
			DELETE_TIME=''
			WHERE 
			TRANSIT_NO=? 
			AND MODE_NO=? 
			AND INDEX_SEQ=?
		]]>
	</query>
	
	
	<query id="CoreTransitLine.doDelete_Mode" desc="废除方案">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE
			SET 
			VALIDFLAG=0,
			DELETE_NAME=?,
			DELETE_TIME=SYSDATE
			WHERE 
			TRANSIT_NO=? 
			AND MODE_NO=? 
		]]>
	</query>
	
	<query id="CoreTransitLine.doResume_Mode" desc="恢复方案">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE
			SET 
			VALIDFLAG=1,
			DELETE_NAME=?,
			DELETE_TIME=''
			WHERE 
			TRANSIT_NO=? 
			AND MODE_NO=? 
		]]>
	</query>
	
	
	<query id="CoreTransitLine.doDelete_Mode_Item" desc="废除方案子记录">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE_LINE
			SET 
			VALIDFLAG=0,
			DELETE_NAME=?,
			DELETE_TIME=SYSDATE
			WHERE 
			TRANSIT_NO=? 
			AND MODE_NO=? 
		]]>
	</query>
	
	<query id="CoreTransitLine.doResume_Mode_Item" desc="恢复方案子记录">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE_LINE
			SET 
			VALIDFLAG=1,
			DELETE_NAME=?,
			DELETE_TIME=''
			WHERE 
			TRANSIT_NO=? 
			AND MODE_NO=? 
		]]>
	</query>
	
	
	<query id="CoreTransitLine.doDelete_Main_Mode_Line" desc="删除当前线路全部线路明细">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE_LINE
			SET 
			VALIDFLAG=0,
			DELETE_NAME=?,
			DELETE_TIME=SYSDATE
			WHERE 
			TRANSIT_NO=? 
		]]>
	</query>
	
	<query id="CoreTransitLine.doResume_Main_Mode_Line" desc="删除当前线路全部线路明细">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE_LINE
			SET 
			VALIDFLAG=1,
			DELETE_NAME=?,
			DELETE_TIME=''
			WHERE 
			TRANSIT_NO=? 
		]]>
	</query>
	
	<query id="CoreTransitLine.doDelete_Main_Mode" desc="废除当前线路下，全部方案">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE
			SET 
			VALIDFLAG=0,
			DELETE_NAME=?,
			DELETE_TIME=SYSDATE
			WHERE 
			TRANSIT_NO=? 
		]]>
	</query>
	
	<query id="CoreTransitLine.doResume_Main_Mode" desc="恢复当前线路下，全部方案">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT_MODE
			SET 
			VALIDFLAG=1,
			DELETE_NAME=?,
			DELETE_TIME=''
			WHERE 
			TRANSIT_NO=? 
		]]>
	</query>
	
	<query id="CoreTransitLine.doDelete_Main" desc="废除当前线路">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT
			SET 
			VALIDFLAG=0,
			DELETE_NAME=?,
			DELETE_TIME=SYSDATE
			WHERE 
			TRANSIT_NO=? 
		]]>
	</query>
	
	<query id="CoreTransitLine.doResume_Main" desc="恢复当前线路">
		<![CDATA[
			UPDATE SLM_BASE_TRANSIT
			SET 
			VALIDFLAG=1,
			DELETE_NAME=?,
			DELETE_TIME=''
			WHERE 
			TRANSIT_NO=? 
		]]>
	</query>
	
	
</queryMap>