package com.ejie.m62fb.dao.registroVPP;

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

public class CargaFicherosDaoSql {

	/**
	 * StringBuilder initilization value
	 */
	private static final String ID_M62A28T0_FICH_SOLIC_CALIF_PROV = "1";
	private static final String ID_M62A28T0_FICH_CONT_ALOJ_DOTAC = "5";
	private static final String ID_M62A28T0_FICH_CONT_VPP_AYTO = "6";
	public static final int STRING_BUILDER_INIT = 4096;
	public static final String SQL_SELECT_GET_VERSION_FICH_SOLIC_CALIF_PROV ="SELECT NUM_VERSION FROM VERSION_FICHEROS WHERE ID_M62A28T0="+ID_M62A28T0_FICH_SOLIC_CALIF_PROV;
	public static final String SQL_SELECT_GET_VERSION_FICH_CONT_ALOJ_DOTAC ="SELECT NUM_VERSION FROM VERSION_FICHEROS WHERE ID_M62A28T0="+ID_M62A28T0_FICH_CONT_ALOJ_DOTAC;
	public static final String SQL_SELECT_GET_VERSION_FICH_CONT_VPP_AYTO ="SELECT NUM_VERSION FROM VERSION_FICHEROS WHERE ID_M62A28T0="+ID_M62A28T0_FICH_CONT_VPP_AYTO;
	
	public static final String SQL_SELECT_VALIDAR_EXP_COMU_VPP_AYTO = "SELECT COD_TIPO_EXPED " +
			"FROM " + BDConstantes.TIPO_EXPEDIENTE +
			"WHERE COD_TIPO_FIGURA ='A' AND COD_TIPO_EXPED IN ('MG','ME')";
	public static final String SQL_SELECT_VALIDAR_EXP_CONTRATO_SOLIC_CALIF = "SELECT COD_TIPO_EXPED " +
	"FROM " + BDConstantes.TIPO_EXPEDIENTE +
	"WHERE COD_TIPO_FIGURA ='P'";
	public static final String SQL_SELECT_VALIDAR_EXP_CONTRATO_ALOJ_DOTAC = "SELECT COD_TIPO_EXPED " +
	"FROM " + BDConstantes.TIPO_EXPEDIENTE +
	"WHERE COD_TIPO_FIGURA ='L'";
	
	//Borrar viviendas del expediente relacionado
	public static final String SQL_DELETE_VIVIENDAS_REL_EXPED="DELETE FROM " + BDConstantes.VIVIENDA+
	" WHERE NUM_VIVIENDA IN (SELECT DISTINCT(NUM_VIVIENDA) FROM " + BDConstantes.EXPEDIENTE_VIVIENDA + 
	" WHERE NUM_EXPEDIENTE like ? ESCAPE  '\\')";
	//Borrar elementos del expediente relacionado
	public static final String SQL_DELETE_ELEMENTOS_REL_EXPED="DELETE FROM " + BDConstantes.ELEMENTO+
	" WHERE NUM_EXPEDIENTE like ? ESCAPE  '\\'";
}
