<jsp:directive.page pageEncoding="UTF-8" />
<!-- GFM0057 DB定義⇒ｺｰﾄﾞﾗﾍﾞﾙ SUBSYS更新 -->

<og:query command="{@command}" debug="{@debug}" dbid="{@DBID_R}" maxRowCount="0">
	select A.SYSTEM_ID,A.CLM,A.KBSAKU,A.SUBSYS,B.SUBSYS as N_SUBSYS,A.UNIQ
	from GEA08 A inner join GE82 B
				on  A.SYSTEM_ID = B.SYSTEM_ID
				and A.CLM    like B.CLM || '.%'
				and A.KBSAKU    = B.KBSAKU
				and A.SUBSYS || 'X' != B.SUBSYS || 'X'
	where B.SYSTEM_ID = '{@SYSTEM_ID_R}'
	and   A.KBLBL     = '6'
	<og:where startKey="and">
		<og:and value="A.CLM like '{@CLM}'" />
	</og:where>
	and   A.FGJ       = '1'
	ORDER BY A.SYSTEM_ID DESC,A.KBSAKU DESC,A.CLM
</og:query>

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

<og:hidden name="SQL">
	UPDATE GEA08 SET
			SUBSYS	= [N_SUBSYS],
			DYUPD	= '{@USER.YMDH}',
			USRUPD	= '{@USER.ID}',
			PGUPD	= '{@GUI.KEY}'
	WHERE	SYSTEM_ID	= [SYSTEM_ID]
	AND		CLM		= [CLM]
	AND		KBSAKU	= [KBSAKU]
	AND		UNIQ	= [UNIQ]
</og:hidden>

<og:hidden name="DBID2" value="{@DBID_R}" />
