<jsp:directive.page pageEncoding="UTF-8" />
<!-- カラムリソース⇒ラベルリソース差分追加 -->
<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}">
	select A.SYSTEM_ID,A.CLM,A.NAME_JA,A.KBSAKU
	from  GEA03 A
	where A.SYSTEM_ID IN ( '{@SYSTEM_ID}','{@BASE}','{@AST}' )
	<og:where startKey="and">
		<og:and value = "A.CLM like '{@CLM}'" />
	</og:where>
--	and		A.KBSAKU	!= '0'
	and		A.FGJ		= '1'
	and not exists (
			select 1 from GEA08 B
			where B.SYSTEM_ID  IN ( '{@SYSTEM_ID}','{@BASE}','{@AST}' )
			and   ( B.CLM      = A.CLM       or
					B.CLM      = A.LABEL_CLM  )
			and   B.LANG       = 'ja'
--			and   B.KBSAKU    != '0'
			and   B.FGJ        = '1'
		)
	order by A.SYSTEM_ID,A.CLM
</og:query>

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

<og:hidden name="SQL">
	INSERT INTO GEA08
		(SYSTEM_ID,CLM,NAME_JA,LNAME,KBSAKU,LANG,KBLBL,
		 FGJ,DYSET,DYUPD,USRSET,USRUPD,PGUPD)
	VALUES
		([SYSTEM_ID],[CLM],[NAME_JA],[NAME_JA],[KBSAKU],'ja','1',
		 '1','{@USER.YMDH}','{@USER.YMDH}','{@USER.ID}','{@USER.ID}','{@GUI.KEY}')
</og:hidden>
