fixes bug #6786
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@49613 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
d49f1510b8
commit
68d223d59f
|
@ -4,6 +4,9 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao;
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PrecioVentaja;
|
import com.rjconsultores.ventaboletos.entidad.PrecioVentaja;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,6 +14,8 @@ import com.rjconsultores.ventaboletos.entidad.PrecioVentaja;
|
||||||
* @author Igor
|
* @author Igor
|
||||||
*/
|
*/
|
||||||
public interface PrecioVentajaDAO extends GenericDAO<PrecioVentaja, Integer> {
|
public interface PrecioVentajaDAO extends GenericDAO<PrecioVentaja, Integer> {
|
||||||
|
|
||||||
|
public List<PrecioVentaja> buscarPrecioVentaja(Integer origenId, Integer destinoId, Integer rutaId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,16 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.PrecioVentajaDAO;
|
import com.rjconsultores.ventaboletos.dao.PrecioVentajaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PrecioVentaja;
|
import com.rjconsultores.ventaboletos.entidad.PrecioVentaja;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,4 +29,26 @@ public class PrecioVentajaHibernateDAO extends GenericHibernateDAO<PrecioVentaja
|
||||||
setSessionFactory(factory);
|
setSessionFactory(factory);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PrecioVentaja> buscarPrecioVentaja(Integer origenId, Integer destinoId, Integer rutaId) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(" from PrecioVentaja ");
|
||||||
|
sb.append(" where activo = 1 ");
|
||||||
|
|
||||||
|
if (origenId != null) {
|
||||||
|
sb.append(" and origenOriginalId = ").append(origenId);
|
||||||
|
}
|
||||||
|
if (destinoId != null) {
|
||||||
|
sb.append(" and destinoOriginalId = ").append(destinoId);
|
||||||
|
}
|
||||||
|
if (rutaId != null) {
|
||||||
|
sb.append(" and rutaOriginalId = ").append(rutaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Query query = getSession().createQuery(sb.toString());
|
||||||
|
List<PrecioVentaja> list = query.list();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
import com.rjconsultores.ventaboletos.entidad.PrecioVentaja;
|
import com.rjconsultores.ventaboletos.entidad.PrecioVentaja;
|
||||||
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
|
@ -16,5 +19,6 @@ public interface PrecioVentajaService {
|
||||||
|
|
||||||
public PrecioVentaja suscribirActualizacion(PrecioVentaja entidad) throws BusinessException;
|
public PrecioVentaja suscribirActualizacion(PrecioVentaja entidad) throws BusinessException;
|
||||||
public void borrar(PrecioVentaja entidad) throws RegistroConDependenciaException;
|
public void borrar(PrecioVentaja entidad) throws RegistroConDependenciaException;
|
||||||
|
public List<PrecioVentaja> buscarPrecioVentaja(Integer origenId, Integer destinoId, Integer rutaid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,4 +139,9 @@ public class PrecioVentajaServiceImpl implements PrecioVentajaService {
|
||||||
precioVentajaDAO.actualizacion(entidad);
|
precioVentajaDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PrecioVentaja> buscarPrecioVentaja(Integer origenId, Integer destinoId, Integer rutaid) {
|
||||||
|
return precioVentajaDAO.buscarPrecioVentaja(origenId, destinoId, rutaid);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue