<jsp:directive.page pageEncoding="UTF-8" />
<!-- GFM0056 DB定義⇒ｺｰﾄﾞﾘｿｰｽ SUBSYS更新 -->

<og:query command="{@command}" debug="{@debug}" dbid="{@DBID_R}" maxRowCount="0">
	select A.SYSTEM_ID,A.CLM,A.CODE,A.KBSAKU,A.SUBSYS,B.SUBSYS as N_SUBSYS,A.UNIQ
	from GEA04 A inner join GE82 B
				on  A.SYSTEM_ID = B.SYSTEM_ID
				and A.CLM       = B.CLM
				and A.KBSAKU    = B.KBSAKU
				and A.SUBSYS || 'X' != B.SUBSYS || 'X'
	where B.SYSTEM_ID = '{@SYSTEM_ID_R}'
	<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,A.SEQNO
</og:query>

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

<og:hidden name="SQL">
	UPDATE GEA04 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		CODE	= [CODE]
	AND		UNIQ	= [UNIQ]
</og:hidden>

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