<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
	<query id="CoreSpecificationsBasics.QUERY" desc="权限功能">
		<![CDATA[
			SELECT  SPEC_CODE,
				    SPEC_NAME,
				    DIMATER,
					HEIGHT,
					WEIGHT,
					MSC_STYLE,
					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,
					MEMO
				FROM COM_BASE_SPEC
				   WHERE VALIDFLAG in ('1' , ?)
				   AND lower(SPEC_NAME)||'&' LIKE '%' || lower(?) || '%'
		]]>
	</query>
	<query id="CoreSpecificationsBasics.ADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_BASE_SPEC
							(SPEC_CODE,
					        SPEC_NAME,
					        DIMATER,
							HEIGHT,
					        WEIGHT,
					        MSC_STYLE,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO)
							VALUES(?,?,?,?,?,?,
							?,TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							?,?)
							
			  
		]]>
	</query>
	<query id="CoreSpecificationsBasics.MODIFY" desc="修改">
		<![CDATA[
			 UPDATE COM_BASE_SPEC set
							SPEC_NAME=?, 
							DIMATER=?, 
							HEIGHT=?, 
							WEIGHT=?,
							MSC_STYLE=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							MEMO=? 
							WHERE SPEC_CODE=?
		]]>
	</query>
	<query id="CoreSpecificationsBasics.DELETE" desc="作废">
		<![CDATA[
		    DECLARE
			P_DELETE_NAME COM_BASE_SPEC.DELETE_NAME%TYPE := ?;
			P_SPEC_CODE COM_BASE_SPEC.SPEC_CODE%TYPE := ?;
			
			BEGIN
						 UPDATE COM_BASE_SPEC T
						   SET T.DELETE_NAME = P_DELETE_NAME, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
						 WHERE T.SPEC_CODE = P_SPEC_CODE;
			       UPDATE COM_BASE_SPEC_ORDER 
			         SET DELETE_NAME = P_DELETE_NAME, DELETE_TIME = SYSDATE, VALIDFLAG = '0'
			       WHERE SPEC_CODE = P_SPEC_CODE;
			END;
		]]>
	</query>
	
	<query id="CoreSpecificationsBasics.RESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_BASE_SPEC T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.SPEC_CODE = ?
		]]>
	</query>
</queryMap>