package com.ejie.t17i.dao;

public class PlantaDaoSql {

	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;
	public static final String SEQUENCE_NAME = "";
	public static final String TABLA = " t17i.T17_PLANTA ";
	public static final String ORDER = " ORDER BY ESCALERA,PISO";
	public static final String ALIAS = "PLANTA";
	public static final String PK = "ID";
	public static final String SQL_SELECT = "SELECT " + PlantaDaoSql.ALIAS + ".ID ID, " +
	PlantaDaoSql.ALIAS + ".PORTAL_ID PORTALID," +
	PlantaDaoSql.ALIAS + ".ESCALERA ESCALERA," +
	PlantaDaoSql.ALIAS + ".PISO PISO";
	public static final String SQL_SELECT_COUNT = "SELECT COUNT(1)";
	public static final String SQL_FROM = " FROM "
		+ PlantaDaoSql.TABLA + " "
		+ PlantaDaoSql.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_SELECT_ESCALERA = "SELECT DISTINCT(decode(trim("+PlantaDaoSql.ALIAS + ".ESCALERA), null,'-',trim("+
	PlantaDaoSql.ALIAS + ".ESCALERA))) ESCALERA, 0 ID, " +
	PlantaDaoSql.ALIAS + ".PORTAL_ID PORTALID,0 PISO";
	public static final String SQL_FIND_ALL_ESCALERA = SQL_SELECT_ESCALERA + SQL_FROM;
	
}
