<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<og:head headType="result" />
<jsp:directive.include file="/jsp/custom/result_info.jsp" />
<og:comment
	system	= "GE:エンジン"
	pgid	= "MAIL03"
	title	= "送信履歴検索"
	date	= "2009/04/01"
	author	= "S.Li"
	text	= ""
	version	= "001"
>
	2018/04/28 T.OTA 結合方式をoracle専用の(+)から、LEFT OUTER JOINに変更
</og:comment>
<!-- history.back() で戻るボタンを表示します。	-->
<jsp:directive.include file="/jsp/common/history_back.jsp" />

<og:equals val1="{@SYS.VER4_COMPATIBLE_MODE}" val2="true">
	<og:value command="SET" key="C_KBNAME" value="NM_KBN" />
	<og:value command="SET" key="C_NAME_JA" value="NAME" />
	<og:value command="SET" key="C_CONTENTS" value="CONTENT" />
</og:equals>
<og:equals val1="{@SYS.VER4_COMPATIBLE_MODE}" val2="true" notEquals="true">
	<og:value command="SET" key="C_KBNAME" value="KBNAME" />
	<og:value command="SET" key="C_NAME_JA" value="NAME_JA" />
	<og:value command="SET" key="C_CONTENTS" value="CONTENTS" />
</og:equals>

<!--  2018/04/28 結合方式を(+)からLEFT OUTER JOINに変更 -->
<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}" scope="request">
		SELECT	 A.YKNO
				,A.FGJ FGJ_SEND
				,A.DST_ID
				,COALESCE(B.{@C_NAME_JA}, A.GROUP_ID) GROUP_NAME
				,A.DST_ADDR
				,A.DST_NAME
				,A.DST_KBN
		FROM	GE34 A
		LEFT OUTER JOIN GE33 B
	<og:where startKey="ON">
		<og:and value = "A.GROUP_ID		=	B.GROUP_ID"		/>
		<og:and value = "B.{@C_KBNAME}	=	'0'"			/>
		<og:and value = "B.SYSTEM_ID	=	'{@SYSTEM_ID}'"	/>
		<og:and value = "COALESCE(B.FGJ,'0')	=	'1'"	/>
	</og:where>
	<og:where>
		<og:and value = "A.YKNO			=	'{@YKNO}'"		/>
	</og:where>
		order by A.FGJ DESC,A.DST_KBN,A.DST_ID
</og:query>

<!-- entryタグのcommandとcolumnSetのコマンドが同じ場合のみ、動作します。 -->
<og:view
	viewFormType = "HTMLTable"
	command      = "{@command}"
	scope        = "request"
	noMessage    = "true"
	noDisplay    = "YKNO"
	writable     = "false"
	useScrollBar = "false"
/>

<og:query command="{@command}" debug="{@debug}" maxRowCount="{@maxRowCount}" scope="request">
		SELECT	 PTN_ID
				,YKNO
				,FROM_ADDR
				,TITLE
				,{@C_CONTENTS} CONTENTS
				,ATTACH1
				,ATTACH2
				,ATTACH3
				,ATTACH4
				,ATTACH5
				,UNIQ
		FROM	GE32
	<og:where>
		<og:and value = "YKNO			= '{@YKNO}'"	/>
	</og:where>
</og:query>

<!-- entryタグのcommandとcolumnSetのコマンドが同じ場合のみ、動作します。 -->
<og:view
	viewFormType = "HTMLFormatTextField"
	command      = "{@command}"
	scope        = "request"
	noMessage    = "true"
	writable     = "false"
	useScrollBar = "false"
>
<table summary="layout">
	<tr>[PTN_ID]</tr>
	<tr>[FROM_ADDR]</tr>
	<tr>[TITLE]</tr>
	<tr><td>[#CONTENTS]</td>
		    <td><div style="border:black solid 1px;width:580px">
				<pre style="width:580px;word-wrap: break-word;">[!CONTENTS]</pre></div>
			</td>
	</tr>
	<tr>[ATTACH1]</tr>
	<tr>[ATTACH2]</tr>
	<tr>[ATTACH3]</tr>
	<tr>[ATTACH4]</tr>
	<tr>[ATTACH5]</tr>
</table>
</og:view>
<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
