Modified getOrdersIdsByDates query to get the intersecting projects between start and end dates

In this way it's possible to get all the projects for wich some part of their lenght is
comprehended between the defined start and end dates, with the previous strategy only the
projects which were completely included in the interval were being listed.

FEA: ItEr77S15FilteringEnhancements
This commit is contained in:
Lorenzo Tilve Álvaro 2013-02-05 19:06:21 +01:00
parent 49b5b941bd
commit eefd4026fd

View file

@ -320,11 +320,11 @@ public class OrderDAO extends IntegrationEntityDAO<Order> implements
String strQuery = "SELECT t.taskSource.schedulingData.orderElement.id "
+ "FROM TaskElement t "
+ "WHERE t.parent IS NULL ";
if (startDate != null) {
strQuery += "AND t.startDate.date >= :startDate ";
}
if (endDate != null) {
strQuery += "AND t.endDate.date <= :endDate ";
strQuery += "AND t.startDate.date <= :endDate ";
}
if (startDate != null) {
strQuery += "AND t.endDate.date >= :startDate ";
}
Query query = getSession().createQuery(strQuery);