<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="下拉框动态数据获取管理">

	 <query id = "YdmBaseQuery.departQuery" desc = "查询科室的管理部门">
	 SELECT T.DEPARTNAME,T.DEPARTID FROM CORE_APP_DEPARTMENT T WHERE T.DEPTTYPE = '2' and 1=? ORDER BY T.DEPARTID asc
	 </query>
	 <query id = "YdmBaseQuery.departQuery1" desc = "查询科室的管理部门1">
	 SELECT T.DEPARTNAME,T.DEPARTID FROM CORE_APP_DEPARTMENT T WHERE T.DEPARTNAME = ? ORDER BY T.DEPARTID asc
	 </query>
	<query id="YdmBaseQuery.8001" desc="仓储作业所属单位">
		<![CDATA[
			SELECT 
			BASENAME,
			BASECODE
			FROM COM_BASE_INFO
			WHERE VALIDFLAG='1' AND SORTCODE='8001' 
			ORDER BY BASECODE
		]]>
	</query>
	
	<query id="YdmBaseQuery.8002" desc="仓库类别">
		<![CDATA[
		   SELECT BASENAME, MEMO,BASECODE
           FROM COM_BASE_INFO
           WHERE SORTCODE = '8002'
           AND VALIDFLAG = '1'
			
		]]>
	</query>
	
	<query id="YdmBaseQuery.8003" desc="仓库类型">
		<![CDATA[
		   SELECT MEMO, BASENAME,BASECODE
           FROM COM_BASE_INFO
           WHERE SORTCODE = '8003'
           AND VALIDFLAG = '1'
			
		]]>
	</query>
	
	<query id="YdmBaseQuery.8004" desc="料位类型">
		<![CDATA[
			SELECT 
			BASENAME,
			BASECODE
			FROM COM_BASE_INFO
			WHERE VALIDFLAG='1' AND SORTCODE='8004' 
			ORDER BY BASECODE
		]]>
	</query>
	
	<query id="YdmBaseQuery.8005" desc="料位属性">
		<![CDATA[
			SELECT 
			BASENAME,
			BASECODE
			FROM COM_BASE_INFO
			WHERE VALIDFLAG='1' AND SORTCODE='8005' 
			ORDER BY BASECODE
		]]>
	</query>
	
	<query id="YdmBaseQuery.8009" desc="地址编码">
		<![CDATA[
		  SELECT BASENAME, MEMO,BASECODE
          FROM COM_BASE_INFO
          WHERE SORTCODE = '8009'
          AND VALIDFLAG = '1'
			
		]]>
	</query>
	 
	 <query id="YdmBaseQuery.8010" desc="料架类型">
		<![CDATA[
			SELECT 
			BASENAME,
			BASECODE
			FROM COM_BASE_INFO
			WHERE VALIDFLAG='1' AND SORTCODE='8010' 
			ORDER BY BASECODE
		]]>
	</query>
	
	
	
	<query id="YdmBaseQuery.8011" desc="支持空间">
		<![CDATA[
			SELECT 
		    BASENAME,
			BASECODE
			FROM COM_BASE_INFO
			WHERE VALIDFLAG='1' AND SORTCODE='8011' 
			ORDER BY BASECODE
		]]>
	</query>
	
	<query id="YdmBaseQuery.storageEendCode" desc="仓库编号最后一位最大值获取">
		<![CDATA[
		SELECT SUBSTR(STORAGE_NO, 4, 1) AS STORAGE_NO
       FROM YDM_BS_STORAGE
       WHERE STORAGE_NO LIKE '%' || ? || '%'
       ORDER BY STORAGE_NO DESC
		]]>
	</query>
	<query id="YdmBaseQuery.storageMemo" desc="获取编码对应的备注">
		<![CDATA[
			SELECT 
		    MEMO
			FROM COM_BASE_INFO
			WHERE VALIDFLAG='1' AND BASECODE=?
		]]>
	</query>
	<query id="YdmBaseQuery.getSuperior" desc="根据选择的作业单位查上级单位">
		<![CDATA[
			SELECT T.DEPARTID,
		       T.DEPARTNAME,
		       T.PID,
		       (SELECT DEPARTNAME FROM CORE_APP_DEPARTMENT WHERE DEPARTID = T.PID) REMARK
		  FROM CORE_APP_DEPARTMENT T
		 WHERE T.DEPARTID = ?
		 ORDER BY T.DEPARTID
		]]>
	</query> 
	   
</queryMap>