package com.ejie.ab79.dao;

import java.util.List;

import com.ejie.ab79.model.RelEstIns;
import com.ejie.ab79.model.expedientes.DatosTerceros;
import com.ejie.ab79.model.expedientes.RelExpTer;
import com.ejie.ab79.model.inspecciones.Inspecciones;
import com.ejie.x38.dto.JerarquiaDto;
import com.ejie.x38.dto.TableRequestDto;
import com.ejie.x38.dto.TableRowDto;

/**
 * RelEstInsDao  
 * 
 *  
 */

public interface RelEstInsDao {

	/**
	 * Inserts a single row in the RelEstIns table.
	 *
	 * @param relestins
	 *            RelEstIns
	 * @return RelEstIns
	 */
	RelEstIns add(RelEstIns relestins);

	/**
	 * Updates a single row in the RelEstIns table.
	 *
	 * @param relestins
	 *            RelEstIns
	 * @return RelEstIns
	 */
	RelEstIns update(RelEstIns relestins);

	/**
	 * Finds a single row in the RelEstIns table.
	 *
	 * @param relestins
	 *            RelEstIns
	 * @return RelEstIns
	 */
	RelEstIns find(RelEstIns relestins);

	/**
	 * Removes a single row in the RelEstIns table.
	 *
	 * @param relestins
	 *            RelEstIns
	 */
	void remove(RelEstIns relestins);

	/**
	 * Finds a List of rows in the RelEstIns table.
	 *
	 * @param relestins
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @return List
	 */
	List<RelEstIns> findAll(RelEstIns relestins, TableRequestDto tableRequestDto);

	/**
	 * Finds rows in the RelEstIns table using like.
	 *
	 * @param relestins
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return List
	 */
	List<RelEstIns> findAllLike(RelEstIns relestins, TableRequestDto tableRequestDto, Boolean startsWith);

	/*
	 * OPERACIONES RUP_TABLE
	 */

	/**
	 * Filter in the RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 */
	void removeMultiple(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto, Boolean startsWith);

	/**
	 * Counts rows in the RelEstIns table using like.
	 *
	 * @param relestins
	 *            RelEstIns
	 * @param startsWith
	 *            Boolean
	 * @return Long
	 */
	Long findAllLikeCount(RelEstIns relestins, Boolean startsWith);

	/**
	 * Counts rows in the RelEstIns table.
	 *
	 * @param relestins
	 *            RelEstIns
	 * @return Long
	 */
	Long findAllCount(RelEstIns relestins);

	/**
	 * Reorder selection.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return List<TableRowDto<RelEstIns>>
	 */
	List<TableRowDto<RelEstIns>> reorderSelection(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto,
			Boolean startsWith);

	/**
	 * Searches in the Usuario table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param searchRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @param startsWith
	 *            Boolean
	 * @return List<TableRowDto<RelEstIns>>
	 */
	List<TableRowDto<RelEstIns>> search(RelEstIns filterRelEstIns, RelEstIns searchRelEstIns,
			TableRequestDto tableRequestDto, Boolean startsWith);

	/*
	 * OPERACIONES RUP_TABLE JERARQUIA
	 */

	/**
	 * Filter in the hierarchical RelEstIns table.
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @return List<JerarquiaDto<RelEstIns>>
	 */
	List<JerarquiaDto<RelEstIns>> findAllLikeJerarquia(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto);

	/**
	 * Count rows in hierarchy
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @return Long
	 */
	Long findAllLikeCountJerarquia(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto);

	/**
	 * Find dependent hierarchical rows
	 *
	 * @param filterRelEstIns
	 *            RelEstIns
	 * @param tableRequestDto
	 *            TableRequestDto
	 * @return List<TableRowDto<RelEstIns>>
	 */
	List<TableRowDto<RelEstIns>> findAllChild(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto);

	/**
	 * Exporta Datos al clipBoard
	 *
	 */
	List<RelEstIns> getMultiple(RelEstIns filterRelEstIns, TableRequestDto tableRequestDto, Boolean startsWith);

	RelEstIns findByInspeccion(Inspecciones inspecciones);

	List<RelExpTer> findParticipantes(Integer idInspeccion);

	void removeByInspeccion(Inspecciones inspeccion);

	void eliminarTercero(DatosTerceros datosTercero);

	void actualizarTituloInspeccion(RelEstIns relEstIns);

}
