<?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" />

<og:head headType="result" useAjaxSubmit="true" />
<jsp:directive.include file="/jsp/custom/result_info.jsp" />
<og:comment
	system	= "GF:エンジンサンプル"
	pgid	= "GF2180"
	title	= "テーブル"
	date	= "2014/05/01"
	author	= "K.Hasegawa"
	text	= ""
	version	= "001"
/>

<og:columnCheck
	command="NEW" nullCheck="SYSTEM_ID"
/>

<!-- ここでは、GF84に存在しないテーブルのみ検索します。 -->
<og:query command="NEW" debug="{@debug}" maxRowCount="0">
		select SYSTEM_ID , TABLE_NAME , NAME_JA
				, JKENSU as SUIKOU , 0 as NOJUN , '0' as CDIKOU
		from GF02
		where not exists (
			select 'X' from GF84
			where GF02.SYSTEM_ID  = GF84.SYSTEM_ID
			and   GF02.TABLE_NAME = GF84.TABLE_NAME
		)
	<og:where startKey="and">
		<og:and value = "FGJ			in   ('0','1')"				/>
		<og:and value = "SYSTEM_ID		=    '{@SYSTEM_ID}'"		/>
		<og:and value = "TBLSYU			=    '{@TBLSYU}'"			/>
		<og:and value = "TABLE_NAME		like '{@TABLE_NAME}'"		/>
	</og:where>
	order by SYSTEM_ID,TBLSYU,TABLE_NAME
</og:query>

<!-- 取りあえず、検索順は一番最後に入れておきます。 -->
<og:value command="SQL">
	select max(NOJUN) AS MAX_NOJUN from GF84
	where SYSTEM_ID = '{@SYSTEM_ID}' and FGJ in ('0','1')
</og:value>

<og:tableFilter classId="SEQRESET" keys="SEQ_CLM,START_NO" vals="NOJUN,{@MAX_NOJUN}" selectedAll="true" />

<form method="POST" action="forward.jsp" target="RESULT" >
	<og:writeCheck>
		<og:submit  action="ENTRY" />
		<og:submit  action="RESET" />
		<og:input type="reset" name="command" lbl="MSG0011" td="false" />
	<br />
	</og:writeCheck>

	<og:view
		viewFormType	= "HTMLTable"
		command			= "NEW"
		checked			= "true"
		startNo			= "{@startNo}"
		pageSize		= "10000"
	/>

	<og:hidden name="sqlType" defaultVal="INSERT" value="{@sqlType}" />
</form>

<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
