package com.eactive.eai.common.server;

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

/**
* 1. 기능 : EAIServerDAO에서 사용하는 SQL Query를 정의한 Interface
* 2. 처리 개요 :
*     - EAIServerDAO에서 사용하는 SQL Query를 정의한 Interface
* 3. 주의사항
*
* @author  : 전홍성(hsjeon70@dreamwiz.com)
* @see : TestCallRunner, TestCallManager
* @since   :JDK v1.4.2
*/
public interface EAIServerQuery
{


    /**
     * EAIServer List를 조회하는 Query
     */

    public static final String GET_ALL_SERVERS = "select EAISevrInstncName, EAISevrIP, SevrLsnPortName, FlovrSevrName, HostName  \n"+
                                                 "from " + Keys.TABLE_OWNER + "TSEAIBP03 \n" +
                                                 "order by EAISevrInstncName";

    /**
     * EAIBatServer를 등록하는 Query
     */
    public static final String ADD_SERVER      = "insert into " + Keys.TABLE_OWNER + "TSEAIBP03 "+
                                                 "(EAISevrInstncName, EAISevrIP, SevrLsnPortName, FlovrSevrName, HostName) "+
                                                 "values(?, ?, ?, ?, ?, ?)";

    /**
     * 특정 EAIBatServer 정보를 조회하는 Query
     */
    public static final String GET_SERVER      = "select EAISevrIP, SevrLsnPortName, FlovrSevrName, HostName \n"+
                                                 "from " + Keys.TABLE_OWNER + "TSEAIBP03 where EAISevrInstncName=?";

    /**
     * 특정 EAIBatServer 정보를 등록하는 Query
     */

    public static final String UPDATE_SERVER   = "update " + Keys.TABLE_OWNER + "TSEAIBP03 \n"+
                                                 "set EAISevrIP=?, SevrLsnPortName=?, FlovrSevrName=?, HostName=? \n"+
                                                 "where EAISevrInstncName=?";

    /**
     * 특정 EAIBatServer 정보를 삭제하는 Query
     */
    public static final String REMOVE_SERVER   = "delete from " + Keys.TABLE_OWNER + "TSEAIBP03 \n"+
                                                 "where EAISevrInstncName=?";

    /**
     *  EAIBatServer리스트를 생성하기 위한 Query
     */
    public static final String GET_SERVERS_NAME = "select EAISevrInstncName from " + Keys.TABLE_OWNER + "TSEAIBP03";

    /**
     *  EAIBatServer 페이지 리스트를 생성하기 위한 Query
     */
//    public static final String SELECT_SERVER_PAGELIST =
//        "SELECT ROWNO, EAISevrInstncName, EAISevrIP, SevrLsnPortName, FlovrSevrName, HostName \n"
//        +"FROM ( \n"
//        +"	SELECT \n"
//        +"		   ROW_NUMBER() OVER (ORDER BY EAISevrInstncName)  ROWNO, EAISevrInstncName, EAISevrIP, SevrLsnPortName, FlovrSevrName, HostName \n"
//        +"	FROM " + Keys.TABLE_OWNER + "TSEAIBP03  \n"
//        +"	WHERE EAISevrInstncName like ?  \n"
//        +"	ORDER BY EAISevrInstncName  \n"
//        +") AS TMP1 WHERE ROWNO BETWEEN ? AND ?";

    /**
     *  EAIBatServer 페이지 총 갯수를 산정하기 위한 Query
     */
    public static final String SELECT_SERVER_TOTALCOUNT = "SELECT COUNT(*) FROM " + Keys.TABLE_OWNER + "TSEAIBP03 WHERE EAISevrInstncName like ? ";

}


