package com.ejie.m62fb.dao.registroVPP;

import com.ejie.m62fb.dao.SQLGenericas;
import com.ejie.m62fb.utils.constants.BDConstantes;

public class SolicitudReservaDaoSQL {

	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;
	public static final String SEQUENCE_NAME = "";
	public static final String TABLA = BDConstantes.SOLICITUD_RESERVA;
	public static final String VISTA = BDConstantes.SOLICITUDES_RESERVA;
	public static final String ALIAS_SOLICRESER = " SOLICRESER";
	public static final String PK = "ID_M62R38T0";

	public static final String SQL_INSERT = "INSERT INTO" + TABLA
			+ "(DES_ENTIDAD_SOLIC, DES_DPTO_SOLIC, DES_DIRECCION"
			+ ", DES_INTERLOCUTOR, NUM_TELEFONO, DIR_E_MAIL"
			+ ", ID_EXPEDIENTE_PLATEA, ESTADO, FEC_SOLICITUD"
			+ SQLGenericas.INSERT_ABSTRACT_CLASS_SQL + ") VALUES (" + "?,?,?"
			+ ",?,?,?" + ",?,?,SYSDATE"
			+ SQLGenericas.INSERT_ABSTRACT_CLASS_QUESTION_TAGS + ")";

	public static final String SQL_SELECT = "SELECT  "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".ID_M62R38T0 IDM62R38T0, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".NUM_EXPEDIENTE_PLATEA NUMEXPEDIENTEPLATEA, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".ID_EXPEDIENTE_PLATEA IDEXPEDIENTEPLATEA, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".FEC_SOLICITUD FECSOLICITUD, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".DES_ENTIDAD_SOLIC DESENTIDADSOLIC, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".DES_DPTO_SOLIC DESDPTOSOLIC, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".DES_INTERLOCUTOR DESINTERLOCUTOR, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".COD_ESTADO CODESTADO, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".DESC_ESTADO_ES DESCESTADOES, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".DESC_ESTADO_EU DESCESTADOEU, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".NUM_VIVIENDAS NUMVIVIENDAS, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".DES_DIRECCION DESDIRECCION, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".DIR_E_MAIL DIREMAIL, "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER
			+ ".NUM_TELEFONO NUMTELEFONO";

	public static final String SQL_SELECT_COUNT = "SELECT COUNT(1)";

	public static final String SQL_FROM_VISTA = " FROM"
			+ SolicitudReservaDaoSQL.VISTA
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER;

	public static final String SQL_WHERE_ALL = " WHERE 1=1 ";

	public static final String SQL_WHERE_ID = SQL_WHERE_ALL + " AND "
			+ SolicitudReservaDaoSQL.ALIAS_SOLICRESER + ".ID_M62R38T0 = ?";

	public static final String SQL_FIND = SQL_SELECT + SQL_FROM_VISTA
			+ SQL_WHERE_ID;
	public static final String SQL_FIND_ALL = SQL_SELECT + SQL_FROM_VISTA;
	public static final String SQL_FIND_ALL_COUNT = SQL_SELECT_COUNT
			+ SQL_FROM_VISTA;

	public static final String SQL_UPDATE_ESTADO = "UPDATE " + TABLA
			+ " SET ESTADO = ?" + SQLGenericas.UPDATE_ABSTRACT_CLASS_SQL
			+ " WHERE ID_EXPEDIENTE_PLATEA = ?";

	public static final String SQL_UPDATE_ESTADO_NUM_EXP_PLATEA = "UPDATE "
			+ TABLA + " SET ESTADO = ?, NUM_EXPEDIENTE_PLATEA = ?"
			+ SQLGenericas.UPDATE_ABSTRACT_CLASS_SQL
			+ " WHERE ID_EXPEDIENTE_PLATEA = ?";
}
