Revision 7836684b
Added by Alexander Oppermann over 8 years ago
src/main/java/eu/etaxonomy/cdm/vaadin/presenter/dbstatus/DistributionTablePresenter.java | ||
---|---|---|
61 | 61 |
|
62 | 62 |
|
63 | 63 |
|
64 |
//for sql container |
|
65 |
public static final String NAME_ID = "Name"; |
|
66 |
public static final String PB_ID = "Pb"; |
|
67 |
public static final String FN_ID = "Fn"; |
|
68 |
public static final String UNP_ID = "Unp"; |
|
69 |
public static final String UNR_ID = "Unr"; |
|
70 |
|
|
71 |
public static String TERM = null; |
|
72 |
|
|
73 |
// private static final String SELECT_QUERY="SELECT tb.id as taxon_id, tnb.titleCache as " + NAME_ID + " , tb.publish as " + PB_ID + " , tb.unplaced as " + UNP_ID + FROM_QUERY; |
|
74 |
private static final String SELECT_QUERY="Select tb.DTYPE, tb.id, tb.titleCache AS Taxon, deb.DTYPE, deb.id, deb.area_id, dtb.vocabulary_id, dtb1.vocabulary_id, "; |
|
75 |
|
|
76 |
private static final String PIVOT_QUERY = "MAX( IF(dtb1.titleCache = '"+ TERM +"', dtb.titleCache, NULL) ) as '"+ TERM +"',"; |
|
77 |
|
|
78 |
private static final String FROM_QUERY = " From TaxonBase tb JOIN DescriptionBase db ON db.taxon_id=tb.id JOIN DescriptionElementBase deb ON deb.indescription_id=db.id Join DefinedTermBase dtb on deb.status_id=dtb.id Join DefinedTermBase dtb1 on deb.area_id=dtb1.id WHERE deb.DTYPE LIKE 'Distribution' GROUP BY tb.id"; |
|
79 |
|
|
80 |
private static final String COUNT_QUERY = "SELECT count(*) " + FROM_QUERY; |
|
81 |
|
|
82 |
|
|
64 | 83 |
public ComboBox updateDistributionField(DescriptionElementBase deb, |
65 | 84 |
Distribution db, |
66 | 85 |
BeanItemContainer<PresenceAbsenceTerm> termContainer, ComboBox box, |
... | ... | |
164 | 183 |
|
165 | 184 |
} |
166 | 185 |
|
186 |
|
|
167 | 187 |
@Override |
168 | 188 |
public List<PresenceAbsenceTerm> getPresenceAbsenceTerms() { |
169 | 189 |
//TODO Better to use TermType instead of class to get the list |
Also available in: Unified diff
starting to implement sql queries...the container is not done yet.