package com.ejie.t17i.dao;

public class PortalDaoSql {

	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;
	public static final String SEQUENCE_NAME = "";
	public static final String TABLA = " t17i.T17_PORTAL ";
	public static final String ORDER = " ORDER BY CODIGOPOSTAL";
	public static final String ALIAS = "PORTAL";
	public static final String PK = "ID";
	public static final String SQL_SELECT = "SELECT " + PortalDaoSql.ALIAS + ".ID ID, " +
	PortalDaoSql.ALIAS + ".BLOQUE BLOQUE," +
	PortalDaoSql.ALIAS + ".NUMERO NUMERO," +
	PortalDaoSql.ALIAS + ".BIS BIS, " +
	PortalDaoSql.ALIAS + ".ESTADO ESTADO, " +
	PortalDaoSql.ALIAS + ".CODIGO_POSTAL CODIGOPOSTAL," +			
	PortalDaoSql.ALIAS + ".DX_ED50 DXED50," +
	PortalDaoSql.ALIAS + ".DY_ED50 DYED50, " +
	PortalDaoSql.ALIAS + ".DX_ETRS89 DXETRS89," +
	PortalDaoSql.ALIAS + ".DY_ETRS89 DYETRS89," +
	PortalDaoSql.ALIAS + ".TRAMO_ID TRAMOID, " +
	PortalDaoSql.ALIAS + ".ACEPCION ACEPCION," +
	PortalDaoSql.ALIAS + ".CALLE_ID CALLEID, " +
	PortalDaoSql.ALIAS + ".LOCALIDAD_ID LOCALIDADID," +
	"UPPER("+PortalDaoSql.ALIAS+".BLOQUE || " + PortalDaoSql.ALIAS+".NUMERO || " + PortalDaoSql.ALIAS+".BIS) COMBODESC";
	public static final String SQL_SELECT_COUNT = "SELECT COUNT(1)";
	public static final String SQL_FROM = " FROM "
		+ PortalDaoSql.TABLA + " "
		+ PortalDaoSql.ALIAS + " ";
	public static final String SQL_WHERE_ID = " WHERE "+PK +" = ?";
	public static final String SQL_WHERE_ALL = " WHERE 1=1";

	public static final String SQL_FIND = SQL_SELECT + SQL_FROM + SQL_WHERE_ID;
	public static final String SQL_FIND_ALL = SQL_SELECT + SQL_FROM;
	public static final String SQL_FIND_ALL_COUNT = SQL_SELECT_COUNT + SQL_FROM;
	
	public static final String SQL_FIND_ALL_CP = "SELECT DISTINCT("+
	PortalDaoSql.ALIAS + ".CODIGO_POSTAL) CODIGOPOSTAL " + SQL_FROM;

}
