<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
	<query id="CoreProcessProparameters.QUERY" desc="权限功能">
		<![CDATA[
			SELECT  PROCESS_CODE,
				    PROCESS_DESC,
				    STATION_CODE,
					STATION_DESC,
					CRAFTITEM_CODE,
					CRAFTITEM_DESC,
					ALLOW_COUNT,
					CREATE_NAME,
					TO_CHAR(CREATE_TIME,'yyyy-mm-dd hh24:mi:ss') CREATE_TIME,
					UPDATE_NAME,
					TO_CHAR(UPDATE_TIME,'yyyy-mm-dd hh24:mi:ss') UPDATE_TIME,
					DELETE_NAME,
					TO_CHAR(DELETE_TIME,'yyyy-mm-dd hh24:mi:ss') DELETE_TIME,
					VALIDFLAG,
			        decode(VALIDFLAG,'1','有效','无效') VALIDFLAGNAME,
					MEMO
				FROM COM_BASE_STATION_R_CRAFT
				   WHERE VALIDFLAG in ('1' , ?)
				   AND lower(PROCESS_DESC)||'&' LIKE '%' || lower(?) || '%'
		]]>
	</query>
	<query id="CoreProcessProparameters.ADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_BASE_STATION_R_CRAFT
							(PROCESS_CODE,
					        PROCESS_DESC,
					        STATION_CODE,
							STATION_DESC,
					        CRAFTITEM_CODE,
					        CRAFTITEM_DESC,
					        ALLOW_COUNT,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO)
							VALUES(?,?,?,?,?,?,?,
							?,SYSDATE,
							'1',?)
		]]>
	</query>
	<query id="CoreProcessProparameters.MODIFY" desc="修改">
		<![CDATA[
			 UPDATE COM_BASE_STATION_R_CRAFT set
							PROCESS_DESC=?, 
							STATION_CODE=?, 
							STATION_DESC=?,
							CRAFTITEM_CODE=?,
							CRAFTITEM_DESC=?,
							ALLOW_COUNT=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=SYSDATE,
							MEMO=? 
							WHERE PROCESS_CODE=?
		]]>
	</query>
	<query id="CoreProcessProparameters.DELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_BASE_STATION_R_CRAFT T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.PROCESS_CODE = ?
		]]>
	</query>
	
	<query id="CoreProcessProparameters.RESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_BASE_STATION_R_CRAFT T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.PROCESS_CODE = ?
		]]>
	</query>
	
	<query id="CoreProcessProparameters.PROCESS" desc="绑定工序点id和描述">
		<![CDATA[
			SELECT PROCESS_CODE,PROCESS_DESC FROM COM_BASE_PROCESS
		]]>
	</query>
	
	<query id="CoreProcessProparameters.PROCESSPARAMETERS" desc="绑定工艺参数id和描述">
		<![CDATA[
			SELECT CRAFT_CODE,CRAFTITEM_DESC FROM COM_BASE_CRAFT
		]]>
	</query>
</queryMap>