<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
	<query id="CorePscSelect.doQuery" desc="查询">
		<![CDATA[
	 SELECT PC.PSC,
       PC.PSC_DESC,
       PC.PRODUCCODE,
       PC.PRODUCNAME,
       PC.STD_CODE,
       PC.STD_NAME,
       PC.STEELCODE,
       PC.STEELNAME,
       PC.STD_STYLE,
       PC.STD_STYLE_DESC,
       PC.NEW_PROC_CODE,
       PC.NEW_PROC_DESC,
       PC.PRODUC_STYLE,
       PC.NEW_PROC_CODE,
       PC.NEW_PROC_DESC,
       A.MSC,
       A.MSC_DESC,
       B.MSC_STYLE,
       B.USE_CODE,
       B.USE_DESC,
       DECODE(B.VALIDFLAG,'C','生效','D','无效','未生效') VALIDFLAG,
       B.UNIT_DESC
  FROM COM_PSC PC, COM_PSC_R_MSC A, COM_MSC B
 WHERE PC.PSC_DESC || '&' LIKE '%' || ? || '%'
   AND A.MSC = B.MSC
   AND B.MSC_SEQ IS NULL
   AND INSTR(PC.PSC_DESC, '备料管') <= 0
   AND A.PSC = PC.PSC
   AND PC.VALIDFLAG = '1'
   AND A.VALIDFLAG = '1'
   AND B.VALIDFLAG != 'D'
   AND EXISTS (SELECT 1
          FROM COM_BASE_STD T
         WHERE T.STD_CODE = PC.STD_CODE
           AND T.FORBIDDEN_ORDER = '0')
   AND NOT EXISTS (SELECT PRODUCCODE
          FROM COM_BASE_PRODUCT T
         WHERE T.VALIDFLAG = '0'
           AND PC.PRODUCCODE = T.PRODUCCODE)
   AND NOT EXISTS (SELECT STD_CODE
          FROM COM_BASE_STD A
         WHERE A.VALIDFLAG = '0'
           AND PC.STD_CODE = A.STD_CODE)
   AND NOT EXISTS (SELECT STEELCODE
          FROM COM_BASE_STEEL B
         WHERE B.VALIDFLAG = '0'
           AND PC.STEELCODE = B.STEELCODE)
   AND NOT EXISTS (SELECT STD_STYLE
          FROM COM_BASE_STD_STYLE C
         WHERE C.VALIDFLAG = '0'
           AND PC.STD_STYLE = C.STD_STYLE)
 ORDER BY PSC_DESC
		]]>
	</query>
	<query id="CorePscSelect.doQueryForbiddenOrder" desc="查询标准是否禁用合同录入">
		<![CDATA[
			SELECT T.FORBIDDEN_ORDER,T.STD_NAME
			FROM COM_BASE_STD T
			WHERE T.STD_CODE = ( SELECT STD_CODE FROM COM_MSC WHERE MSC = ? ) and t.VALIDFLAG = '1'
		]]>
	</query>
</queryMap>