<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
	
	<query id="CoreSpeclLine.GetStation" desc="获取到站分类信息">
		<![CDATA[
		   select station_no,station_nm from SLM_BASE_STATION t where validflag='1' order by station_no
		]]>
	</query>
	
	<query id="CoreSpeclLine.GetMaxCode" desc="获取专用线代码最大值">
		<![CDATA[
			select max(spcl_ln_no) from SLM_BASE_SPCL_LN where spcl_ln_no like ?|| '%'
		]]>
	</query>

	<query id="CoreSpeclLine.isRepeatName" desc="判断名称是否存在">
		<![CDATA[
			select spcl_ln_nm from SLM_BASE_SPCL_LN where spcl_ln_nm=? order by spcl_ln_no
		]]>
	</query>
	<query id="CoreSpeclLine.QUERY" desc="权限功能">
		<![CDATA[
			SELECT 	a.spcl_ln_no,
          		   	a.spcl_ln_nm,
          		   	a.station_no,
          			b.station_nm,
        			a.memo,
          			a.validflag,
          			decode(a.validflag,'1','有效','无效') validflagName,
          			a.create_name,
          			TO_CHAR(a.CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') create_time,
          			a.update_name,
          			TO_CHAR(a.UPDATE_TIME,'yyyy-mm-dd hh24:mi:ss') update_time,
          			a.delete_name,
          			TO_CHAR(a.DELETE_TIME,'yyyy-mm-dd hh24:mi:ss') delete_time
     			FROM SLM_BASE_SPCL_LN a,SLM_BASE_STATION b
           		WHERE a.Station_No=b.station_no(+) AND a.validflag in ('1' ,  ? )
				   	AND lower(a.spcl_ln_nm)||'&' LIKE '%' || lower( ? ) || '%'  ORDER BY a.spcl_ln_no
		]]>
	</query>
	<query id="CoreSpeclLine.ADD" desc="新增">
		<![CDATA[
			 INSERT INTO SLM_BASE_SPCL_LN
							(spcl_ln_no,
						    spcl_ln_nm,
						    station_no,
							memo,
							VALIDFLAG,
					        CREATE_NAME,
					        CREATE_TIME
					        )
							VALUES(?,?,?,?,1,
							?,SYSDATE)
							
			  
		]]>
	</query>
	<query id="CoreSpeclLine.UPDATE" desc="修改">
		<![CDATA[
			 UPDATE SLM_BASE_SPCL_LN set
							spcl_ln_nm=?, 
							station_no=?, 
							memo=?, 
							UPDATE_NAME=?, 
							UPDATE_TIME=SYSDATE
							WHERE spcl_ln_no=?
		]]>
	</query>
	<query id="CoreSpeclLine.DELETE" desc="作废">
		<![CDATA[
			 UPDATE SLM_BASE_SPCL_LN T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.spcl_ln_no = ?
		]]>
	</query>
	
	<query id="CoreSpeclLine.RESUME" desc="恢复">
		<![CDATA[
			UPDATE SLM_BASE_SPCL_LN T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.spcl_ln_no = ?
		]]>
	</query>
</queryMap>