fixes bug #8524
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@64826 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
7b78b14d1d
commit
07e5206869
|
@ -776,20 +776,28 @@ public class CorridaHibernateDAO extends GenericHibernateDAO<Corrida, Corrida.Id
|
||||||
sql.append(" inner join ruta r on c.ruta_id = r.ruta_id ");
|
sql.append(" inner join ruta r on c.ruta_id = r.ruta_id ");
|
||||||
sql.append(" inner join clase_servicio cs on c.claseservicio_id = cs.claseservicio_id ");
|
sql.append(" inner join clase_servicio cs on c.claseservicio_id = cs.claseservicio_id ");
|
||||||
sql.append(" where c.activo <> 0 ");
|
sql.append(" where c.activo <> 0 ");
|
||||||
sql.append(corridaId == null ? "" : " and c.corrida_id = :corridaId ");
|
if(corridaId!=null){
|
||||||
|
sql.append(" and c.corrida_id = :corridaId ");
|
||||||
|
}
|
||||||
sql.append(feccorrida == null ? "" : " and c.feccorrida = :feccorrida ");
|
sql.append(feccorrida == null ? "" : " and c.feccorrida = :feccorrida ");
|
||||||
sql.append(origem == null ? "" : " and c.origen_id = :origen_id ");
|
if(origem!=null){
|
||||||
sql.append(destino == null ? "" : " and c.destino_id = :destino_id ");
|
sql.append(origem == null ? "" : " and c.origen_id = :origen_id ");
|
||||||
|
}
|
||||||
|
if(destino!=null){
|
||||||
|
sql.append(destino == null ? "" : " and c.destino_id = :destino_id ");
|
||||||
|
}
|
||||||
|
|
||||||
Query query = getSession().createSQLQuery(sql.toString());
|
Query query = getSession().createSQLQuery(sql.toString());
|
||||||
if (corridaId != null) {
|
if (corridaId != null) {
|
||||||
query.setParameter("corridaId", corridaId);
|
query.setParameter("corridaId", corridaId);
|
||||||
} else {
|
|
||||||
query.setParameter("corridaId", '%');
|
|
||||||
}
|
}
|
||||||
query.setParameter("feccorrida", feccorrida);
|
query.setParameter("feccorrida", feccorrida);
|
||||||
query.setParameter("origen_id", origem.getParadaId());
|
if(origem!=null){
|
||||||
query.setParameter("destino_id", destino.getParadaId());
|
query.setParameter("origen_id", origem.getParadaId());
|
||||||
|
}
|
||||||
|
if(destino!=null){
|
||||||
|
query.setParameter("destino_id", destino.getParadaId());
|
||||||
|
}
|
||||||
|
|
||||||
List<Object> lsObject = query.list();
|
List<Object> lsObject = query.list();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue