<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="基础信息管理">
	<query id="ClsBaseInfo.COMMQUERY" desc="通用基础信息查询">
		<![CDATA[
			SELECT T.BASECODE, T.BASENAME, T.MNEMONIC_CODE, T.SEQ, T.MEMO
			  FROM COM_BASE_INFO T
			 WHERE T.VALIDFLAG = '1'
			   AND T.SORTCODE = ?
		]]>
	</query>
	<query id="ClsBaseInfo.GetDepartment" desc="查询管理部门信息">
        <![CDATA[
            SELECT T.DEPARTID, T.DEPARTNAME, T.PID, T.REMARK, T.ISROOT, T.IDX
			  FROM CORE_APP_DEPARTMENT T
			 WHERE LEVEL = 3
			 START WITH T.DEPARTID = '141106165312'
			CONNECT BY PRIOR T.DEPARTID = T.PID
			 ORDER BY T.PID,T.IDX
        ]]>
    </query>
    <query id="ClsBaseInfo.GetSection" desc="查询所有科室信息">
        <![CDATA[
            SELECT T.DEPARTID, T.DEPARTNAME, T.PID, T.REMARK, T.ISROOT, T.IDX
			  FROM CORE_APP_DEPARTMENT T
			 WHERE T.PID IN (SELECT DEPARTID
			                   FROM CORE_APP_DEPARTMENT
			                  WHERE LEVEL = 3
			                  START WITH DEPARTID = '141106165312'
			                 CONNECT BY PRIOR DEPARTID = PID)
			 ORDER BY T.PID, T.IDX
        ]]>
    </query>
    <query id="ClsBaseInfo.GetSectionByDepartment" desc="按部门查询科室信息">
        <![CDATA[
            SELECT T.DEPARTID, T.DEPARTNAME, T.PID, T.REMARK, T.ISROOT, T.IDX
              FROM CORE_APP_DEPARTMENT T
             WHERE T.PID = ?
             ORDER BY T.PID, T.IDX
        ]]>
    </query>
</queryMap>