<jsp:directive.page pageEncoding="UTF-8" />
<!-- コードリソース⇒カラムリソースチェック -->
<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}'
	<og:where startKey="and">
		<og:and value = "CLM like '{@CLM}'" />
	</og:where>
	and   KBSAKU   != '0'
	and   FGJ       = '1'
	and   ( EDITOR   not in ( 'MENU','CHBOX','RADIO','BITBOX','DATALIST_R' ) or
	        RENDERER not in ( 'MENU','CHBOX','RADIO','BITBOX' )  )
	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}'
	<og:where startKey="and">
		<og:and value = "CLM like '{@CLM}'" />
	</og:where>
	and   KBSAKU   != '0'
	and   FGJ       = '1'
	and   ( EDITOR   in ( 'MENU','RADIO','BITBOX','DATALIST_R' ) or
	        RENDERER in ( 'MENU','RADIO','BITBOX' )  )
	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}',
			PGUPD     = '{@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>
