19 package org.turro.dossier.grant;
21 import org.turro.elephant.db.WhereClause;
29 private String searchValue;
30 private boolean minimis, nominimis;
31 private boolean subvention, loan, combination;
32 private boolean collaboration, individual;
33 private boolean hiring, idi, investment, startUp;
34 private boolean micro, small, medium, big;
35 private boolean active, ended, recurrent;
42 this.searchValue = searchValue;
47 this.nominimis =
false;
55 this.minimis = minimis;
56 this.nominimis =
false;
64 this.nominimis = nominimis;
69 this.subvention =
false;
71 this.combination =
false;
79 this.subvention = subvention;
81 this.combination =
false;
90 this.subvention =
false;
91 this.combination =
false;
99 this.combination = combination;
100 this.subvention =
false;
105 this.collaboration =
false;
106 this.individual =
false;
110 return collaboration;
114 this.collaboration = collaboration;
115 this.individual =
false;
123 this.individual = individual;
124 this.collaboration =
false;
130 this.investment =
false;
131 this.startUp =
false;
139 this.hiring = hiring;
155 this.investment = investment;
163 this.startUp = startUp;
187 this.medium = medium;
201 this.recurrent =
false;
209 this.active = active;
211 this.recurrent =
false;
221 this.recurrent =
false;
229 this.recurrent = recurrent;
236 wc.
addClause(
"select distinct g from ProjectGrant g");
243 wc.
addClause(
"select count(distinct g) from ProjectGrant g");
250 wc.
addClause(
"select distinct g from AxProjectGrant g");
257 wc.
addClause(
"select count(distinct g) from AxProjectGrant g");
264 wc.
addLikeFields(
new String[] {
"g.title",
"g.goal.text",
"g.beneficiaries.text",
265 "g.elegible.text",
"g.features.text" }, searchValue);
285 wc.
addClause(
"and g.collaboration = TRUE");
288 wc.
addClause(
"and g.collaboration = FALSE");
291 wc.
addClause(
"and g.matchCriteria.hiring = TRUE");
294 wc.
addClause(
"and g.matchCriteria.idi = TRUE");
297 wc.
addClause(
"and g.matchCriteria.investment = TRUE");
300 wc.
addClause(
"and g.matchCriteria.startUp = TRUE");
302 if(micro | small | medium | big) {
324 wc.
addClause(
"and (g.endDate is null or g.endDate > now())");
334 private void addCriteriaAx(WhereClause wc) {
335 wc.addClause(
"where 1=1");
336 wc.addLikeFields(
new String[] {
"g.goal.text",
"g.beneficiaries.text",
337 "g.elegible.text",
"g.features.text" }, searchValue);
339 wc.addClause(
"and g.minimis = TRUE");
342 wc.addClause(
"and g.minimis = FALSE");
345 wc.addClause(
"and subvention = TRUE");
346 wc.addClause(
"and loan = TRUE");
349 wc.addClause(
"and subvention = TRUE");
350 wc.addClause(
"and loan = FALSE");
353 wc.addClause(
"and loan = TRUE");
354 wc.addClause(
"and subvention = FALSE");
357 wc.addClause(
"and g.collaboration = TRUE");
360 wc.addClause(
"and g.collaboration = FALSE");
363 wc.addClause(
"and g.hiring = TRUE");
366 wc.addClause(
"and g.idi = TRUE");
369 wc.addClause(
"and g.investment = TRUE");
372 wc.addClause(
"and g.startUp = TRUE");
374 if(micro | small | medium | big) {
376 wc.addClause(
"and (");
378 wc.addClause(sep +
"g.micro = TRUE");
382 wc.addClause(sep +
"g.small = TRUE");
386 wc.addClause(sep +
"g.medium = TRUE");
390 wc.addClause(sep +
"g.big = TRUE");
396 wc.addClause(
"and (g.endDate is null or g.endDate > now())");
399 wc.addClause(
"and g.endDate < now()");
402 wc.addClause(
"and g.recurrent = TRUE");
void setRecurrent(boolean recurrent)
void setCombination(boolean combination)
WhereClause createCount()
void setSmall(boolean small)
void setLoan(boolean loan)
void setSearchValue(String searchValue)
WhereClause createCountAx()
boolean isCollaboration()
void setSubvention(boolean subvention)
void setCollaboration(boolean collaboration)
void clearCollaboration()
void setActive(boolean active)
void setMedium(boolean medium)
void setMicro(boolean micro)
void setIndividual(boolean individual)
void setInvestment(boolean investment)
void setMinimis(boolean minimis)
void setHiring(boolean hiring)
void setNominimis(boolean nominimis)
void setStartUp(boolean startUp)
void setEnded(boolean ended)
void addClause(String clause)
void addLikeFields(String[] fields, String value)