<?xml version="1.0" encoding="UTF-8"?>
 
<queryMap desc="标准类型基础管理">
	<query id="StdTypeBase.QUERY" desc="标准类型基础查询">
		<![CDATA[
	     SELECT 'FALSE' CHK
	      ,T.STD_STYLE
	      ,T.STD_STYLE_DESC
	      ,T.CREATE_NAME
	      ,TO_CHAR(T.CREATE_TIME,'YYYY-MM-DD HH24:MI:SS') CREATE_TIME
	      ,T.UPDATE_NAME
	      ,TO_CHAR(T.UPDATE_TIME,'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME
	      ,T.DELETE_NAME
	      ,TO_CHAR(T.DELETE_TIME,'YYYY-MM-DD HH24:MI:SS') DELETE_TIME
	      ,DECODE(T.VALIDFLAG,'1','有效','0','无效') VALIDFLAG
	      ,T.MEMO
	     FROM COM_BASE_STD_STYLE T
	     WHERE VALIDFLAG IN ('1' , ?)
	     AND UPPER(T.STD_STYLE_DESC) LIKE '%'||UPPER(?)||'%'
		]]>
	</query>
	
	<query id="StdTypeBase.GetCode" desc="获取存在的标准类型码(可以对比max函数效率)">
		<![CDATA[ 
 	    SELECT T.STD_STYLE
            FROM 
            (SELECT STD_STYLE FROM COM_BASE_STD_STYLE ORDER BY STD_STYLE DESC) T
             WHERE ROWNUM='1'
		]]> 
	</query>
	<query id="StdTypeBase.GetDESC_ADD" desc="标准类别描述是否存在-新增">
		<![CDATA[ 
		    SELECT STD_STYLE_DESC
            FROM   COM_BASE_STD_STYLE  T
            WHERE  STD_STYLE_DESC=?
		]]> 
	</query>
	<query id="StdTypeBase.GetDESC_UPDATE" desc="标准类别描述是否存在-修改">
		<![CDATA[ 
		    SELECT STD_STYLE_DESC
            FROM   COM_BASE_STD_STYLE  T
            WHERE  STD_STYLE_DESC=?
            AND STD_STYLE!=?
		]]> 
	</query>
	<query id="StdTypeBase.ADD" desc="标准类型基础新增">
        <![CDATA[
            INSERT INTO COM_BASE_STD_STYLE
						  (
						   STD_STYLE_DESC,
						   CREATE_NAME,
						   CREATE_TIME,
						   MEMO,
						   STD_STYLE)
						VALUES
						  (?,?,SYSDATE,?,?)
        ]]>
    </query>
    <query id="StdTypeBase.UPDATE" desc="标准类型基础新增">
        <![CDATA[
            UPDATE COM_BASE_STD_STYLE
			SET  
		    STD_STYLE_DESC=?,
		    UPDATE_NAME=?,
			UPDATE_TIME=SYSDATE,
			MEMO=?
			WHERE STD_STYLE=?
        ]]>
    </query>
 
    <query id="StdTypeBase.DELETE" desc="标准类型基础删除">
        <![CDATA[
            UPDATE COM_BASE_STD_STYLE T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.STD_STYLE = ?
        ]]>
    </query>
    <query id="StdTypeBase.RESUME" desc="标准类型基础恢复">
        <![CDATA[
            UPDATE COM_BASE_STD_STYLE T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.STD_STYLE = ?
        ]]>
    </query>
    
     <query id="StdTypeBase.IsLinkPSC" desc="标准类型基础恢复">
        <![CDATA[
            SELECT 1 
            FROM COM_PSC
            WHERE STD_STYLE = ?
        ]]>
    </query>
    
</queryMap>