<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}">
	select SYSTEM_ID,CLM,NAME_JA,RENDERER AS BEFORE1,'{@ARROW}','MENU' AS AFTER1,
			EDITOR AS BEFORE2,'{@ARROW}','MENU' AS AFTER2,KBSAKU
	from  GEA03
	where SYSTEM_ID = '{@SYSTEM_ID}'
	and   KBSAKU   != '0'
	and   FGJ       = '1'
	and   ( EDITOR   not in ( 'MENU','CHBOX','SEQMENU' ) or
	        RENDERER not in ( 'MENU','CHBOX','SEQMENU' )  )
	and exists (
			select * from GEA04
			where GEA04.SYSTEM_ID = '{@SYSTEM_ID}'
			and   GEA04.CLM       = GEA03.CLM
			and   KBSAKU   != '0'
			and   FGJ       = '1'
		)
	union
	select SYSTEM_ID,CLM,NAME_JA,RENDERER AS BEFORE1,'{@ARROW}','LABEL' AS AFTER1,
			EDITOR AS BEFORE2,'{@ARROW}','TEXT' AS AFTER2,KBSAKU
	from  GEA03
	where SYSTEM_ID = '{@SYSTEM_ID}'
	and   KBSAKU   != '0'
	and   FGJ       = '1'
	and   ( EDITOR   in ( 'MENU','CHBOX','SEQMENU' ) or
	        RENDERER in ( 'MENU','CHBOX','SEQMENU' )  )
	and not exists (
			select * from GEA04
			where GEA04.SYSTEM_ID = '{@SYSTEM_ID}'
			and   ( GEA04.CLM = GEA03.CLM      or
					GEA04.CLM = GEA03.CODE_CLM  )
			and   KBSAKU   != '0'
			and   FGJ       = '1'
		)
	order by SYSTEM_ID,CLM
</og:query>

<og:value key="lblKey" value="C" />

<og:hidden name="SQL">
	UPDATE GEA03 SET
			RENDERER   = [AFTER1],
			EDITOR     = [AFTER2],
			FGJ        = '1',
			DYUPD      = '{@USER.YMDH}',
			USRUPD     = '{@USER.ID}',
			PRGUPD     = '{@GUI.KEY}'
	WHERE SYSTEM_ID = [SYSTEM_ID]
	AND   CLM       = [CLM]
</og:hidden>

<og:viewLink command="{@command}">
	<og:link column="CLM" gamenId="GE0003" href="index.jsp" target="CONTENTS"
		keys="command,SYSTEM_ID,CLM,KBSAKU"
		vals="NEW,[SYSTEM_ID],[CLM],[KBSAKU]" />
</og:viewLink>
