package com.eactive.eai.batch.osd;

import com.eactive.eai.common.dao.Keys;

public interface OutsideQuery
{
    public static final String GET_ALL_OUTSIDE =
        " SELECT " +
        " A.BjobBzwkDstcd, LTRIM(RTRIM(A.OsidInstiDstcd))  AS OsidInstiDstcd, A.OsidInstiName, \n" +
        " A.AdptrBzwkGroupName, A.SendPrcssRuleCd, A.RecvPrcssRuleCd, \n" +
        " A.EAIFileSendPtrnDstcd, A.EAIFileRecvPtrnDstcd, A.TelgmBlckSize, A.TelgmSernoSize, \n" +
        " A.TranStartIndx, A.TranEndIndx, A.TelgmPcketSize,  B.BjobBzwkName \n" +
		"FROM   " + Keys.TABLE_OWNER + "TSEAIBJ06 A \n" +
        "       LEFT OUTER JOIN " + Keys.TABLE_OWNER + "TSEAIBJ02 B \n" +"on  A.BjobBzwkDstcd = B.BjobBzwkDstcd" +
    	" where  A.ThisMsgUseYn = '1' ";
    
    public static final String GET_ALL_LINKINFO =
        " SELECT " +
        " SysLnkgDstcd, BjobBzwkDstcd, LTRIM(RTRIM(OsidInstiDstcd))  AS OsidInstiDstcd, " +
        " RqstRspnsDstcd, LnkgIPInfoName, LnkgPortInfoName,  " +
        " LnkgID, LnkgPwd, ToutVal, TCirtLnkgStusCd, " +
        " AdptrBzwkGroupName, AdptrBzwkName " +
        " FROM " + Keys.TABLE_OWNER + "TSEAIBJ05 " ;

    public static final String UPDATE_LINKINFO_ID_PASSWORD =
		  "UPDATE " + Keys.TABLE_OWNER + "TSEAIBJ05 \n"
		  + "SET  LnkgID               = ? , \n"
		  + "     LnkgPwd              = ?   \n"
		  + " WHERE  SysLnkgDstcd      = ? \n";

    public static final String GET_OUTSIDE_BY_KEY =
        " SELECT " +
        " A.BjobBzwkDstcd, LTRIM(RTRIM(A.OsidInstiDstcd))  AS OsidInstiDstcd, A.OsidInstiName, \n" +
        " A.AdptrBzwkGroupName, A.SendPrcssRuleCd, A.RecvPrcssRuleCd, \n" +
        " A.EAIFileSendPtrnDstcd, A.EAIFileRecvPtrnDstcd, A.TelgmBlckSize, A.TelgmSernoSize, \n" +
        " A.TranStartIndx, A.TranEndIndx, A.TelgmPcketSize,  B.BjobBzwkName \n" +
		"FROM   " + Keys.TABLE_OWNER + "TSEAIBJ06 A \n" +
        "       LEFT OUTER JOIN " + Keys.TABLE_OWNER + "TSEAIBJ02 B \n" +"on  A.BjobBzwkDstcd = B.BjobBzwkDstcd \n" +
        "WHERE A.BjobBzwkDstcd = ? \n" +
        "AND   LTRIM(RTRIM(A.OsidInstiDstcd)) = ?";
        

    public static final String GET_ALL_LINKINFO_BY_OUTSIDE_KEY =
        " SELECT " +
        " SysLnkgDstcd, BjobBzwkDstcd, LTRIM(RTRIM(OsidInstiDstcd))  AS OsidInstiDstcd, " +
        " RqstRspnsDstcd, LnkgIPInfoName, LnkgPortInfoName,  " +
        " LnkgID, LnkgPwd, ToutVal, TCirtLnkgStusCd, " +
        " AdptrBzwkGroupName, AdptrBzwkName " +
        " FROM " + Keys.TABLE_OWNER + "TSEAIBJ05 \n"  +
        "WHERE BjobBzwkDstcd = ? \n" +
        "AND   LTRIM(RTRIM(OsidInstiDstcd)) = ?";

}
