<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld" 
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<!-- add -->
<og:equals val1="{@execType}" val2="0">

	<og:equals val1="{@init}" val2="true" notEquals="true">
		<og:value command="SQL" dbid="{@SYS.DEV_DBID}">
			select coalesce(max(SEQ),0) + 10 SEQ
			from GF92
			where SYSTEM_ID = '{@systemId}'
			and PGID = '{@pgId}'
			and NMSYORI = 'RESULT'
		</og:value>

		<og:value command="SET" key="seq" value="{@SEQ}" />
	</og:equals>

	<og:value command="SQL" dbid="{@SYS.DEV_DBID}">
		select CLS_NAME
		from GF05
		where SYSTEM_ID = 'GE'
		and TBLSYU = 'D'
		and TABLE_NAME = '{@tableId}'
		and CLM = '{@column}'
	</og:value>
	<og:value command="SET" key="dbCls" value="{@CLS_NAME}" />

	<og:text>
	<div tableId="{@tableId}" asTable="{@asTable}" column="{@column}" seq="{@seq}" dbCls="{@dbCls}" class="divColumn">
		<p class="selTitle ptitle" title="{@tableName}"><span class="close" title="{@LBL.CLOSE}">{@LBL.CLOSEBUTTON}</span><span class="astable">({@asTable})</span>{@tableName}</p>
		<p class="selTitle ptitle" title="{@columnName}">{@columnName}</p>
		<table>
			<tr><td><og:column name="x" optionAttributes="group='RESULT' attrcol='ZOKUSEI'"
						editor="MENU" codeName="RESULT_ZOKUSEI" defaultVal="DISP" td="false"  addNoValue="false" /></td></tr>
			<tr><td><og:column name="x" optionAttributes="group='RESULT' attrcol='USE_ORDER'"
						editor="CHBOX" td="false" /></td></tr>
			<tr><td><og:column name="x" optionAttributes="group='RESULT' attrcol='AS_CLM'"
						editor="TEXT" td="false" size="5" /></td></tr>
<!--
			<tr><td><og:column name="x" optionAttributes="group='RESULT' attrcol='MUST'"
						editor="CHBOX" td="false" /></td></tr>
			<tr><td><og:column name="x" optionAttributes="group='RESULT' attrcol='DEFAULT_VAL'"
						editor="TEXT" td="false" size="5" /></td></tr>
-->
			<tr><td><og:column name="x" optionAttributes="group='QUERY' attrcol='ZOKUSEI'"
						editor="MENU" codeName="QUERY_ZOKUSEI" td="false" addNoValue="true" /></td></tr>
			<tr><td><og:column name="x" optionAttributes="group='QUERY' attrcol='MUST'"
						editor="CHBOX" td="false" /></td></tr>
			<tr><td><og:column name="x" optionAttributes="group='QUERY' attrcol='DEFAULT_VAL'"
						editor="TEXT" td="false" size="5" /></td></tr>
			<tr><td><og:column name="x" optionAttributes="group='CONST' attrcol='ZOKUSEI'"
						editor="TEXT" td="false" size="5" /></td></tr>
		</table>
	</div>
	</og:text>

	<og:equals val1="{@init}" val2="true" notEquals="true">
		<og:query displayMsg="" notfoundMsg="" dbid="{@SYS.DEV_DBID}">
			insert into GF92(
				SYSTEM_ID, PGID, TABLE_NAME, AS_TABLE, CLM, NMSYORI, SEQ, ZOKUSEI, CLS_NAME
			) values (
				'{@systemId}', '{@pgId}', '{@tableId}', '{@asTable}', '{@column}', 'RESULT', {@seq}, 'DISP', '{@dbCls}'
			)
		</og:query>

		<og:query displayMsg="" notfoundMsg="" dbid="{@SYS.DEV_DBID}">
			insert into GF92(
				SYSTEM_ID, PGID, TABLE_NAME, AS_TABLE, CLM, NMSYORI, SEQ, CLS_NAME
			) values (
				'{@systemId}', '{@pgId}', '{@tableId}', '{@asTable}', '{@column}', 'QUERY', {@seq}, '{@dbCls}'
			)
		</og:query>

		<og:query displayMsg="" notfoundMsg="" dbid="{@SYS.DEV_DBID}">
			insert into GF92(
				SYSTEM_ID, PGID, TABLE_NAME, AS_TABLE, CLM, NMSYORI, SEQ, CLS_NAME
			) values (
				'{@systemId}', '{@pgId}', '{@tableId}', '{@asTable}', '{@column}', 'CONST', {@seq}, '{@dbCls}'
			)
		</og:query>
	</og:equals>
</og:equals>

<!-- remove -->
<og:equals val1="{@execType}" val2="9">
	<og:query displayMsg="" notfoundMsg="" dbid="{@SYS.DEV_DBID}">
		delete from GF92
		where SYSTEM_ID = '{@systemId}'
		and PGID = '{@pgId}'
		and TABLE_NAME = '{@tableId}'
		and AS_TABLE = '{@asTable}'
		and CLM = '{@column}'
		and NMSYORI in ('RESULT','QUERY','CONST')
	</og:query>
</og:equals>

</jsp:root>
