package com.ejie.ab79.dao.protocolos;

import com.ejie.x38.dto.JerarquiaDto;
import com.ejie.x38.dto.TableRequestDto;
import com.ejie.x38.dto.TableRowDto;
import java.util.List;

import com.ejie.ab79.model.protocolos.Protocolos;

/**
 * ProtocolosDao  
 *  
 */

public interface ProtocolosDao {
    
    /**
     * Inserts a single row in the Protocolos table.
     *
     * @param protocolos Protocolos
     * @return Protocolos
     */
    Protocolos add(Protocolos protocolos);

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

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

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

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

	/**
     * Finds rows in the Protocolos table using like.
     *
     * @param protocolos Protocolos
     * @param tableRequestDto TableRequestDto
     * @param startsWith Boolean
     * @return List
     */
	List<Protocolos> findAllLike(Protocolos protocolos, TableRequestDto tableRequestDto, Boolean startsWith);
	
	
	/*
	 * OPERACIONES RUP_TABLE
	 */
	 
	/**
	 * Filter in the Protocolos table.
	 *
	 * @param filterProtocolos Protocolos
	 * @param tableRequestDto TableRequestDto
	 * @param startsWith Boolean
	 */	
	 void removeMultiple(Protocolos filterProtocolos, TableRequestDto tableRequestDto, Boolean startsWith);
	
	
    /**
     * Counts rows in the Protocolos table using like.
     *
     * @param protocolos Protocolos
     * @param startsWith Boolean
     * @return Long
     */
    Long findAllLikeCount(Protocolos protocolos, Boolean startsWith);
    
    /**
     * Counts rows in the Protocolos table.
     *
     * @param protocolos Protocolos
     * @return Long
     */
    Long findAllCount(Protocolos protocolos);
    
    /**
	 * Reorder selection.
	 *
	 * @param filterProtocolos Protocolos
	 * @param tableRequestDto TableRequestDto
	 * @param startsWith Boolean
	 * @return List<TableRowDto<Protocolos>>
	 */	
    List<TableRowDto<Protocolos>> reorderSelection(Protocolos filterProtocolos, TableRequestDto tableRequestDto, Boolean startsWith);
    
     /**
	 * Searches in the Usuario table.
	 *
	 * @param filterProtocolos Protocolos
	 * @param searchProtocolos Protocolos
	 * @param tableRequestDto TableRequestDto
	 * @param startsWith Boolean
	 * @return List<TableRowDto<Protocolos>>	 
	 */	
    List<TableRowDto<Protocolos>> search(Protocolos filterProtocolos, Protocolos searchProtocolos, TableRequestDto tableRequestDto, Boolean startsWith);

    /*
	 * OPERACIONES RUP_TABLE JERARQUIA
	 */
    
    /**
	 * Filter in the hierarchical Protocolos table.
	 *
	 * @param filterProtocolos Protocolos
	 * @param tableRequestDto TableRequestDto
	 * @return List<JerarquiaDto<Protocolos>>
	 */	
	List<JerarquiaDto<Protocolos>> findAllLikeJerarquia(Protocolos filterProtocolos, TableRequestDto tableRequestDto);
	
	/**
	 * Count rows in hierarchy
	 *
	 * @param filterProtocolos Protocolos
	 * @param tableRequestDto TableRequestDto
	 * @return Long
	 */	
	Long findAllLikeCountJerarquia(Protocolos filterProtocolos, TableRequestDto tableRequestDto);
	
	/**
	 * Find dependent hierarchical rows
	 *
	 * @param filterProtocolos Protocolos
	 * @param tableRequestDto TableRequestDto
	 * @return List<TableRowDto<Protocolos>>
	 */	
	List<TableRowDto<Protocolos>> findAllChild(Protocolos filterProtocolos, TableRequestDto tableRequestDto);
	
	/**
    * Exporta Datos al clipBoard
    *
    */
    List<Protocolos> getMultiple(Protocolos filterProtocolos, TableRequestDto tableRequestDto, Boolean startsWith);

	Protocolos findProtocolo(Protocolos protocolo);

	Integer calcularNumPreguntasProtocolo(Protocolos protocolo);

	Integer calcularNumeroRespuestasProtocolo(Protocolos protocolo);

	Integer calcularNumeroInspecciones(Protocolos protocolo);

	Protocolos validarInforme(Protocolos protocolo);

	Protocolos invalidarInforme(Protocolos protocolo);

	Integer calcularNumeroRespuestasValidar(Protocolos protocolo);

	List<Protocolos> findAllREST(Protocolos filterProtocolos);
	
}

