<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="钢管倒库出库管理">
<query id = "PipeManageClassInfo.getDepartmentBySectionID" desc = "通过科室找部门ID">
        <![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="PipeManageClassInfo.queryStorage" desc="仓库号查询">
		<![CDATA[
		select t.STORAGE_NO,t.STORAGE_NAME from YDM_BS_STORAGE t  
		where 
		t.STORAGE_TYPE_NO  LIKE '%'|| ? ||'%' 
		and t.STORAGE_ATTR LIKE '%'|| ? ||'%'  
		and t.MANAGEMENT_NO LIKE '%'|| ? ||'%' 
		order by t.STORAGE_NAME asc
		]]>
	</query>
	<query id = "PipeManageClassInfo.getStoreNo" desc = "根据数据权限查询仓库">
	select t.STORAGE_NO,t.STORAGE_NAME from YDM_BS_STORAGE t where 1=1 #CONDITION#
	</query>
	<query id="PipeManageClassInfo.queryLocation" desc="料位号查询">
		<![CDATA[
	    select LOCATION_NO,LOCATION_NAME from YDM_BS_LOCATION where storage_no LIKE '%'|| ? ||'%'  order by LOCATION_NO asc
		]]>
	</query>
	<query id="PipeManageClassInfo.queryType" desc="作业类型查询">
		<![CDATA[     
	    SELECT  T.BASECODE, T.BASENAME,T.MEMO
	       FROM COM_BASE_INFO T
	       WHERE T.VALIDFLAG = '1'
	       AND T.BASECODE = ?
	       ORDER BY T.BASENAME ASC
		]]>
	</query>
	<query id="PipeManageClassInfo.queryPline" desc="查询产线">
		<![CDATA[     
	   select t.PLINE_CODE,t.PLINE_NAME from COM_BASE_PLINE t
	    where DEPARTMENT_CODE =? and t.VALIDFLAG='1' ORDER BY t.PLINE_NAME ASC
		]]>
	</query>
	<query id="PipeManageClassInfo.queryInList" desc="查询入库单号">
		<![CDATA[
	     select INSTOCK_DOC from ydm_zc_inlist 
	     where CREATE_TIME LIKE '%'|| to_date(?,'YYYY/MM/DD')||'%' 
	     and INSTOCK_TYPE_CODE=?
	     order by INSTOCK_DOC desc
		]]>
	</query>
	<query id="PipeManageClassInfo.queryMaterial" desc="查询物料">
		<![CDATA[     
	   SELECT T.MATERIAL_NO,T.MATERIAL_DESC,T.PRODUCCODE,T.PRODUCNAME,T.STD_STYLE,
			T.STD_STYLE_DESC, T.STEELCODE,T.STEELNAME,T.GRADECODE,T.GRADENAME,T.DIMATER,
			T.HEIGHT,T.SPEC_CODE,T.SPEC_NAME,T.MODEL_CODE,T.MODEL_DESC 
			FROM SLM_BASE_MATERIAL T 
			WHERE 1=1 AND T.MATERIAL_NO LIKE'%'||?||'%'
		]]>
	</query>
	<query id="PipeManageClassInfo.queryModel" desc="查询扣型">
		<![CDATA[     
	   SELECT T.MODEL_CODE,T.MODEL_DESC FROM COM_BASE_MODEL T WHERE 1=1 AND T.MODEL_DESC LIKE '%'||?||'%' ORDER BY T.MODEL_DESC ASC
		]]>
	</query>
</queryMap>