<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
	<query id="CoreWaterPressureStand.QUERYG" desc="水压标准交付 查询">
		<![CDATA[
			SELECT *
  FROM (SELECT W.WIC,
               W.PSC,
               W.MSC,
               DECODE(W.STDSTYLE, 'G', '订货标准', '协议标准') STDSTYLE,
               W.PROCESS_CDOE,
               W.PROCESS_DESC,
               W. MIN_D,
               W.MAX_D,
               W.MIN_H,
               W.MAX_H,
               W.SPEC_JG,
               W.SPEC_JG_DESC,
               W.MODEL_CODE,
               W.MODEL_DESC,
               W.CREATE_NAME,
               TO_CHAR(W.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
               W.UPDATE_NAME,
               TO_CHAR(W.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
               W.DELETE_NAME,
               TO_CHAR(W.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
                DECODE(W.VALIDFLAG, '1', '录入状态','0', '无效','2','提交审核','3','已审核') VALIDFLAG,
               W.MEMO,
               W.PRODUC_HEAD,
               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,
               NVL(P.PRODUCNAME, D.PRODUCNAME) PRODUCNAME,
               NVL(P.STD_NAME, D.STD_NAME) STD_NAME,
               NVL(P.STD_CODE, D.STD_CODE) STD_CODE,
               NVL(P.STEELCODE, D.STEELCODE) STEELCODE,
               NVL(P.STEELNAME, D.STEELNAME) STEELNAME,
               NVL(P.STD_STYLE_DESC, D.STD_STYLE_DESC) STD_STYLE_DESC
          FROM COM_MSC_STD_WATER W
          LEFT JOIN COM_PSC P ON W.PSC = P.PSC
          LEFT JOIN COM_MSC_BL D ON W.PSC = D.PSC_BL
         WHERE LOWER(P.PSC_DESC) || '&' LIKE '%' || LOWER('#PSC_DESC#') || '%' AND
          W.VALIDFLAG IN ('1','2','3', '#VALIDFLAG#') AND W.STDSTYLE IN ('G', 'X')
          AND DECODE('#STD_CODE_NK#', NULL, '1', W.STD_CODE_NK) = DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
          AND DECODE('#WIC#', NULL, '1', WIC) = DECODE('#WIC#', NULL, '1', '#WIC#')
          AND DECODE('#MSC#', NULL, '1', MSC) = DECODE('#MSC#', NULL, '1', '#MSC#')
          AND DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', CODE_JG) = DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', '#CODE_JG#')
		  AND DECODE('#CODE_JG#', NULL, CODE_JG, NULL) IS NULL)
 WHERE LOWER(STD_NAME) || '&' LIKE '%' || LOWER('#STD_NAME#') || '%'
 ORDER BY WIC
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYN" desc="水压标准内控 查询">
		<![CDATA[
SELECT WIC,
       
       DECODE(STDSTYLE,
              'K',
              'Alpha',
              'N',
              '内控',
              'S',
              '试验标准',
              '成分偏差标准') STDSTYLE,
       PROCESS_CDOE,
       PROCESS_DESC,
       STD_CODE_NK,
       STD_NAME_NK,
       MIN_D,
       MAX_D,
       MIN_H,
       MAX_H,
       SPEC_JG,
       SPEC_JG_DESC,
       MODEL_CODE,
       MODEL_DESC,
       CREATE_NAME,
       TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       UPDATE_NAME,
       TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       DELETE_NAME,
       TO_CHAR(DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(VALIDFLAG,
              '1',
              '录入状态',
              '0',
              '无效',
              '2',
              '提交审核',
              '3',
              '已审核') VALIDFLAG,
       MEMO,
       PRODUC_HEAD,
       STEELCODE_NK,
       STEELNAME_NK,
       MODEL_CODE_NK,
       MODEL_DESC_NK,
       PRODUCCODE_NK,
       PRODUCNAME_NK
  FROM COM_MSC_STD_WATER T
 WHERE LOWER(STD_NAME_NK) || '&' LIKE '%' || LOWER('#STD_NAME_NK#') || '%'
   AND VALIDFLAG IN ('1', '2', '3', '#VALIDFLAG#')
   AND DECODE('#STD_CODE_NK#', NULL, '1', STD_CODE_NK) =
       DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
   AND STDSTYLE NOT IN ('G', 'X', 'K')
   AND DECODE('#WIC#', NULL, '1', WIC) =
       DECODE('#WIC#', NULL, '1', '#WIC#')
   AND DECODE('#MSC#', NULL, '1', MSC) =
       DECODE('#MSC#', NULL, '1', '#MSC#')
   AND NVL(INSTR(PRODUCCODE_NK, '#PRODUCCODE_NK#'), 1) > 0
   AND NVL(INSTR(STEELCODE_NK, '#STEELCODE_NK#'), 1) > 0
   AND NVL(INSTR(PROCESS_CDOE, '#PROCESS_CDOE#'), 1) > 0
   AND NVL(INSTR(T.MODEL_CODE_NK, '#MODEL_CODE_NK#'), 1) > 0
   AND DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', CODE_JG) =
       DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', '#CODE_JG#')
   AND DECODE('#CODE_JG#', NULL, CODE_JG, NULL) IS NULL
 ORDER BY WIC
		]]>
	</query>	
	
	<query id="CoreWaterPressureStand.QUERYK" desc="水压标准Alpha 查询">
		<![CDATA[
			SELECT WIC,
                   DECODE(STDSTYLE,'K','Alpha','N','内控','S','试验标准','成分偏差标准') STDSTYLE,
                   PROCESS_CDOE,
                   PROCESS_DESC,
                   STD_CODE_NK,
                   STD_NAME_NK,
                   MIN_D,
                   MAX_D,
                   MIN_H,
                   MAX_H,
                   SPEC_JG,
                   SPEC_JG_DESC,
                   MODEL_CODE,
                   MODEL_DESC,
                   CREATE_NAME,
                   TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
                   UPDATE_NAME,
                   TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
                   DELETE_NAME,
                   TO_CHAR(DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
                  DECODE(VALIDFLAG, '1', '录入状态','0', '无效','2','提交审核','3','已审核') VALIDFLAG,
                   MEMO,
                   PRODUC_HEAD
              FROM COM_MSC_STD_WATER
             WHERE LOWER(STD_NAME_NK) || '&' LIKE '%' || LOWER('#STD_NAME_NK#') || '%'
               AND VALIDFLAG IN ('1','2','3','#STD_NAME_NK#')
               AND DECODE('#STD_CODE_NK#', NULL, '1', STD_CODE_NK) = DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
               AND STDSTYLE='K'
               AND DECODE('#WIC#', NULL, '1', WIC) = DECODE('#WIC#', NULL, '1', '#WIC#')
               AND DECODE('#MSC#', NULL, '1', MSC) = DECODE('#MSC#', NULL, '1', '#MSC#')
               AND DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', CODE_JG) = DECODE('#CODE_JG#', NULL, '1', 'DefaultValue', '1', '#CODE_JG#')
			   AND DECODE('#CODE_JG#', NULL, CODE_JG, NULL) IS NULL
          ORDER BY WIC	
		]]>
	</query>	
	
	<query id="CoreWaterPressureStand.ADD" desc="水压标准 新增">
		<![CDATA[
			INSERT INTO COM_MSC_STD_WATER
                        (WIC,
                        PSC,
                        MSC,
                        STDSTYLE,
                        PROCESS_CDOE,
                        PROCESS_DESC,
                        STD_CODE_NK,
                        STD_NAME_NK,
                        MIN_D,
                        MAX_D,
                        MIN_H,
                        MAX_H,
                        SPEC_JG,
                        SPEC_JG_DESC,
                        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, DEFAULT, ?,?,?,
                       ?, ?, ?, ?, ?, ?)
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.UPDATE" desc="水压标准 修改">
		<![CDATA[
			UPDATE COM_MSC_STD_WATER
               SET WIC          = ?,
                   PSC          = ?,
                   MSC          = ?,
                   STDSTYLE     = ?,
                   PROCESS_CDOE = ?,
                   PROCESS_DESC = ?,
                   STD_CODE_NK  = ?,
                   STD_NAME_NK  = ?,
                   MIN_D        = ?,
                   MAX_D        = ?,
                   MIN_H        = ?,
                   MAX_H        = ?,
                   SPEC_JG      = ?,
                   SPEC_JG_DESC = ?,
                   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 WIC = ?
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.DELETE" desc="水压标准 作废">
		<![CDATA[
			UPDATE COM_MSC_STD_WATER
               SET DELETE_NAME = ?, DELETE_TIME = SYSDATE, VALIDFLAG = '0'
             WHERE WIC = ?	 AND VALIDFLAG= '1'
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.RESUME" desc="水压标准 恢复">
		<![CDATA[
			UPDATE COM_MSC_STD_WATER
               SET DELETE_NAME = '', DELETE_TIME = NULL, VALIDFLAG = '1'
             WHERE WIC = ?	 AND VALIDFLAG= '0'
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYMAXG" desc="水压标准 查询交付标准最大序号">
		<![CDATA[
SELECT MAX(SUBSTR(WIC, 5, 6)) WIC FROM COM_MSC_STD_WATER WHERE STDSTYLE IN ('G', 'X')
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYMAXN" desc="水压标准 查询内控标准最大序号">
		<![CDATA[
SELECT MAX(SUBSTR(WIC, 5, 6)) WIC FROM COM_MSC_STD_WATER WHERE STDSTYLE NOT IN ('G', 'X','K')
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYMAXK" desc="水压标准 查询Alpha最大序号">
		<![CDATA[
SELECT MAX(WIC) WIC FROM COM_MSC_STD_WATER WHERE STDSTYLE='K'
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYGC" desc="水压交付标准从表 查询">
		<![CDATA[
			SELECT WIC,
                   XH,
                   PRESSURE_Y,
                   PRESSURE,
                   FORMULA,
                   SAVE_TIME,
                   CREATE_NAME,
                   TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
                   UPDATE_NAME,
                   TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
                   DELETE_NAME,
                   TO_CHAR(DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
                   DECODE(VALIDFLAG, '1', '有效', '无效') VALIDFLAG,
                   MEMO,
                   DECODE(GET_MAXVALUE,'1','TRUE','FALSE') GET_MAXVALUE,
                   DECODE(GET_MINVALUE,'1','TRUE','FALSE') GET_MINVALUE,
                   ROUND_RULE,
                   A.OUTPUT_STYLE,
                   A.ZBS_OUTPUT_STYLE,
                   A.PRESSURE_BAR
              FROM COM_MSC_STD_WATER_C A
             WHERE WIC LIKE 'WICG%'
               AND VALIDFLAG IN ('1', '#VALIDFLAG#')
               AND EXISTS
    (SELECT 1
       FROM COM_MSC_STD_WATER B
      WHERE B.VALIDFLAG IN ('1','2','3', '#VALIDFLAG#')
       AND DECODE('#STD_CODE_NK#', NULL, '1', B.STD_CODE_NK) = DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
        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 A.WIC = B.WIC)
              ORDER BY XH
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYNC" desc="水压内控标准从表 查询">
		<![CDATA[
SELECT WIC,
                   XH,
                   PRESSURE_Y,
                   PRESSURE,
                   FORMULA,
                   SAVE_TIME,
                   CREATE_NAME,
                   TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
                   UPDATE_NAME,
                   TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
                   DELETE_NAME,
                   TO_CHAR(DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
                   DECODE(VALIDFLAG, '1', '有效', '无效') VALIDFLAG,
                   MEMO,
                   DECODE(GET_MAXVALUE,'1','TRUE','FALSE') GET_MAXVALUE,
                   DECODE(GET_MINVALUE,'1','TRUE','FALSE') GET_MINVALUE,
                   ROUND_RULE,
                   A.OUTPUT_STYLE,
                   A.ZBS_OUTPUT_STYLE,
                   A.PRESSURE_BAR
              FROM COM_MSC_STD_WATER_C A
             WHERE VALIDFLAG IN ('1', '#VALIDFLAG#')
               AND EXISTS
    (SELECT 1
       FROM COM_MSC_STD_WATER B
      WHERE B.VALIDFLAG IN ('1','2','3', '#VALIDFLAG#')
        AND DECODE('#STD_CODE_NK#', NULL, '1', B.STD_CODE_NK) = DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
        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 A.WIC = B.WIC
        AND B.STDSTYLE = 'N')
             ORDER BY XH
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYKC" desc="水压内控标准从表 查询">
		<![CDATA[
			SELECT WIC,
                   XH,
                   PRESSURE_Y,
                   PRESSURE,
                   FORMULA,
                   SAVE_TIME,
                   CREATE_NAME,
                   TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
                   UPDATE_NAME,
                   TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
                   DELETE_NAME,
                   TO_CHAR(DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
                   DECODE(VALIDFLAG, '1', '有效', '无效') VALIDFLAG,
                   MEMO,
                   DECODE(GET_MAXVALUE,'1','TRUE','FALSE') GET_MAXVALUE,
                   DECODE(GET_MINVALUE,'1','TRUE','FALSE') GET_MINVALUE,
                   ROUND_RULE,
                   A.OUTPUT_STYLE,
                   A.ZBS_OUTPUT_STYLE,
                   A.PRESSURE_BAR
              FROM COM_MSC_STD_WATER_C A
             WHERE WIC LIKE 'WICK%'
               AND VALIDFLAG IN ('1', '#VALIDFLAG#')
               AND EXISTS
				    (SELECT 1
				       FROM COM_MSC_STD_WATER B
				      WHERE B.VALIDFLAG IN ('1','2','3', '#VALIDFLAG#')
				        AND DECODE('#STD_CODE_NK#', NULL, '1', B.STD_CODE_NK) = DECODE('#STD_CODE_NK#', NULL, '1', '#STD_CODE_NK#')
				        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 A.WIC = B.WIC)
             ORDER BY XH
		]]>
	</query>
	
	
	<query id="CoreWaterPressureStand.ADDC" desc="水压标准从表 增加">
		<![CDATA[
			INSERT INTO COM_MSC_STD_WATER_C
                       (WIC,
                        XH,
                        PRESSURE_Y,
                        PRESSURE,
                        FORMULA,
                        SAVE_TIME,
                        CREATE_NAME,
                        CREATE_TIME,
                        VALIDFLAG,
                        MEMO,
                        GET_MAXVALUE,
                        GET_MINVALUE,
                        ROUND_RULE,
                        OUTPUT_STYLE,
                        ZBS_OUTPUT_STYLE,
                        PRESSURE_BAR)
                 VALUES
                        (?, ?, ?, ?, ?, ?, ?, SYSDATE, DEFAULT, ?,?,?, ?, ?, ?, ?)
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.UPDATEC" desc="水压标准从表 修改">
		<![CDATA[
			UPDATE COM_MSC_STD_WATER_C
               SET WIC         = ?,
                   XH          = ?,
                   PRESSURE_Y  = ?,
                   PRESSURE    = ?,
                   FORMULA     = ?,
                   SAVE_TIME   = ?,
                   UPDATE_NAME = ?,
                   UPDATE_TIME = SYSDATE,
                   MEMO        = ?,
                   GET_MAXVALUE= ?,
                   GET_MINVALUE= ?,
                   ROUND_RULE = ?,
                   OUTPUT_STYLE = ?,
                   ZBS_OUTPUT_STYLE = ?,
                   PRESSURE_BAR = ?
             WHERE WIC = ?
               AND XH = ?
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.DELETEC" desc="水压标准从表 作废">
		<![CDATA[
			UPDATE COM_MSC_STD_WATER_C
               SET DELETE_NAME = ?, DELETE_TIME = SYSDATE, VALIDFLAG = '0'
             WHERE WIC = ?
               AND XH = ? AND VALIDFLAG= '1'
               AND (SELECT VALIDFLAG FROM COM_MSC_STD_WATER 
                  WHERE WIC = ?) IN ('1', '0')
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.RESUMEC" desc="水压标准从表 恢复">
		<![CDATA[
			UPDATE COM_MSC_STD_WATER_C
               SET DELETE_NAME = '', DELETE_TIME = NULL, VALIDFLAG = '1'
             WHERE WIC = ?
               AND XH = ? AND VALIDFLAG= '0'
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.QUERYMAXC" desc="水压标准从表 查询最大序号">
		<![CDATA[
		     SELECT XH
               FROM COM_MSC_STD_WATER_C
              WHERE XH = (SELECT MAX(XH) XH FROM COM_MSC_STD_WATER_C WHERE WIC = ?)
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.GetRatio" desc="水压标准从表 查询最大序号">
		<![CDATA[
		 SELECT T.RATIO_STD, T.RATIO_REPLACE
         FROM COM_BASE_WATER_RATIO T
         WHERE NVL(T.SIZE_MIN, 0) <= TO_NUMBER(?)
         AND NVL(T.SIZE_MAX, 99999) >= TO_NUMBER(?)
         AND T.STD_NAME = ?
         AND T.VALIDFLAG = '1'
         AND ? IN (SELECT STEELCODE
                   FROM COM_BASE_WATER_RATIO_STEEL T2
                   WHERE T.RATIO_ID = T2.RATIO_ID)
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.getComWicByWic" desc="通过WIC查询水压表">
		<![CDATA[
SELECT * FROM Com_Msc_Std_Water T WHERE T.WIC = '#WIC#'
		]]>
	</query>
	
	<query id="CoreWaterPressureStand.getPurchaseAgreementWic" desc="查询采购的水压主表">
		<![CDATA[
 SELECT A.WIC,
       
       DECODE(A.STDSTYLE,
              'K',
              'Alpha',
              'N',
              '内控',
              'S',
              '试验标准',
              '成分偏差标准') STDSTYLE,
       A.PROCESS_CDOE,
       A.PROCESS_DESC,
       A.STD_CODE_NK,
       A.STD_NAME_NK,
       A.MIN_D,
       A.MAX_D,
       A.MIN_H,
       A.MAX_H,
       A.SPEC_JG,
       A.SPEC_JG_DESC,
       A.MODEL_CODE,
       A.MODEL_DESC,
       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',
              '录入状态',
              '0',
              '无效',
              '2',
              '提交审核',
              '3',
              '已审核') VALIDFLAG,
       A.MEMO,
       A.PRODUC_HEAD,
       A.STEELCODE_NK,
       A.STEELNAME_NK,
       A.MODEL_CODE_NK,
       A.MODEL_DESC_NK,
       A.PRODUCCODE_NK,
       A.PRODUCNAME_NK
  FROM COM_MSC_STD_WATER A, COM_BASE_STD C
 WHERE C.PURCHASE_STD = '1'
   AND C.VALIDFLAG = '1'
   AND C.STD_CODE = A.STD_CODE_NK
   AND A.VALIDFLAG = '1'
   AND A.STD_CODE_NK = {0}
 ORDER BY WIC
		]]>
	</query>
	<query id="CoreWaterPressureStand.getPurchaseAgreementWater" desc="查询采购的水压从表">
		<![CDATA[
SELECT A.WIC,
       A.XH,
       A.PRESSURE_Y,
       A.PRESSURE,
       A.FORMULA,
       A.SAVE_TIME,
       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,
       DECODE(A.GET_MAXVALUE, '1', 'TRUE', 'FALSE') GET_MAXVALUE,
       DECODE(A.GET_MINVALUE, '1', 'TRUE', 'FALSE') GET_MINVALUE
  FROM COM_MSC_STD_WATER_C A, COM_MSC_STD_WATER 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.WIC = B.WIC
   AND A.VALIDFLAG = '1'
   AND B.STD_CODE_NK = {0}
 ORDER BY XH
		]]>
	</query>


	<query id="CoreWaterPressureStand.getComWaterNK" desc="水压标准内控 查询">
		<![CDATA[
SELECT WIC,
       DECODE(STDSTYLE,
              'K',
              'Alpha',
              'N',
              '内控',
              'S',
              '试验标准',
              '成分偏差标准') STDSTYLE,
       PROCESS_CDOE,
       PROCESS_DESC,
       STD_CODE_NK,
       STD_NAME_NK,
       MIN_D,
       MAX_D,
       MIN_H,
       MAX_H,
       SPEC_JG,
       SPEC_JG_DESC,
       MODEL_CODE,
       MODEL_DESC,
       CREATE_NAME,
       TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
       UPDATE_NAME,
       TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
       DELETE_NAME,
       TO_CHAR(DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
       DECODE(VALIDFLAG,
              '1',
              '录入状态',
              '0',
              '无效',
              '2',
              '提交审核',
              '3',
              '已审核') VALIDFLAG,
       MEMO,
       PRODUC_HEAD,
       STEELCODE_NK,
       STEELNAME_NK,
       MODEL_CODE_NK,
       MODEL_DESC_NK,
       PRODUCCODE_NK,
       PRODUCNAME_NK
  FROM COM_MSC_STD_WATER T
 WHERE 	VALIDFLAG = '1'
	AND WIC IN (
	SELECT
		TO_CHAR( REGEXP_SUBSTR( WIC, '[^,]+', 1, LEVEL ) ) WIC
	FROM
		( SELECT WM_CONCAT ( WIC ) WIC, MSC FROM COM_MSC_PROCESS B WHERE B.MSC = 'MSC0005573032' GROUP BY MSC ) CONNECT BY LEVEL <= REGEXP_COUNT ( WIC, ',' ) + 1
		AND MSC = PRIOR MSC
	AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
	)
 ORDER BY WIC
		]]>
	</query>

	<query id="CoreWaterPressureStand.getComWaterNKC" desc="水压内控标准从表 查询">
		<![CDATA[
	SELECT WIC,
	   XH,
	   PRESSURE_Y,
	   PRESSURE,
	   FORMULA,
	   SAVE_TIME,
	   CREATE_NAME,
	   TO_CHAR(CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
	   UPDATE_NAME,
	   TO_CHAR(UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
	   DELETE_NAME,
	   TO_CHAR(DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
	   DECODE(VALIDFLAG, '1', '有效', '无效') VALIDFLAG,
	   MEMO,
	   DECODE(GET_MAXVALUE,'1','TRUE','FALSE') GET_MAXVALUE,
	   DECODE(GET_MINVALUE,'1','TRUE','FALSE') GET_MINVALUE,
	   ROUND_RULE,
	   A.OUTPUT_STYLE,
	   A.ZBS_OUTPUT_STYLE,
	   A.PRESSURE_BAR
  FROM COM_MSC_STD_WATER_C A
 WHERE VALIDFLAG = '1'
	AND WIC IN (
	SELECT
		TO_CHAR( REGEXP_SUBSTR( WIC, '[^,]+', 1, LEVEL ) ) WIC
	FROM
		( SELECT WM_CONCAT ( WIC ) WIC, MSC FROM COM_MSC_PROCESS B WHERE B.MSC = 'MSC0005573032' GROUP BY MSC ) CONNECT BY LEVEL <= REGEXP_COUNT ( WIC, ',' ) + 1
		AND MSC = PRIOR MSC
	AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
	)
 ORDER BY XH
		]]>
	</query>
</queryMap>