<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="钢级转换">
	<query id="FcaHttSteelChange.doQuery" desc="查询钢级转换">
	  <![CDATA[
			 SELECT
				   T.ID,
				   T.STEEL_CODE,
				   T.STEEL_NAME,
				   T.STEEL_CHANGE,
				   T.CREATE_NAME,
				   TO_CHAR(T.CREATE_TIME, 'YYYY-MM-DD HH24:MI:SS') CREATE_TIME,
				   T.UPDATE_NAME,
				   TO_CHAR(T.UPDATE_TIME, 'YYYY-MM-DD HH24:MI:SS') UPDATE_TIME,
				   T.DELETE_NAME,
				   TO_CHAR(T.DELETE_TIME, 'YYYY-MM-DD HH24:MI:SS') DELETE_TIME,
				   T.VALIDFLAG,
				   T.MEMO
			 FROM HTT_STEEL_CHANGE T
			 WHERE
			 1 = 1
		  ]]>
	</query>

	<query id="FcaHttSteelChange.doAdd" desc="添加钢级转换">
		<![CDATA[
			 INSERT INTO HTT_STEEL_CHANGE(
					ID,
					STEEL_CODE,
					STEEL_NAME,
					STEEL_CHANGE,
					CREATE_NAME,
					CREATE_TIME,
					VALIDFLAG,
					MEMO)
			 VALUES(
					'#ID#',
					'#STEEL_CODE#',
					'#STEEL_NAME#',
					'#STEEL_CHANGE#',
					'#CREATE_NAME#',
					SYSDATE,
					'#VALIDFLAG#',
					'#MEMO#')
		  ]]>
	</query>

	<query id="FcaHttSteelChange.doUpdate" desc="修改钢级转换">
		<![CDATA[
				 UPDATE HTT_STEEL_CHANGE T
				   SET
						T.STEEL_CODE = '#STEEL_CODE#',
						T.STEEL_NAME = '#STEEL_NAME#',
						T.STEEL_CHANGE = '#STEEL_CHANGE#',
						T.UPDATE_NAME = '#UPDATE_NAME#',
						T.UPDATE_TIME = SYSDATE,
						T.VALIDFLAG = '#VALIDFLAG#',
						T.MEMO = '#MEMO#'
				 WHERE
					T.ID = '#ID#'
		  ]]>
	</query>

	<query id="FcaHttSteelChange.doNullifyOrRecover" desc="作废/恢复钢级转换">
		<![CDATA[
			 UPDATE HTT_STEEL_CHANGE T
			   SET
					T.DELETE_NAME = DECODE('#VALIDFLAG#','1',NULL,'0','#DELETE_NAME#'),
					T.DELETE_TIME = DECODE('#VALIDFLAG#','1',NULL,'0',SYSDATE),
					T.VALIDFLAG = '#VALIDFLAG#'
			 WHERE
					T.ID = '#ID#'
		  ]]>
	</query>

</queryMap>