<jsp:directive.page pageEncoding="UTF-8" />
<!-- コードリソース重複チェック 作成区分 除外 -->
<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}">
	select
		B.CLM,B.CODE,
		CASE WHEN          A.SEQNO            !=          B.SEQNO            THEN B.SEQNO      || '→' || A.SEQNO      ELSE null END AS SEQNO ,
		CASE WHEN COALESCE(A.CODEGRP    ,'x') != COALESCE(B.CODEGRP    ,'x') THEN B.CODEGRP    || '→' || A.CODEGRP    ELSE ''   END AS CODEGRP ,
		CASE WHEN COALESCE(A.CODE_PARAM ,'x') != COALESCE(B.CODE_PARAM ,'x') THEN B.CODE_PARAM || '→' || A.CODE_PARAM ELSE ''   END AS CODE_PARAM ,
		CASE WHEN COALESCE(A.ROLES      ,'x') != COALESCE(B.ROLES      ,'x') THEN B.ROLES      || '→' || A.ROLES      ELSE ''   END AS ROLES ,
		B.KBSAKU || '→' || A.KBSAKU as KBSAKU ,
		B.SYSTEM_ID || '→' || A.SYSTEM_ID as SYSTEM_ID ,
		B.SYSTEM_ID AS F_SYSTEM_ID, B.UNIQ
	from  GEA04 A inner join GEA04 B
			on    A.SYSTEM_ID = '**'
			and   B.SYSTEM_ID = '{@SYSTEM_ID}'
			and   A.CLM       = B.CLM
			and   A.CODE      = B.CODE
			or    B.FGJ       = '9'
	where B.SYSTEM_ID = '{@SYSTEM_ID}'
	<og:where startKey="and">
		<og:and value = "A.CLM like '{@CLM}'" />
	</og:where>
	and   A.FGJ       = '1'
	and   B.FGJ       = '1'
	order by B.SYSTEM_ID,B.CLM,B.UNIQ
</og:query>

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

<og:hidden name="SQL">
	DELETE FROM GEA04
	WHERE UNIQ      = [UNIQ]
	AND   SYSTEM_ID = [F_SYSTEM_ID]
	AND   CLM       = [CLM]
	and   CODE      = [CODE]
</og:hidden>

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