<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="加工要求">

      <query id="CoreComMscStdProcess.SetGroupSeq" desc="更新分组索引号">
        <![CDATA[      
            UPDATE COM_MSC_STD_PROCESS_C  SET GROUP_SEQ=?
            WHERE GIC=? AND XH=? AND VALIDFLAG='1'
	     ]]>
	  </query>
	  
	  
      <query id="CoreComMscStdProcess.CanleGroupSeq" desc="更新分组索引号">
        <![CDATA[      
            UPDATE COM_MSC_STD_PROCESS_C  SET GROUP_SEQ=''
            WHERE GIC=? AND XH=? AND VALIDFLAG='1'
	     ]]>
	  </query>
	  
     <query id="CoreComMscStdProcess.GetGroupSeq" desc="取得分组索引号">
        <![CDATA[      
            SELECT MAX(GROUP_SEQ) GROUP_SEQ FROM COM_MSC_STD_PROCESS_C WHERE GIC=?   
	     ]]>
	  </query>
	  
    <query id="CoreComMscStdProcess.GetStation" desc="主表成分索引号 交互">
		<![CDATA[
			 SELECT
     T.STATION_CODE, T.STATION_DESC, T.PROCESS_CODE, T.PROCESS_DESC
     FROM COM_BASE_STATION T
     WHERE T.VALIDFLAG = '1'
     AND T.PROCESS_CODE = 'G'
     AND T.STATION_TYPE = '403208'
			 
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.GetProcess" desc="主表成分索引号 交互">
		<![CDATA[
	  SELECT PROCESS_CODE, PROCESS_DESC
      FROM COM_BASE_PROCESS
      WHERE VALIDFLAG = '1'
      AND PROCESS_CODE = 'G'
	 
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.MAXCICG" desc="主表成分索引号 交互">
		<![CDATA[
SELECT MAX(SUBSTR(GIC, 5, 6)) FROM COM_MSC_STD_PROCESS WHERE GIC  LIKE 'GICG%'
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.MAXCICN" desc="主表成分索引号 内控">
		<![CDATA[
SELECT MAX(SUBSTR(GIC, 5, 6)) FROM COM_MSC_STD_PROCESS WHERE STDSTYLE = 'N'
		]]>
	</query>
	
	 
		
	<query id="CoreComMscStdProcess.MAXINDEXSEQ" desc="从表化学成分序号">
		<![CDATA[
			SELECT XH
              FROM COM_MSC_STD_PROCESS_C
             WHERE XH =
                   (SELECT MAX(XH) INDEX_SEQ FROM COM_MSC_STD_PROCESS_C WHERE GIC = ?)
		]]>
	</query>
	
    <query id="CoreComMscStdProcess.QUERYG" desc="主表查询 交互标准">
		<![CDATA[
			SELECT T.*,'FALSE' CHC
            FROM (SELECT C.GIC,
               C.PSC,
               C.MSC,
               NVL(P.PSC_DESC,
                   D.PRODUCNAME || ',' || D.STD_NAME || ',' || D.STEELNAME || ',' ||
                   D.STD_STYLE_DESC || ',' || D.MODEL_DESC || ',' || D.MIN_D || ',' ||
                   D.MIN_H || ',' || D.USE_DESC) PSC_DESC,
               DECODE(C.STDSTYLE, 'G', '订货标准', 'X', '协议标准', '') STDSTYLE,
               C.STD_CODE_NK,
               C.STD_NAME_NK,
               C.PROCESS_CDOE,
               C.PROCESS_DESC,
               C.MODEL_CODE,
               C.MODEL_DESC,
               C.CREATE_NAME,
               TO_CHAR(C.CREATE_TIME, 'yyyy-mm-dd hh24:mi:ss') CREATE_TIME,
               C.UPDATE_NAME,
               TO_CHAR(C.UPDATE_TIME, 'yyyy-mm-dd hh24:mi:ss') UPDATE_TIME,
               C.DELETE_NAME,
               TO_CHAR(C.DELETE_TIME, 'yyyy-mm-dd hh24:mi:ss') DELETE_TIME,
               DECODE(C.VALIDFLAG, '1', '录入状态','0', '无效','2','提交审核','3','已审核') VALIDFLAG,
               C.MEMO,
               C.PRODUC_HEAD,
               NVL(P.PRODUCNAME, D.PRODUCNAME) PRODUCNAME,
               NVL(P.STD_NAME, D.STD_NAME)   STD_NAME,
               NVL(P.STEELNAME, D.STEELNAME) STEELNAME,
               NVL(P.STD_STYLE_DESC, D.STD_STYLE_DESC) STD_STYLE_DESC
          FROM COM_MSC_STD_PROCESS C
          LEFT JOIN COM_PSC P ON C.PSC = P.PSC
          LEFT JOIN COM_MSC_BL D ON C.PSC = D.PSC_BL
          WHERE lower(C.MSC) || '&' LIKE '%' || lower('#MSC#') || '%'
           AND C.VALIDFLAG in ('1','2','3', '#VALIDFLAG#')
           AND DECODE('#STD_CODE_NK#', NULL, '1', C.STD_CODE_NK) = DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
           AND C.STDSTYLE in ('G', 'X')
           AND DECODE('#GIC#', NULL, '1', C.GIC) = DECODE('#GIC#', NULL, '1', '#GIC#')
           AND DECODE('#MSC2#', NULL, '1', C.MSC) = DECODE('#MSC2#', NULL, '1', '#MSC2#')
           AND DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', C.CODE_JG) = DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', '#CODE_JG#')
		   AND DECODE('#CODE_JG#', NULL, C.CODE_JG, NULL) IS NULL) T
          WHERE lower(STD_NAME) || '&' LIKE '%' || lower('#STD_NAME#') || '%'
          ORDER BY GIC
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.QUERYOTHER" desc="主表查询 其它标准">
       <![CDATA[
SELECT C.GIC,
       'FALSE' CHC,
       C.PSC,
       C.MSC,
       DECODE(C.STDSTYLE,
              'N',
              '内控',
              'K',
              'Alpha',
              'S',
              '试验标准',
              'P',
              '成分偏差标准',
              '') STDSTYLE,
       C.STD_CODE_NK,
       C.STD_NAME_NK,
       C.PROCESS_CDOE,
       C.PROCESS_DESC,
       C.MODEL_CODE,
       C.MODEL_DESC,
       C.CREATE_NAME,
       TO_CHAR(C.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       C.UPDATE_NAME,
       TO_CHAR(C.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       C.DELETE_NAME,
       TO_CHAR(C.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(C.VALIDFLAG,
              '1',
              '录入状态',
              '0',
              '无效',
              '2',
              '提交审核',
              '3',
              '已审核') VALIDFLAG,
       C.MEMO,
       C.PRODUC_HEAD,
       C.STEELCODE_NK,
       C.STEELNAME_NK,
       C.MODEL_CODE_NK,
       C.MODEL_DESC_NK,
       C.PRODUCCODE_NK,
       C.PRODUCNAME_NK
  FROM COM_MSC_STD_PROCESS C
 WHERE UPPER(C.STD_NAME_NK) || '&' LIKE
       UPPER('%' || '#STD_NAME_NK#' || '%')
   AND C.VALIDFLAG IN ('1', '2', '3', '#VALIDFLAG#')
   AND DECODE('#STD_CODE_NK#', NULL, '1', C.STD_CODE_NK) =
       DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
   AND DECODE('#GIC#', NULL, '1', C.GIC) =
       DECODE('#GIC#', NULL, '1', '#GIC#')
   AND DECODE('#MSC2#', NULL, '1', C.MSC) =
       DECODE('#MSC2#', NULL, '1', '#MSC2#')
   AND DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', C.CODE_JG) =
       DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', '#CODE_JG#')
   AND DECODE('#CODE_JG#', NULL, C.CODE_JG, NULL) IS NULL
   AND NVL(INSTR(C.PRODUCCODE_NK, '#PRODUCCODE_NK#'), 1) > 0
   AND NVL(INSTR(C.STEELCODE_NK, '#STEELCODE_NK#'), 1) > 0
   AND NVL(INSTR(C.PROCESS_CDOE, '#PROCESS_CDOE#'), 1) > 0
   AND NVL(INSTR(C.MODEL_CODE_NK, '#MODEL_CODE_NK#'), 1) > 0
   AND C.STDSTYLE IN
       (DECODE('#STDSTYLE#', '2', 'N', '3', 'K', 'P'),
        DECODE('#STDSTYLE#', '2', '', '3', '', 'S'))
 ORDER BY C.GIC
		]]>
	</query>	
	
	<query id="CoreComMscStdProcess.QUERYCG" desc="从表查询 交互标准">
		<![CDATA[
SELECT A.GIC,
       'FALSE' CHC,
       A.XH,
       A.STATION_CODE,
       A.STATION_DESC,
       A.PROCESS_CDOE,
       A.PROCESS_DESC,
       A.PROCESS_CDOE_C,
       A.PROCESS_DESC_C,
       A.VALUE_TEXT,
       A.VALUE_NUM,
       A.VALUE_MEMO,
       A.GROUP_SEQ,
       A.CREATE_NAME,
       TO_CHAR(A.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       A.UPDATE_NAME,
       TO_CHAR(A.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       A.DELETE_NAME,
       TO_CHAR(A.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(A.VALIDFLAG, '1', '有效', '无效') VALIDFLAG,
       A.MEMO,
       A.MIN_D,
       A.MAX_D,
       A.MIN_H,
       A.MAX_H,
       A.MIN_D_SIGN,
       A.MAX_D_SIGN,
       A.MIN_H_SIGN,
       A.MAX_H_SIGN
  FROM COM_MSC_STD_PROCESS_C A
 WHERE EXISTS
 (SELECT 1
          FROM COM_MSC_STD_PROCESS B
         WHERE UPPER(B.STD_NAME_NK) || '&' LIKE
               UPPER('%' || '#STD_NAME_NK#' || '%')
           AND UPPER(B.MSC) || '&' LIKE UPPER('%' || '#MSC#' || '%')
           AND A.VALIDFLAG IN ('1', '#VALIDFLAG#')
           AND DECODE('#STD_CODE_NK#', NULL, '1', B.STD_CODE_NK) =
               DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
           AND DECODE('#GIC#', NULL, '1', B.GIC) =
               DECODE('#GIC#', NULL, '1', '#GIC#')
           AND DECODE('#MSC2#', NULL, '1', B.MSC) =
               DECODE('#MSC2#', NULL, '1', '#MSC2#')
           AND DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', B.CODE_JG) =
               DECODE('#CODE_JG#',
                      NULL,
                      '1',
                      'DefaultValue',
                      '1',
                      '#CODE_JG#')
           AND DECODE('#CODE_JG#', NULL, B.CODE_JG, NULL) IS NULL
           AND B.STDSTYLE IN ('G', 'X')
           AND A.GIC = B.GIC)
 ORDER BY A.GIC, XH
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.QUERYCOTHER" desc="从表查询 其它标准">
		<![CDATA[
SELECT A.GIC,
       'FALSE' CHC,
       A.XH,
       A.STATION_CODE,
       A.STATION_DESC,
       A.PROCESS_CDOE,
       A.PROCESS_DESC,
       A.PROCESS_CDOE_C,
       A.PROCESS_DESC_C,
       A.VALUE_TEXT,
       A.VALUE_NUM,
       A.VALUE_MEMO,
       A.GROUP_SEQ,
       A.CREATE_NAME,
       TO_CHAR(A.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       A.UPDATE_NAME,
       TO_CHAR(A.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       A.DELETE_NAME,
       TO_CHAR(A.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(A.VALIDFLAG, '1', '有效', '无效') VALIDFLAG,
       A.MIN_D,
       A.MAX_D,
       A.MIN_H,
       A.MAX_H,
       A.MIN_D_SIGN,
       A.MAX_D_SIGN,
       A.MIN_H_SIGN,
       A.MAX_H_SIGN
  FROM COM_MSC_STD_PROCESS_C A
 WHERE EXISTS
 (SELECT 1
          FROM COM_MSC_STD_PROCESS B
         WHERE UPPER(B.STD_NAME_NK) || '&' LIKE
               UPPER('%' || '#STD_NAME_NK#' || '%')
           AND A.VALIDFLAG IN ('1', '#VALIDFLAG#')
           AND DECODE('#STD_CODE_NK#', NULL, '1', B.STD_CODE_NK) =
               DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
           AND DECODE('#GIC#', NULL, '1', B.GIC) =
               DECODE('#GIC#', NULL, '1', '#GIC#')
           AND DECODE('#MSC#', NULL, '1', B.MSC) =
               DECODE('#MSC#', NULL, '1', '#MSC#')
           AND DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', B.CODE_JG) =
               DECODE('#CODE_JG#',
                      NULL,
                      '1',
                      'DefaultValue',
                      '1',
                      '#CODE_JG#')
           AND DECODE('#CODE_JG#', NULL, B.CODE_JG, NULL) IS NULL
           AND NVL(INSTR(B.PRODUCCODE_NK, '#PRODUCCODE_NK#'), 1) > 0
           AND NVL(INSTR(B.STEELCODE_NK, '#STEELCODE_NK#'), 1) > 0
           AND NVL(INSTR(B.PROCESS_CDOE, '#PROCESS_CDOE#'), 1) > 0
           AND NVL(INSTR(B.MODEL_CODE_NK, '#MODEL_CODE_NK#'), 1) > 0
           AND B.STDSTYLE IN
               (DECODE('#STDSTYLE#', '2', 'N', '3', 'K', 'P'),
                DECODE('#STDSTYLE#', '2', '', '3', '', 'S'))
           AND A.GIC = B.GIC)
 ORDER BY A.GIC, XH
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.ADD" desc="主表增加">
		<![CDATA[
	    INSERT INTO COM_MSC_STD_PROCESS
        (GIC,
        PSC,
        MSC,
        STDSTYLE,
        PROCESS_CDOE,
        PROCESS_DESC,
        STD_CODE_NK,
        STD_NAME_NK,
        MODEL_CODE,
        MODEL_DESC,
        CREATE_NAME,
        CREATE_TIME,  
         VALIDFLAG,
        MEMO,
        PRODUC_HEAD,
        CODE_JG,
        STEELCODE_NK,
        STEELNAME_NK,
        MODEL_CODE_NK,
        MODEL_DESC_NK,
        PRODUCCODE_NK,
        PRODUCNAME_NK)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, SYSDATE,'1', ?, ?, ?,
        ?, ?, ?, ?, ?, ?)

		]]>
	</query>
	
	<query id="CoreComMscStdProcess.ADD1" desc="从表增加">
		<![CDATA[
			 INSERT INTO COM_MSC_STD_PROCESS_C
         (GIC,
         XH,
         STATION_CODE,
         STATION_DESC,
         PROCESS_CDOE,
         PROCESS_DESC,
         PROCESS_CDOE_C,
         PROCESS_DESC_C,
         VALUE_TEXT,
         VALUE_NUM,
         VALUE_MEMO,
         CREATE_NAME,
         CREATE_TIME,
         VALIDFLAG,
         MEMO,
         GROUP_SEQ,
         MIN_D,
         MAX_D,
         MIN_H,
         MAX_H,
         MIN_D_SIGN,
         MAX_D_SIGN,
         MIN_H_SIGN,
         MAX_H_SIGN)
         VALUES  (?,?, ?,?, ?, ?, ?, ?, ?,?,?,?,SYSDATE,'1',?, ?,
         ?, ?, ?, ?, ?, ?, ?, ?)
			 
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.UPDATE" desc="主表修改">
		<![CDATA[		
             UPDATE COM_MSC_STD_PROCESS
        SET 
        PSC = ?,
        MSC = ?,
        STDSTYLE = ?,
        PROCESS_CDOE = ?,
        PROCESS_DESC = ?,
        STD_CODE_NK = ?,
        STD_NAME_NK = ?,
        MODEL_CODE =  ?,
        MODEL_DESC =  ?,
        UPDATE_NAME = ?,
        UPDATE_TIME = SYSDATE,
        MEMO = ?,
        PRODUC_HEAD = ?,
        CODE_JG = ?,
        STEELCODE_NK = ?,
        STEELNAME_NK = ?,
        MODEL_CODE_NK = ?,
        MODEL_DESC_NK = ?,
        PRODUCCODE_NK = ?,
        PRODUCNAME_NK = ?
        WHERE  GIC = ?
 
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.UPDATE1" desc="从表修改">
		<![CDATA[		
        UPDATE COM_MSC_STD_PROCESS_C
   SET 
        STATION_CODE = ?,
        STATION_DESC = ?,
        PROCESS_CDOE = ?,
        PROCESS_DESC = ?,
        PROCESS_CDOE_C = ?,
        PROCESS_DESC_C = ?,
        VALUE_TEXT = ?,
        VALUE_NUM = ?,
        VALUE_MEMO = ?,
        UPDATE_NAME = ?,
        UPDATE_TIME = SYSDATE,
        MEMO = ?,
        GROUP_SEQ = ?,
        MIN_D = ?,
        MAX_D = ?,
        MIN_H = ?,
        MAX_H = ?,
        MIN_D_SIGN = ?,
        MAX_D_SIGN = ?,
        MIN_H_SIGN = ?,
        MAX_H_SIGN = ?
        WHERE GIC = ? 
        AND XH = ?
		]]>
	</query>
	
	
	<query id="CoreComMscStdProcess.DELETE" desc="主表删除">
		<![CDATA[
		 UPDATE 	COM_MSC_STD_PROCESS
		SET VALIDFLAG='0',DELETE_NAME=?,DELETE_TIME=SYSDATE
		WHERE GIC = ? AND VALIDFLAG ='1'
		]]>
	</query>
	
	
	<query id="CoreComMscStdProcess.RESUME" desc="主表恢复">
		<![CDATA[
			UPDATE COM_MSC_STD_PROCESS
		SET VALIDFLAG='1',DELETE_NAME='',DELETE_TIME=NULL
		WHERE GIC = ? AND VALIDFLAG ='0'
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.DELETE1" desc="从表删除">
		<![CDATA[
			UPDATE 	COM_MSC_STD_PROCESS_C
		SET VALIDFLAG='0',DELETE_NAME=?,DELETE_TIME=SYSDATE
		WHERE GIC = ?   AND XH = ? AND VALIDFLAG ='1'
		AND (SELECT VALIDFLAG FROM COM_MSC_STD_PROCESS
             WHERE GIC = ?) IN ('1', '0')
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.RESUME1" desc="从表恢复">
		<![CDATA[
			UPDATE 	COM_MSC_STD_PROCESS_C
		SET VALIDFLAG='1',DELETE_NAME='',DELETE_TIME=NULL
		WHERE GIC = ?   AND XH = ?  AND VALIDFLAG ='0'
		]]>
	</query>
	
	<query id="CoreComMscStdProcess.getComGicByGic" desc="通过Gic获取加工表">
		<![CDATA[
SELECT * FROM Com_Msc_Std_Process T WHERE T.GIC = '#GIC#'
		]]>
	</query>
	<query id="CoreComMscStdProcess.getPurchaseAgreementGic" desc="获取采购的加工主表">
		<![CDATA[
SELECT C.GIC,
       'FALSE' CHC,
       C.PSC,
       C.MSC,
       DECODE(C.STDSTYLE,
              'N',
              '内控',
              'K',
              'Alpha',
              'S',
              '试验标准',
              'P',
              '成分偏差标准',
              '') STDSTYLE,
       C.STD_CODE_NK,
       C.STD_NAME_NK,
       C.PROCESS_CDOE,
       C.PROCESS_DESC,
       C.MODEL_CODE,
       C.MODEL_DESC,
       C.CREATE_NAME,
       TO_CHAR(C.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       C.UPDATE_NAME,
       TO_CHAR(C.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       C.DELETE_NAME,
       TO_CHAR(C.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(C.VALIDFLAG,
              '1',
              '录入状态',
              '0',
              '无效',
              '2',
              '提交审核',
              '3',
              '已审核') VALIDFLAG,
       C.MEMO,
       C.PRODUC_HEAD,
       C.STEELCODE_NK,
       C.STEELNAME_NK,
       C.MODEL_CODE_NK,
       C.MODEL_DESC_NK,
       C.PRODUCCODE_NK,
       C.PRODUCNAME_NK
  FROM COM_MSC_STD_PROCESS C, COM_BASE_STD A
 WHERE A.PURCHASE_STD = '1'
   AND A.VALIDFLAG = '1'
   AND C.STD_CODE_NK = A.STD_CODE
   AND C.VALIDFLAG = '1'
   AND C.STD_CODE_NK = {0}
 ORDER BY C.GIC
		]]>
	</query>
	<query id="CoreComMscStdProcess.getPurchaseAgreementProc" desc="获取采购的加工从表">
		<![CDATA[
SELECT A.GIC,
       'FALSE' CHC,
       A.XH,
       A.STATION_CODE,
       A.STATION_DESC,
       A.PROCESS_CDOE,
       A.PROCESS_DESC,
       A.PROCESS_CDOE_C,
       A.PROCESS_DESC_C,
       A.VALUE_TEXT,
       A.VALUE_NUM,
       A.VALUE_MEMO,
       A.GROUP_SEQ,
       A.CREATE_NAME,
       TO_CHAR(A.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       A.UPDATE_NAME,
       TO_CHAR(A.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       A.DELETE_NAME,
       TO_CHAR(A.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(A.VALIDFLAG, '1', '有效', '无效') VALIDFLAG
  FROM COM_MSC_STD_PROCESS_C A, COM_MSC_STD_PROCESS B, COM_BASE_STD C
 WHERE C.PURCHASE_STD = '1' 
   AND C.VALIDFLAG = '1'
   AND C.STD_CODE = B.STD_CODE_NK
   AND B.VALIDFLAG = '1'
   AND A.GIC = B.GIC
   AND A.VALIDFLAG = '1'
   AND B.STD_CODE_NK = {0}
 ORDER BY A.GIC, XH
		]]>
	</query>


	<query id="CoreComMscStdProcess.getComProcessNK" desc="主表查询 其它标准">
		<![CDATA[
SELECT C.GIC,
       'FALSE' CHC,
       C.PSC,
       C.MSC,
       DECODE(C.STDSTYLE,
              'N',
              '内控',
              'K',
              'Alpha',
              'S',
              '试验标准',
              'P',
              '成分偏差标准',
              '') STDSTYLE,
       C.STD_CODE_NK,
       C.STD_NAME_NK,
       C.PROCESS_CDOE,
       C.PROCESS_DESC,
       C.MODEL_CODE,
       C.MODEL_DESC,
       C.CREATE_NAME,
       TO_CHAR(C.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       C.UPDATE_NAME,
       TO_CHAR(C.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       C.DELETE_NAME,
       TO_CHAR(C.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(C.VALIDFLAG,
              '1',
              '录入状态',
              '0',
              '无效',
              '2',
              '提交审核',
              '3',
              '已审核') VALIDFLAG,
       C.MEMO,
       C.PRODUC_HEAD,
       C.STEELCODE_NK,
       C.STEELNAME_NK,
       C.MODEL_CODE_NK,
       C.MODEL_DESC_NK,
       C.PRODUCCODE_NK,
       C.PRODUCNAME_NK
  FROM COM_MSC_STD_PROCESS C
 WHERE VALIDFLAG = '1' and
		GIC IN (
		SELECT
			TO_CHAR(REGEXP_SUBSTR( GIC, '[^,]+', 1, LEVEL )) GIC
		FROM
			( SELECT WM_CONCAT ( GIC ) GIC, MSC FROM COM_MSC_PROCESS B WHERE B.MSC = '#MSC#' GROUP BY MSC ) CONNECT BY LEVEL <= REGEXP_COUNT ( GIC, ',' ) + 1
			AND MSC = PRIOR MSC
			AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
		)
 ORDER BY C.GIC
		]]>
	</query>

	<query id="CoreComMscStdProcess.getComProcessNKC" desc="从表查询 其它标准">
		<![CDATA[
SELECT A.GIC,
       'FALSE' CHC,
       A.XH,
       A.STATION_CODE,
       A.STATION_DESC,
       A.PROCESS_CDOE,
       A.PROCESS_DESC,
       A.PROCESS_CDOE_C,
       A.PROCESS_DESC_C,
       A.VALUE_TEXT,
       A.VALUE_NUM,
       A.VALUE_MEMO,
       A.GROUP_SEQ,
       A.MIN_D,
       A.MAX_D,
       A.MIN_H,
       A.MAX_H,
       A.MIN_D_SIGN,
       A.MAX_D_SIGN,
       A.MIN_H_SIGN,
       A.MAX_H_SIGN
  FROM COM_MSC_STD_PROCESS_C A
 WHERE VALIDFLAG = '1' and
		GIC IN (
		SELECT
			TO_CHAR(REGEXP_SUBSTR( GIC, '[^,]+', 1, LEVEL )) GIC
		FROM
			( SELECT WM_CONCAT ( GIC ) GIC, MSC FROM COM_MSC_PROCESS B WHERE B.MSC = '#MSC#' GROUP BY MSC ) CONNECT BY LEVEL <= REGEXP_COUNT ( GIC, ',' ) + 1
			AND MSC = PRIOR MSC
			AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
		)
 ORDER BY A.GIC, XH
		]]>
	</query>
</queryMap>