git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@28119 d1611594-4594-4d17-8e1d-87c2c4800839
parent
fc2f3e7d1c
commit
9bdb8f6700
|
@ -7,6 +7,7 @@ package com.rjconsultores.ventaboletos.dao;
|
|||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import java.util.Date;
|
||||
|
||||
|
@ -17,4 +18,6 @@ import java.util.Date;
|
|||
public interface CorridaCtrlDAO extends GenericDAO<CorridaCtrl, Integer> {
|
||||
|
||||
public CorridaCtrl buscar(Ruta ruta, ClaseServicio claseServicio, Marca marca, Date horario, boolean pisoExtra);
|
||||
|
||||
public CorridaCtrl buscar(Integer corridaId, Parada origem, Parada destino, ClaseServicio claseServicio, Marca marca);
|
||||
}
|
||||
|
|
|
@ -8,10 +8,12 @@ import com.rjconsultores.ventaboletos.dao.CorridaCtrlDAO;
|
|||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -56,4 +58,30 @@ public class CorridaCtrlHibernateDAO extends GenericHibernateDAO<CorridaCtrl, In
|
|||
return lsCorridaCtrl.get(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorridaCtrl buscar(Integer corridaId, Parada origem, Parada destino, ClaseServicio claseServicio, Marca marca) {
|
||||
StringBuilder hql = new StringBuilder();
|
||||
hql.append(" SELECT cc ");
|
||||
hql.append(" FROM CorridaCtrl cc ");
|
||||
hql.append(" INNER JOIN cc.ruta.rutaCombinacionList AS rutaCombinacionList ");
|
||||
hql.append(" INNER JOIN rutaCombinacionList.tramo AS tramo");
|
||||
hql.append(" WHERE cc.activo = true ");
|
||||
hql.append(" AND cc.corridaId = :corridaId ");
|
||||
hql.append(" AND cc.marca.marcaId = :marcaId ");
|
||||
hql.append(" AND cc.claseServicio = :claseservicioId ");
|
||||
hql.append(" AND tramo.activo = true ");
|
||||
hql.append(" AND tramo.origem.paradaId = :paradaOrigemId ");
|
||||
hql.append(" AND tramo.destino.paradaId = :paradaDestinoId ");
|
||||
hql.append(" AND rutaCombinacionList.activo = true ");
|
||||
|
||||
Query sq = getSession().createQuery(hql.toString());
|
||||
sq.setInteger("corridaId", corridaId);
|
||||
sq.setInteger("marcaId", marca.getMarcaId());
|
||||
sq.setInteger("claseservicioId", claseServicio.getClaseservicioId());
|
||||
sq.setInteger("paradaOrigemId", origem.getParadaId());
|
||||
sq.setInteger("paradaDestinoId", destino.getParadaId());
|
||||
|
||||
return (CorridaCtrl) sq.uniqueResult();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,11 +6,10 @@ package com.rjconsultores.ventaboletos.entidad;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
@ -18,7 +17,6 @@ import javax.persistence.OneToOne;
|
|||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -75,6 +75,8 @@ public class PricingEspecifico implements Serializable {
|
|||
@JoinColumn(name = "CATEGORIA_ID", referencedColumnName = "CATEGORIA_ID")
|
||||
@ManyToOne
|
||||
private Categoria categoria;
|
||||
@Column(name = "CORRIDA_ID")
|
||||
private Integer corridaId;
|
||||
|
||||
public PricingEspecifico() {
|
||||
}
|
||||
|
@ -211,6 +213,14 @@ public class PricingEspecifico implements Serializable {
|
|||
this.nombPricing = nombPricing;
|
||||
}
|
||||
|
||||
public Integer getCorridaId() {
|
||||
return corridaId;
|
||||
}
|
||||
|
||||
public void setCorridaId(Integer corridaId) {
|
||||
this.corridaId = corridaId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 0;
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.Date;
|
|||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
|
||||
/**
|
||||
|
@ -24,4 +25,6 @@ public interface CorridaCtrlService {
|
|||
public CorridaCtrl actualizacion(CorridaCtrl entidad);
|
||||
|
||||
public CorridaCtrl buscar(Ruta ruta, ClaseServicio claseServicio, Marca marca, Date horario, boolean pisoExtra);
|
||||
|
||||
public CorridaCtrl buscar(Integer corridaId, Parada origem, Parada destino, ClaseServicio claseServicio, Marca marca);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ package com.rjconsultores.ventaboletos.service.impl;
|
|||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
@ -16,6 +15,7 @@ import com.rjconsultores.ventaboletos.dao.CorridaCtrlDAO;
|
|||
import com.rjconsultores.ventaboletos.entidad.ClaseServicio;
|
||||
import com.rjconsultores.ventaboletos.entidad.CorridaCtrl;
|
||||
import com.rjconsultores.ventaboletos.entidad.Marca;
|
||||
import com.rjconsultores.ventaboletos.entidad.Parada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Ruta;
|
||||
import com.rjconsultores.ventaboletos.service.CorridaCtrlService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
@ -29,7 +29,6 @@ public class CorridaCtrlServiceImpl implements CorridaCtrlService {
|
|||
|
||||
@Autowired
|
||||
private CorridaCtrlDAO corridaCtrlDAO;
|
||||
private static Logger log = Logger.getLogger(CorridaCtrlServiceImpl.class);
|
||||
|
||||
public CorridaCtrl obtenerID(Integer id) {
|
||||
return corridaCtrlDAO.obtenerID(id);
|
||||
|
@ -65,4 +64,8 @@ public class CorridaCtrlServiceImpl implements CorridaCtrlService {
|
|||
return corridaCtrlDAO.buscar(ruta, claseServicio, marca, horario, pisoExtra);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CorridaCtrl buscar(Integer corridaId, Parada origem, Parada destino, ClaseServicio claseServicio, Marca marca) {
|
||||
return corridaCtrlDAO.buscar(corridaId, origem, destino, claseServicio, marca);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue