<?xml version="1.0" encoding="UTF-8"?>
<queryMap desc="权限功能表查询">

	
	<query id="CoreStandardSpray.GetMaxIndexSeq" desc="获取喷标主表序号最大值">
		<![CDATA[
			select max(INDEX_SEQ) from COM_MSC_STD_SIGN
		]]>
	</query>
	
	<query id="CoreStandardSpray.GetMaxIndexSeqC" desc="获取喷标从表序号最大值">
		<![CDATA[
			select max(INDEX_SEQ_C) from COM_MSC_STD_SIGN_C
		]]>
	</query>



	<query id="CoreStandardSpray.GetJG" desc="获取接箍限制规格代码和描述">
		<![CDATA[
			select SPEC_CODE,SPEC_NAME from COM_BASE_SPEC where MSC_STYLE='C'
		]]>
	</query>

	<query id="CoreStandardSpray.GetSizeCode" desc="获取限制规格代码和描述">
		<![CDATA[
			select BASECODE,BASENAME from com_base_info where sortcode='4003'
		]]>
	</query>
	
	<query id="CoreStandardSpray.GetSpray" desc="权限功能">
		<![CDATA[
			SELECT 
		       'FALSE' CHK,
		       MSC,
		       INDEX_SEQ,
		       MODEL_CODE,
		       MODEL_DESC,
		       SIZE_CODE2,
		       SIZE_NAME2,
		       SIZE_MIN_SIGN2,
		       SIZE_MIN2,
		       SIZE_MAX_SIGN2,
		       SIZE_MAX2,
		       SIZE_CODE,
		       SIZE_NAME,
		       SIZE_MIN_SIGN,
		       SIZE_MIN,
		       SIZE_MAX_SIGN,
		       SIZE_MAX,
		       SIZE_JG,
		       CREATE_NAME,
		       CREATE_TIME,
		       UPDATE_NAME,
		       UPDATE_TIME,
		       DELETE_NAME,
		       DELETE_TIME,
		       VALIDFLAG,
		       decode(VALIDFLAG,'1','有效','无效') VALIDFLAGNAME,
		       MEMO
       		FROM COM_MSC_STD_SIGN WHERE MSC=? and VALIDFLAG IN('1', '0')
		]]>
	</query>
	
	<query id="CoreStandardSpray.GetSprayC" desc="从表查询">
		<![CDATA[
			SELECT 
		       'FALSE' CHKC,
		       	MSC,
				INDEX_SEQ,
				INDEX_SEQ_C,
				SIGN_ITEM,
				SIGN_SOURCE,
				SIGN_NOTE,
				SIGN_FIELD,
		        CREATE_NAME,
		        CREATE_TIME,
		        VALIDFLAG,
		       decode(VALIDFLAG,'1','有效','无效') VALIDFLAGNAME,
		       MEMO
       		FROM COM_MSC_STD_SIGN_C WHERE MSC=? and VALIDFLAG IN('1', '0')
		]]>
	</query>
	
	
	<query id="CoreStandardSpray.GetMSC" desc="获取冶金规范码">
		<![CDATA[ 
		      SELECT T.MSC,T.MSC_DESC
		      FROM COM_MSC T
		]]>
	</query>
	
	
	<query id="CoreStandardSpray.ADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_MSC_STD_SIGN
							(MSC,
							INDEX_SEQ,
							MODEL_CODE,
							MODEL_DESC,
							SIZE_CODE2,
							SIZE_NAME2,
							SIZE_MIN_SIGN2,
							SIZE_MIN2,
							SIZE_MAX_SIGN2,
							SIZE_MAX2,
							SIZE_CODE,
							SIZE_NAME,
							SIZE_MIN_SIGN,
							SIZE_MIN,
							SIZE_MAX_SIGN,
							SIZE_MAX,
							SIZE_JG,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO)
							VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,
							?,SYSDATE,
							'1',?)
							
			  
		]]>
	</query>
	<query id="CoreStandardSpray.MODIFY" desc="修改">
		<![CDATA[
			 UPDATE COM_MSC_STD_SIGN set
			 				MODEL_CODE=?,
							MODEL_DESC=?,
							SIZE_CODE2=?,
							SIZE_NAME2=?,
							SIZE_MIN_SIGN2=?,
							SIZE_MIN2=?,
							SIZE_MAX_SIGN2=?,
							SIZE_MAX2=?,
							SIZE_CODE=?,
							SIZE_NAME=?,
							SIZE_MIN_SIGN=?,
							SIZE_MIN=?,
							SIZE_MAX_SIGN=?,
							SIZE_MAX=?,
							SIZE_JG=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=SYSDATE,
							MEMO=? 
							WHERE MSC=? and INDEX_SEQ=?
		]]>
	</query>
	
	<query id="CoreStandardSpray.DELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_MSC_STD_SIGN T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.INDEX_SEQ=?
		]]>
	</query>
	<query id="CoreStandardSpray.RESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_MSC_STD_SIGN T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.INDEX_SEQ=?
		]]>
	</query>
	
	
	
	
	<query id="CoreStandardSpray.ADDC" desc="从表新增">
		<![CDATA[
			 INSERT INTO COM_MSC_STD_SIGN_C
							(MSC,
							INDEX_SEQ,
							INDEX_SEQ_C,
							SIGN_ITEM,
							SIGN_SOURCE,
							SIGN_NOTE,
							SIGN_FIELD,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO)
							VALUES(?,?,?,?,?,?,?,
							?,SYSDATE,
							'1',?)
							
			  
		]]>
	</query>
	<query id="CoreStandardSpray.MODIFYC" desc="从表修改">
		<![CDATA[
			 UPDATE COM_MSC_STD_SIGN_C set
							SIGN_ITEM=?,
							SIGN_SOURCE=?,
							SIGN_NOTE=?,
							SIGN_FIELD=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=SYSDATE,
							MEMO=? 
							WHERE MSC=? and INDEX_SEQ=? and INDEX_SEQ_C=?
		]]>
	</query>
	
	<query id="CoreStandardSpray.DELETEC" desc="从表作废">
		<![CDATA[
			 UPDATE COM_MSC_STD_SIGN_C T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE INDEX_SEQ_C=?
		]]>
	</query>
	<query id="CoreStandardSpray.RESUMEC" desc="从表恢复">
		<![CDATA[
			UPDATE COM_MSC_STD_SIGN_C T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE INDEX_SEQ_C=?
		]]>
	</query>
</queryMap>