<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="仓库权限">

	<query id="WarehousePermissions.getWarehousePermissions" 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.VALIDFLAG='1'	      
		]]>
	</query>
<query id="WarehousePermissions.getWarehousePermissionsStore" desc="获取仓库权限">
		<![CDATA[
	      SELECT T.STORAGE_NO, T.STORAGE_NAME
  FROM YDM_BS_STORAGE T
 WHERE  T.VALIDFLAG='1'	      
		]]>
	</query>
	<query id="WarehousePermissions.getLocationNoByStorageNo" desc="查料架">
		<![CDATA[
	     SELECT T.LOCATION_NAME,T.LOCATION_NO FROM YDM_BS_LOCATION T WHERE T.STORAGE_NO = ? ORDER BY T.LOCATION_NO ASC
		]]>
	</query>
	<query id = "WarehousePermissions.getPlineValiData" desc = "获取产线">
	SELECT T.PLINE_CODE,T.PLINE_NAME FROM COM_BASE_PLINE T WHERE T.VALIDFLAG = '1'
	</query>
<query id = "WarehousePermissions.getWarehousePermissionsBelog" desc = "获取科室对应产线权限">
SELECT T.DEPARTID AS DEPARTMENT_CODE,T.DEPARTNAME AS DEPARTMENT_DESC FROM CORE_APP_DEPARTMENT T WHERE 1=1
</query>
	<query id="WarehousePermissions.getMaterialInfo" desc="物料编码信息">
		<![CDATA[
	      SELECT MATERIAL_NO,
       MATERIAL_DESC,
       PRODUCCODE,
       PRODUCNAME,
       PRODUC_JX,
       PRODUC_ENG,
       STD_STYLE,
       STD_STYLE_DESC,
       STEELCODE,
       STEELNAME,
       GRADECODE,
       GRADENAME,
       DIMATER,
       HEIGHT,
       SPEC_CODE,
       SPEC_NAME,
       MODEL_CODE,
       MODEL_DESC,
       OUTSRC_ALLOW,
       FIRST_PRDC,
       CREATE_NAME,
       CREATE_TIME,
       UPDATE_NAME,
       UPDATE_TIME,
       DELETE_NAME,
       DELETE_TIME
  FROM SLM_BASE_MATERIAL T
  ORDER BY T.MATERIAL_NO     
		]]>
	</query>

	<query id="WarehousePermissions.getOrderUnitBySalg" desc="订货单位（销售组织权限）">
		SELECT
		DISTINCT T1.CUSTOMER_NO, T1.CUSTOMER_NM
		FROM SLM_BASE_CUSTOMER T1,
		SLM_BASE_CUSTM_USE T2
		WHERE T1.CUSTOMER_NO = T2.CUSTOMER_NO
		AND
		T1.VALIDFLAG = '1'
		AND T2.VALIDFLAG = '1'
		AND T2.CUSTM_USE='100202'
	</query>

	<query id="WarehousePermissions.getReceivingUnitBySalg" desc="收货单位（销售组织权限）">
		SELECT
		DISTINCT T1.CUSTOMER_NO, T1.CUSTOMER_NM
		FROM SLM_BASE_CUSTOMER
		T1, SLM_BASE_CUSTM_USE T2
		WHERE T1.CUSTOMER_NO = T2.CUSTOMER_NO
		AND
		T1.VALIDFLAG = '1'
		AND T2.VALIDFLAG = '1'
		AND T2.CUSTM_USE='100203'
	</query>
	
	
	<query id="WarehousePermissions.getSalgPermissions" desc="获取销售组织权限">
		<![CDATA[
	      SELECT DISTINCT T.SALE_ORG FROM SLM_BASE_SALE_AREA_TYP T WHERE T.VALIDFLAG = '1'      
		]]>
	</query>
	
	<query id = "WarehousePermissions.getSection" desc = "获取科室权限">
SELECT DISTINCT T.SALE_AREA_NO FROM SLM_BASE_SALE_AREA_TYP T WHERE T.VALIDFLAG = '1'
</query>
<query id = "WarehousePermissions.getBaseSection" desc = "基础信息科室权限">
select t.departid,t.departname from core_app_department t where t.depttype = '3'
</query>
<query id = "WarehousePermissions.isGetVaild" desc = "是否启用数据权限">
SELECT * FROM CORE_APP_SROLE T WHERE T.ID = ? AND T.DATAFLAG = '1'
</query>
<query id = "WarehousePermissions.isGetVaildBelong" desc = "是否启用了所属权">
SELECT * FROM YDM_BS_PURVIEW_M T WHERE T.ROLEID = ? AND T.IS_BELONG_PURVIEW = '1'
</query>
<query id = "WarehousePermissions.getBelongVaild" desc = "获取所属权权限">
SELECT T.BELONG_ID FROM YDM_BS_PURVIEW_D T WHERE T.DEPART_ID IN (?,?)
</query>
<query id = "WarehousePermissions.getPlineCode" desc = "获取产线代码">
SELECT T.PLINE_CODE,T.PLINE_NAME FROM COM_BASE_PLINE T WHERE T.VALIDFLAG='1'
</query>
</queryMap>