package com.ejie.t17i.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ejie.t17i.constants.T17Constants;
import com.ejie.t17i.dao.PortalDao;
import com.ejie.t17i.model.Portal;
import com.ejie.x38.dto.JQGridRequestDto;

/**
 * <p>
 * Implementaci&oacute;n de servicios de l&oacute:gica de negocio para acceder a la tabla TIPO_VIA de NORA
 * </p> 
XXXX
 * @see com.ejie.t17i.model.Portal
 */
@Service(value = "portalService")
public class PortalServiceImpl implements PortalService {

	@Autowired
	private PortalDao portalDao;

	/**
	 * {@inheritDoc}
	 */
	public Portal find(final Portal portal) {
		return (Portal) this.portalDao.find(portal);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Portal> findAll(final Portal portal,final JQGridRequestDto jqGridRequestDto) {
		portal.setEstado(T17Constants.ESTADO_DEFINITIVO);
		return (List<Portal>) this.portalDao.findAll(portal, jqGridRequestDto);
	}
	/**
	 * {@inheritDoc}
	 */
	public Long findAllCount(final Portal portal) {
		portal.setEstado(T17Constants.ESTADO_DEFINITIVO);
		return this.portalDao.findAllCount(portal);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Portal> findAllLike(final Portal portal,final JQGridRequestDto jqGridRequestDto,final Boolean startsWith) {
		portal.setEstado(T17Constants.ESTADO_DEFINITIVO);
		return (List<Portal>) this.portalDao.findAllLike(portal, jqGridRequestDto,	startsWith);
	}
	/**
	 * {@inheritDoc}
	 */
	public List<Portal> findAllLikeCP(final Portal portal,final JQGridRequestDto jqGridRequestDto,final Boolean startsWith) {
		portal.setEstado(T17Constants.ESTADO_DEFINITIVO);
		return (List<Portal>) this.portalDao.findAllLikeCP(portal, jqGridRequestDto,	startsWith);
	}
}
