package com.ejie.m62fb.dao.registroVPP;

import com.ejie.m62fb.dao.SQLGenericas;

public class InquilinoDaoSql {

	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;
	public static final String SEQUENCE_NAME = "";
	public static final String TABLA = " INQUILINO ";
	public static final String ALIAS_INQUILINO = " INQU";
	public static final String PK1 = "NUM_VIVIENDA";
	public static final String PK2 = "NUM_INQUILINO";
	public static final String PK3 = "ID_PERSONA";
	public static final String PK = "ID_M62R06T0";

	public static final String SQL_INSERT = "INSERT INTO"
			+ InquilinoDaoSql.TABLA
			+ "(NUM_VIVIENDA, NUM_EXPEDIENTE, NUM_INQUILINO, "
			+ "ID_PERSONA, IND_VIV_ADAPTADA, IND_ENV_REG_PROP, ID_CONTRATO "
			+ SQLGenericas.INSERT_ABSTRACT_CLASS_SQL + ") VALUES (?,?,?,?,?,?,?"
			+ SQLGenericas.INSERT_ABSTRACT_CLASS_QUESTION_TAGS + ")";

	public static final String SQL_UPDATE = "UPDATE" + InquilinoDaoSql.TABLA
			+ "SET NUM_EXPEDIENTE=?, IND_VIV_ADAPTADA=?, IND_ENV_REG_PROP=? "
			+ SQLGenericas.UPDATE_ABSTRACT_CLASS_SQL
			+ "WHERE ID_M62R06T0=? ";

	public static final String SQL_DELETE = "DELETE FROM"
			+ InquilinoDaoSql.TABLA
			+ "WHERE ID_M62R06T0=?";

	public static final String SQL_SELECT = "SELECT  "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".NUM_VIVIENDA NUMVIVIENDA, "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".NUM_INQUILINO NUMINQUILINO, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".NUM_EXPEDIENTE NUMEXPEDIENTE, "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".NIF_TITULAR NIFTITULAR, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".NUM_CORREL_NIF NUMCORRELNIF, "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".FEC_ALTA FECALTA, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".DIR_IP_USUARIO DIRIPUSUARIO, "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".FEH_ULT_MODIF FEHULTMODIF, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".COD_USU_ULT_MODIF CODUSUULTMODIF, "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".IDE_REGISTRO IDEREGISTRO, "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".ID_PERSONA IDPERSONA, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".IND_VIV_ADAPTADA INDVIVADAPTADA, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".IND_ENV_REG_PROP INDENVREGPROP, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".ID_CONTRATO IDCONTRATO, "
			+ InquilinoDaoSql.ALIAS_INQUILINO
			+ ".ID_M62R06T0 IDM62R06T0 ";

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

	public static final String SQL_FROM = " FROM" + InquilinoDaoSql.TABLA
			+ InquilinoDaoSql.ALIAS_INQUILINO;

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

	public static final String SQL_WHERE_ID = SQL_WHERE_ALL + " AND "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".ID_M62R06T0 = ?";

	public static final String SQL_WHERE_NOT_ID = " AND NOT("
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".NUM_VIVIENDA = ? AND "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".NUM_INQUILINO = ? AND "
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".ID_PERSONA = ?)";

	public static final String SQL_WHERE_FOR_UPDATE = SQL_WHERE_ID + " AND"
			+ InquilinoDaoSql.ALIAS_INQUILINO + ".FEH_ULT_MODIF = ?";

	public static final String SQL_FIND = SQL_SELECT + SQL_FROM + SQL_WHERE_ID;
	public static final String SQL_FIND_FOR_UPDATE = SQL_SELECT + SQL_FROM
			+ SQL_WHERE_FOR_UPDATE;
	public static final String SQL_FIND_ALL = SQL_SELECT + SQL_FROM;
	public static final String SQL_FIND_ALL_COUNT = SQL_SELECT_COUNT + SQL_FROM;
}
