<?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 T.DEPTTYPE = '2'
		     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.DEPTTYPE = '3'
             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>
    
    <query id="ClsBaseInfo.getDepartmentBySectionID" desc="查询科室对应的部门">
        <![CDATA[
            SELECT T.DEPARTNAME, T.DEPARTID
			  FROM CORE_APP_DEPARTMENT T, CORE_APP_DEPARTMENT A
			 WHERE A.PID = T.DEPARTID
			   AND A.DEPARTID = ?
        ]]>
    </query>
    
    <query id="ClsBaseInfo.getDepartDescByDepartId" desc="根据部门表的ID获取对应的描述">
        <![CDATA[
            SELECT T.DEPARTNAME
			  FROM CORE_APP_DEPARTMENT T
			   WHERE T.DEPARTID = '#DEPARTID#'
        ]]>
    </query>
</queryMap>