package com.ejie.m62fb.dao.registroVPP;

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

public class InquilinoElementoDaoSql {

	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;
	public static final String SEQUENCE_NAME = "";
	public static final String TABLA = BDConstantes.INQUILINO_ELEMENTO;
	public static final String VISTA = BDConstantes.VIS_INQ_ELEMENTO;
	public static final String ALIAS_INQUILINOELEM = " INQUELEM";
	public static final String PK = "ID_INQUILINO";

	public static final String SQL_INSERT = "INSERT INTO"
			+ InquilinoElementoDaoSql.TABLA
			+ "(ID_INQUILINO, ID_CONTRATO_ALQ, ID_PERSONA, IND_VIV_ADAPTADA"
			+ SQLGenericas.INSERT_ABSTRACT_CLASS_SQL + ") VALUES (?,?,?,?"
			+ SQLGenericas.INSERT_ABSTRACT_CLASS_QUESTION_TAGS + ")";

	public static final String SQL_UPDATE = "UPDATE"
			+ InquilinoElementoDaoSql.TABLA
			+ "SET ID_CONTRATO_ALQ=?, ID_PERSONA=?, IND_VIV_ADAPTADA=?"
			+ SQLGenericas.UPDATE_ABSTRACT_CLASS_SQL + "WHERE ID_INQUILINO=?";

	public static final String SQL_DELETE = "DELETE FROM"
			+ InquilinoElementoDaoSql.TABLA + "WHERE ID_INQUILINO=?";

	public static final String SQL_SELECT = "SELECT  "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".ID_INQUILINO IDINQUILINO, "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".ID_CONTRATO_ALQ IDCONTRATOALQ, "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".ID_PERSONA IDPERSONA, "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".NIF_TITULAR NIFTITULAR, "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".NOM_APELLIDO_2 NOMAPELLIDO2, "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".NOM_APELLIDO_1 NOMAPELLIDO1, "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".NOM_NOMBRE NOMNOMBRE, "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".IND_VIV_ADAPTADA INDVIVADAPTADA"
			// Direccion
			+ SQLGenericas.getSqlCamposDireccionCompleta(
					InquilinoElementoDaoSql.ALIAS_INQUILINOELEM, null)
			// AbstractM62FBModel
			+ SQLGenericas
					.getSqlCamposAbstractClass(InquilinoElementoDaoSql.ALIAS_INQUILINOELEM);

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

	public static final String SQL_FROM_VISTA = " FROM"
			+ InquilinoElementoDaoSql.VISTA
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM;

	public static final String SQL_FROM_TABLA = " FROM"
			+ InquilinoElementoDaoSql.TABLA
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM;

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

	public static final String SQL_WHERE_ID = SQL_WHERE_ALL + " AND "
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM + ".ID_INQUILINO = ?";

	public static final String SQL_WHERE_NOT_ID = " AND NOT("
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".ID_INQUILINO = ?)";

	public static final String SQL_WHERE_FOR_UPDATE = SQL_WHERE_ID + " AND"
			+ InquilinoElementoDaoSql.ALIAS_INQUILINOELEM
			+ ".FEH_ULT_MODIF = ?";

	public static final String SQL_FIND = SQL_SELECT + SQL_FROM_VISTA
			+ SQL_WHERE_ID;
	public static final String SQL_FIND_FOR_UPDATE = SQL_SELECT
			+ SQL_FROM_VISTA + SQL_WHERE_FOR_UPDATE;
	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;
}
