<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="水压试验标准表查询">
	<query id="CoreProcessWater.QUERY" desc="权限功能">
		<![CDATA[
			SELECT  MSC,
				    DECODE(STDSTYLE,'N','内控','K','客户','G','国标/国际/协议') STDSTYLE,
				    XH,
					MIN_D,
					MAX_D,
					MIN_H,
					MAX_H,
					SPEC_JG,
					SPEC_JG_DESC,
					MODEL_CODE,
					MODEL_DESC,
					PRESSURE_Y,
					PRESSURE,
					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,
					MEMO,
					VALIDFLAG
				FROM COM_MSC_STD_WATER
				   WHERE VALIDFLAG in ('1' , ?) order by XH asc
		]]>
	</query>
	<query id="CoreProcessWater.ADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_MSC_STD_WATER
							(
						    MSC,
			          	    STDSTYLE,
			           	    XH,
					        MIN_D,
					        MAX_D,
					        MIN_H,
							MAX_H,
							SPEC_JG,
							SPEC_JG_DESC,
							MODEL_CODE,
							MODEL_DESC,
							PRESSURE_Y,
					        CREATE_NAME,
					        CREATE_TIME,
					        MEMO,
					        PRESSURE,
					        SAVE_TIME)
							VALUES(?,?,(select nvl(max(XH),'0')+1 as XH from COM_MSC_STD_WATER),?,?,?,?,?,?,?,?,?,
							?,TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							?,?,?)
							
			  
		]]>
	</query>
	<query id="CoreProcessWater.Update" desc="修改">
		<![CDATA[
			 UPDATE COM_MSC_STD_WATER set
							MIN_D=?, 
							MAX_D=?, 
							MIN_H=?, 
							MAX_H=?,
							SPEC_JG=?,
							SPEC_JG_DESC=?,
							MODEL_CODE=?,
							MODEL_DESC=?,
							PRESSURE_Y=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=TO_DATE(?, 'yyyy-mm-dd hh24:mi:ss'),
							MEMO=?, 
							PRESSURE=?,
							SAVE_TIME=?
							WHERE MSC=? and STDSTYLE=? and XH=to_number(?)
		]]>
	</query>
	<query id="CoreProcessWater.DELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_MSC_STD_WATER T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			WHERE MSC=? and STDSTYLE=? and XH=to_number(?)
		]]>
	</query>
	
	<query id="CoreProcessWater.RESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_MSC_STD_WATER T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE MSC=? and STDSTYLE=? and XH=to_number(?)
		]]>
	</query>
</queryMap>