package com.ejie.m62fb.dao.registroVPP;

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

public class InformacionSueloDaoSql {

	/**
	 * StringBuilder initilization value
	 */
	public static final int STRING_BUILDER_INIT = 4096;
	public static final String SEQUENCE_NAME = "";
	public static final String TABLA =BDConstantes.INFORMACION_SUELO;
	public static final String TABLA_SOLIC_DCHO_SUP = BDConstantes.SOLIC_DCHO_SUP;

	public static final String PK = "ID_M62R21T0";
	public static final String SQL_UPDATE = "UPDATE " + TABLA + " SET CUOTA_PARTICIPACION=? "+ SQLGenericas.UPDATE_ABSTRACT_CLASS_SQL + "WHERE NUM_ELEMENTO = ? AND " + "COD_TIPO_ELEM = ?";

	public static final String SQL_SELECT = "SELECT "
			+ "ID_M62R21T0, ID_M62R20T0, COD_TIPO_ELEM, NUM_ELEMENTO, CUOTA_PARTICIPACION,"
			+ "IMC_PVP_ELEM, IMC_IVA, POR_IVA, IMC_GASTOS_OPER, IND_DERECHO_SUP, ID_M62R31T0, NUM_FASE"
			+ SQLGenericas.getSqlCamposAbstractClass(null);

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

	public static final String SQL_FROM = " FROM " + TABLA;
	public static final String SQL_FROM_SOLIC_DCHO_SUP = SQL_FROM + " , "
			+ TABLA_SOLIC_DCHO_SUP;

	public static final String SQL_WHERE_ALL = " WHERE 1=1 ";
	public static final String SQL_WHERE_SOLIC_DCHO_SUP = SQL_WHERE_ALL
			+ " AND " + TABLA + ".ID_M62R21T0 = " + TABLA_SOLIC_DCHO_SUP
			+ ".ID_M62R21T0 ";
	public static final String SQL_WHERE_ELEMENTO = SQL_WHERE_ALL + " AND "
			+ " NUM_ELEMENTO = ? AND " + "COD_TIPO_ELEM = ?";
	// + "M62R21T0 = ?";
	// public static final String SQL_WHERE_ID = SQL_WHERE_ALL + " AND "
	// + "M62R21T0 = ?";

	// public static final String SQL_WHERE_ID_SIMPLE = " WHERE "
	// + "M62R21T0 = ?";

	// public static final String SQL_WHERE_FOR_UPDATE = SQL_WHERE_ID + " AND "
	// + ElementosDaoSql.ALIAS + ".FECHORACT = ?";

	// public static final String SQL_FIND = SQL_SELECT + SQL_FROM +
	// SQL_WHERE_ID;

	// public static final String SQL_FIND_SIMPLE = SQL_SELECT_SIMPLE
	// + SQL_FROM_SIMPLE + SQL_WHERE_ID_SIMPLE;

	// 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;
	public static final String SQL_FIND_ALL_COUNT_SOLIC_DCHO_SUP = SQL_SELECT_COUNT
			+ SQL_FROM_SOLIC_DCHO_SUP;
	public static final String SQL_FIND = "SELECT * FROM (SELECT rownum rnum, a.*  FROM ("+SQL_SELECT + SQL_FROM
			+ SQL_WHERE_ELEMENTO+"ORDER BY NUM_FASE DESC)a) where ROWNUM = 1 ";

}