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


	<query id="CoreTubeRolling.isOnly" desc="判断是否唯一">
		<![CDATA[
			select PLINE_CODE,PASS_CODE,SPEC_CODE from COM_MSC_ROLL_R_BILLET where PLINE_CODE=? and PASS_CODE=? and SPEC_CODE=?
		]]>
	</query>


	<query id="CoreTubeRolling.isGGType" desc="获取指定产品规格代码">
		<![CDATA[
			select SPEC_CODE from COM_MSC_ROLL_R_BILLET where SPEC_CODE=?
		]]>
	</query>
	
	<query id="CoreTubeRolling.isKType" desc="获取指定孔型代码">
		<![CDATA[
			select PASS_CODE from COM_MSC_ROLL_R_BILLET where PASS_CODE=?
		]]>
	</query>

	<query id="CoreTubeRolling.isProLineInfo" desc="获取指定产线代码">
		<![CDATA[
			select PLINE_CODE from COM_MSC_ROLL_R_BILLET where PLINE_CODE=?
		]]>
	</query>

	<query id="CoreTubeRolling.GetGGType" desc="获取管坯规格和描述">
		<![CDATA[
			select SPEC_CODE,SPEC_NAME from COM_BASE_SPEC where MSC_STYLE='B'
		]]>
	</query>
	
	<query id="CoreTubeRolling.GetKType" desc="获取孔型代码和描述">
		<![CDATA[
			select BASECODE,BASENAME from com_base_info where sortcode='4047'
		]]>
	</query>

	<query id="CoreTubeRolling.GetProLineInfo" desc="获取产线代码和描述">
		<![CDATA[
			select PLINE_CODE,PLINE_NAME from com_base_pline
		]]>
	</query>
	<query id="CoreTubeRolling.QUERY" desc="权限功能">
		<![CDATA[
			SELECT  PLINE_CODE,
				    PLINE_NAME,
				    PASS_CODE,
					PASS_NAME,
					SPEC_CODE,
					SPEC_NAME,
					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,
					VALIDFLAG,
					decode(VALIDFLAG,'1','有效','无效') VALIDFLAGNAME,
					MEMO
				FROM COM_MSC_ROLL_R_BILLET
				   WHERE VALIDFLAG in ('1' , ?)
				   AND lower(PLINE_NAME)||'&' LIKE '%' || lower(?) || '%'  ORDER BY PLINE_CODE
		]]>
	</query>
	<query id="CoreTubeRolling.ADD" desc="新增">
		<![CDATA[
			 INSERT INTO COM_MSC_ROLL_R_BILLET
							(PLINE_CODE,
					        PLINE_NAME,
					        PASS_CODE,
							PASS_NAME,
					        SPEC_CODE,
					        SPEC_NAME,
					        CREATE_NAME,
					        CREATE_TIME,
					        VALIDFLAG,
					        MEMO)
							VALUES(?,?,?,?,?,?,
							?,SYSDATE,
							'1',?)
							
			  
		]]>
	</query>
	<query id="CoreTubeRolling.MODIFY" desc="修改">
		<![CDATA[
			 UPDATE COM_MSC_ROLL_R_BILLET set
			 				PLINE_CODE=?,
							PLINE_NAME=?, 
							PASS_CODE=?, 
							PASS_NAME=?, 
							SPEC_CODE=?,
							SPEC_NAME=?,
							UPDATE_NAME=?, 
							UPDATE_TIME=SYSDATE,
							MEMO=? WHERE PLINE_CODE=? and PASS_CODE=? and SPEC_CODE=?
		]]>
	</query>
	<query id="CoreTubeRolling.DELETE" desc="作废">
		<![CDATA[
			 UPDATE COM_MSC_ROLL_R_BILLET T
			   SET T.DELETE_NAME = ?, T.DELETE_TIME = SYSDATE, T.VALIDFLAG = '0'
			 WHERE T.PLINE_CODE = ? AND T.PASS_CODE=? AND T.SPEC_CODE=?
		]]>
	</query>
	
	<query id="CoreTubeRolling.RESUME" desc="恢复">
		<![CDATA[
			UPDATE COM_MSC_ROLL_R_BILLET T
               SET T.DELETE_NAME = '', T.DELETE_TIME = '', T.VALIDFLAG = '1'
             WHERE T.PLINE_CODE = ? AND T.PASS_CODE=? AND T.SPEC_CODE=?
		]]>
	</query>
</queryMap>