<?xml version="1.0" encoding="UTF-8" ?>
<jsp:directive.page pageEncoding="UTF-8" />


<style type="text/css">
	table.wd100 td { width: 100px;}
</style>

<table class="wd100">
	<!-- 帳票要求ﾃｰﾌﾞﾙ GE50 REP01 -->
	<tr>
		<td>
			<og:link gamenId="REP01" href="index.jsp" target="CONTENTS"
				keys="command,SYSTEM_ID,USRUPD,DYUPDFROM,DYUPDTO"
				vals="NEW,{@SYSTEM_ID},{@USRUPD},{@DYUPDFROM},{@DYUPDTO}" >{@LBL.REP01}
			</og:link>
		</td>
		<td>GE50.xml</td><td id="GE50"></td>
	</tr>

	<!-- 帳票ﾃﾞｰﾀﾃｰﾌﾞﾙ GE51 REP02 -->
	<tr>
		<td>
			<og:link gamenId="REP02" href="index.jsp" target="CONTENTS"
				keys="command,SYSTEM_ID,USRUPD,DYUPDFROM,DYUPDTO"
				vals="NEW,{@SYSTEM_ID},{@USRUPD},{@DYUPDFROM},{@DYUPDTO}" >{@LBL.REP02}
			</og:link>
		</td>
		<td>GE51.xml</td><td id="GE51"></td>
	</tr>

	<!-- RFIDﾚｲｱｳﾄﾃｰﾌﾞﾙ GE58 REP14 -->
	<tr>
		<td>
			<og:link gamenId="REP14" href="index.jsp" target="CONTENTS"
				keys="command,SYSTEM_ID,USRUPD,DYUPDFROM,DYUPDTO,FGJ"
				vals="NEW,{@SYSTEM_ID},{@USRUPD},{@DYUPDFROM},{@DYUPDTO},{@FGJ}" >{@LBL.REP14}
			</og:link></td>
		<td>GE58.xml</td><td id="GE58"></td>
	</tr>
<table>
=============================================================================<br />

<!-- 帳票要求ﾃｰﾌﾞﾙ GE50 REP01 -->
<og:text caseNN="{@VIEW}">******************** GE50 {@LBL.GE50} ********************</og:text>
	<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}" dbid="{@DBID}" notfoundMsg="">
		select YKNO,GROUPID,LISTID,JOKEN,FGKAN,OUT_DIR,OUT_FILE,COMMENTS,SYSTEM_ID,PDF_PASSWD,SUDATA,SUPAGE,
				FGJ,DYSET,DYUPD,USRSET,USRUPD,PGSET,PGUPD
		from GE50
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ       = '1'
		<og:where startKey="and">
			<og:and value = "FGJ	=  '{@FGJ}'"				/>
			<og:and value = "USRUPD	=  '{@USRUPD}'"				/>
			<og:and value = "DYUPD	>= '{@DYUPDFROM}000000'"	/>
			<og:and value = "DYUPD	<= '{@DYUPDTO}999999'"		/>
		</og:where>
			order by SYSTEM_ID,YKNO
	</og:query>

	<script type="text/javascript">
		ge50 = document.getElementById("GE50");
		ge50.textContent = "<og:text>{@DB.COUNT}</og:text>";
	</script>

	<og:view command="{@command}" selectedType="none" useScrollBar="false" pageSize="{@pageSize}" caseNN="{@VIEW}" />

	<og:writeTable
		fileURL        = "{@DIR}"
		filename       = "GE50.xml"
		writerClass    = "XML"
		encode         = "UTF-8" >
		<og:writeTableParam key="TableName" value="GE50" />
		<og:equals val1="{@EXT_SQL}" val2="DELETE" >
			<og:writeTableParam key="First" >
				delete from GE50 where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
			</og:writeTableParam>
		</og:equals>
		<og:equals val1="{@EXT_SQL}" val2="MERGE" >
		  <og:writeTableParam key="MergeSql" >
			update GE50
			set
				GROUPID		= [GROUPID]
			,	LISTID		= [LISTID]
			,	JOKEN		= [JOKEN]
			,	FGKAN		= [FGKAN]
			,	OUT_DIR 	= [OUT_DIR]
			,	OUT_FILE	= [OUT_FILE]
			,	COMMENTS	= [COMMENTS]
			,	PDF_PASSWD	= [PDF_PASSWD]
			,	SUDATA		= [SUDATA]
			,	SUPAGE		= [SUPAGE]
			,	FGJ			= [FGJ]
			,	DYSET		= [DYSET]
			,	DYUPD		= [DYUPD]
			,	USRSET		= [USRSET]
			,	USRUPD		= [USRUPD]
			,	PGSET		= [PGSET]
			,	PGUPD		= [PGUPD]
			where 	SYSTEM_ID	= [SYSTEM_ID]
			and		YKNO		= [YKNO]
		  </og:writeTableParam>
		</og:equals>
	</og:writeTable>

<!-- 帳票ﾃﾞｰﾀﾃｰﾌﾞﾙ GE51 REP02 -->
<og:text caseNN="{@VIEW}">******************** GE51 {@LBL.GE51} ********************</og:text>
	<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}" dbid="{@DBID}" notfoundMsg="">
		select YKNO,EDNO,KBTEXT,TEXT_DATA,SYSTEM_ID,
				FGJ,DYSET,DYUPD,USRSET,USRUPD,PGSET,PGUPD
		from GE51
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		and   FGJ       = '1'
		<og:where startKey="and">
			<og:and value = "FGJ	=  '{@FGJ}'"				/>
			<og:and value = "USRUPD	=  '{@USRUPD}'"				/>
			<og:and value = "DYUPD	>= '{@DYUPDFROM}000000'"	/>
			<og:and value = "DYUPD	<= '{@DYUPDTO}999999'"		/>
		</og:where>
		order by SYSTEM_ID,YKNO,EDNO
	</og:query>

	<script type="text/javascript">
		ge51 = document.getElementById("GE51");
		ge51.textContent = "<og:text>{@DB.COUNT}</og:text>";
	</script>

	<og:view command="{@command}" selectedType="none" useScrollBar="false" pageSize="{@pageSize}" caseNN="{@VIEW}" />

	<og:writeTable
		fileURL        = "{@DIR}"
		filename       = "GE51.xml"
		writerClass    = "XML"
		encode         = "UTF-8" >
		<og:writeTableParam key="TableName" value="GE51" />
		<og:equals val1="{@EXT_SQL}" val2="DELETE" >
			<og:writeTableParam key="First" >
				delete from GE51 where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
			</og:writeTableParam>
		</og:equals>
		<og:equals val1="{@EXT_SQL}" val2="MERGE" >
		  <og:writeTableParam key="MergeSql" >
			update GE51
			set
				KBTEXT		= [KBTEXT]
			,	TEXT_DATA	= [TEXT_DATA]
			,	FGJ			= [FGJ]
			,	DYSET		= [DYSET]
			,	DYUPD		= [DYUPD]
			,	USRSET		= [USRSET]
			,	USRUPD		= [USRUPD]
			,	PGSET		= [PGSET]
			,	PGUPD		= [PGUPD]
			where 	SYSTEM_ID	= [SYSTEM_ID]
			and		YKNO		= [YKNO]
			and		EDNO		= [EDNO]
		  </og:writeTableParam>
		</og:equals>
	</og:writeTable>

<!-- RFIDﾚｲｱｳﾄﾃｰﾌﾞﾙ GE58 REP14 -->
<og:text caseNN="{@VIEW}">******************** GE58 {@LBL.GE58} ********************</og:text>
	<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}" dbid="{@DBID}" notfoundMsg="">
		select LISTID,CLM,KBOUT,SYSTEM_ID,
				DATA1,DATA2,DATA3,DATA4,DATA5,DATA6,DATA7,DATA8,DATA9,DATA10,DATA11,DATA12,DATA13,DATA14,DATA15,
				FGJ,DYSET,DYUPD,USRSET,USRUPD,PGSET,PGUPD
		from GE58
		where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
		<og:where startKey="and">
			<og:and value = "FGJ	=  '{@FGJ}'"				/>
			<og:and value = "USRUPD	=  '{@USRUPD}'"				/>
			<og:and value = "DYUPD	>= '{@DYUPDFROM}000000'"	/>
			<og:and value = "DYUPD	<= '{@DYUPDTO}999999'"		/>
		</og:where>
		order by SYSTEM_ID,LISTID,LISTID,CLM
	</og:query>

	<script type="text/javascript">
		ge58 = document.getElementById("GE58");
		ge58.textContent = "<og:text>{@DB.COUNT}</og:text>";
	</script>

	<og:view command="{@command}" selectedType="none" useScrollBar="false" pageSize="{@pageSize}" caseNN="{@VIEW}" />

	<og:writeTable
		fileURL        = "{@DIR}"
		filename       = "GE58.xml"
		writerClass    = "XML"
		encode         = "UTF-8" >
		<og:writeTableParam key="TableName" value="GE58" />
		<og:equals val1="{@EXT_SQL}" val2="DELETE" >
			<og:writeTableParam key="First" >
				delete from GE58 where SYSTEM_ID in ( '{@SYSTEM_ID}','{@AST}' )
			</og:writeTableParam>
		</og:equals>
		<og:equals val1="{@EXT_SQL}" val2="MERGE" >
		  <og:writeTableParam key="MergeSql" >
			update GE58
			set
				KBOUT		= [KBOUT]
			,	DATA1		= [DATA1]
			,	DATA2		= [DATA2]
			,	DATA3		= [DATA3]
			,	DATA4		= [DATA4]
			,	DATA5		= [DATA5]
			,	DATA6		= [DATA6]
			,	DATA7		= [DATA7]
			,	DATA8		= [DATA8]
			,	DATA9		= [DATA9]
			,	DATA10		= [DATA10]
			,	DATA11		= [DATA11]
			,	DATA12		= [DATA12]
			,	DATA13		= [DATA13]
			,	DATA14		= [DATA14]
			,	DATA15		= [DATA15]
			,	FGJ			= [FGJ]
			,	DYSET		= [DYSET]
			,	DYUPD		= [DYUPD]
			,	USRSET		= [USRSET]
			,	USRUPD		= [USRUPD]
			,	PGSET		= [PGSET]
			,	PGUPD		= [PGUPD]
			where 	SYSTEM_ID	= [SYSTEM_ID]
			and		LISTID		= [LISTID]
			and		CLM			= [CLM]
		  </og:writeTableParam>
		</og:equals>
	</og:writeTable>
