<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">
	<query id="CoreComBaseChemRatio.QUERY" desc="查询">
		<![CDATA[
	     SELECT 
       CHEM_CODE,
       CHEM_CODE CHEM_CODE_OLD,
       CHEM_NAME,
       MIN_SIGN,
       MIN_VALUE,
       MAX_SIGN,
       MAX_VALUE,
       GROUP_TEXT,
       GROUP_TEXT GROUP_TEXT_OLD,
       RATIO_CODE,
       RATIO_CODE RATIO_CODE_OLD,
       RATIO_NAME,
       RATIO_VALUE,
       RATIO_VALUE RATIO_VALUE_OLD,
       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
       FROM COM_BASE_CHEM_RATIO  T
       WHERE T.VALIDFLAG  IN ('1',?)
	        
		]]>
	</query>
	
	<query id="CoreComBaseChemRatio.QUERYChem" desc="查询化学元素">
		<![CDATA[
			  SELECT CHEM_CODE,CHEM_NAME
			  FROM COM_BASE_CHEM T
			  WHERE T.VALIDFLAG = '1'
			  AND CHEM_TYPE = 'A'
			  ORDER BY CHEM_CODE
			  
		]]>
	</query>
	<query id="CoreComBaseChemRatio.QUERYRatio" desc="查询系数名称">
		<![CDATA[
			 SELECT BASECODE,BASENAME
			  FROM COM_BASE_INFO T
			  WHERE T.SORTCODE ='4073'
			  AND T.VALIDFLAG ='1'
		]]>
	</query>
	<query id="CoreComBaseChemRatio.INSERT" desc="新增">
		<![CDATA[
			INSERT INTO COM_BASE_CHEM_RATIO
      (CHEM_CODE,
       CHEM_NAME,
       MIN_SIGN,
       MIN_VALUE,
       MAX_SIGN,
       MAX_VALUE,
       GROUP_TEXT,
       RATIO_CODE,
       RATIO_NAME,
       RATIO_VALUE,
       CREATE_NAME,
       CREATE_TIME,
        MEMO)
      VALUES
      (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, SYSDATE, ?)
				 
		]]>
	</query>
	
	<query id="CoreComBaseChemRatio.UPDATE" desc="修改">
		<![CDATA[
	    
	     UPDATE COM_BASE_CHEM_RATIO
   SET CHEM_CODE   = ?,
       CHEM_NAME   = ?,
       MIN_SIGN    = ?,
       MIN_VALUE   = ?,
       MAX_SIGN    = ?,
       MAX_VALUE   = ?,
       GROUP_TEXT  = ?,
       RATIO_CODE  = ?,
       RATIO_NAME  = ?,
       RATIO_VALUE = ?,
       UPDATE_NAME = ?,
       UPDATE_TIME = SYSDATE,
       MEMO        = ?
   WHERE CHEM_CODE = ?
   AND GROUP_TEXT = ?
   AND RATIO_CODE = ?
   
	     
			  
		]]>
	</query>
	
	<query id="CoreComBaseChemRatio.DELETE" desc="作废">
		<![CDATA[
			  UPDATE COM_BASE_CHEM_RATIO
			  SET VALIDFLAG = '0',
			  DELETE_NAME = ?,
			  DELETE_TIME = SYSDATE
			  WHERE CHEM_CODE = ?
              AND GROUP_TEXT = ?
              AND RATIO_CODE = ?
              
              AND VALIDFLAG = '1'
		]]>
	</query>
	
	<query id="CoreComBaseChemRatio.RESUME" desc="恢复">
		<![CDATA[
			  UPDATE COM_BASE_CHEM_RATIO
			  SET VALIDFLAG = '1',
			  DELETE_NAME = '',
			  DELETE_TIME = ''
			  WHERE CHEM_CODE = ?
              AND GROUP_TEXT = ?
              AND RATIO_CODE = ?
              
              AND VALIDFLAG = '0'
		]]>
	</query>
	
	<query id="CoreComBaseChemRatio.ISREAPT" desc="验证是否重复">
		<![CDATA[
			  SELECT 1
			  FROM  COM_BASE_CHEM_RATIO
			 WHERE CHEM_CODE = ?
              AND GROUP_TEXT = ?
              AND RATIO_CODE = ?
              
		]]>
	</query>
	
</queryMap>