File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 211211 }
212212 else {
213213 // Group by Id - have to build custom SQL
214+ config . sql = 'SELECT i.Id, \n' +
215+ 'i.Id.Dataset.Demographics.gender, \n' +
216+ 'i.Id.Demographics.species, \n' +
217+ 'i.Id.Demographics.calculated_status, \n' +
218+ 'i.Id.Demographics.birth, \n' +
219+ 'i.Id.Demographics.death, \n' +
220+ 'i.Id.curLocation.room AS CurrentRoom, \n' +
221+ 'i.Id.curLocation.cage AS CurrentCage, \n' +
222+ 'i.Id.MostRecentWeight.MostRecentWeight, \n' +
223+ 'i.Id.MostRecentWeight.MostRecentWeightDate \n' +
224+ 'FROM ('
225+
214226 if ( type === 'date' ) {
215- config . sql = 'SELECT Id FROM HousingOverlapsReportDateOnly' ;
227+ config . sql + = 'SELECT Id FROM HousingOverlapsReportDateOnly' ;
216228 }
217229 else {
218- config . sql = 'SELECT Id FROM HousingOverlapsReport' ;
230+ config . sql + = 'SELECT Id FROM HousingOverlapsReport' ;
219231 }
220232
221233 if ( ( rooms && rooms . length ) || cage ) {
234246
235247 if ( filterSql )
236248 config . sql += filterSql ;
237-
238- config . sql += ' GROUP BY Id' ;
239249 }
250+
251+ config . sql += ' GROUP BY Id) i' ;
240252 }
241253
242254 const params = {
You can’t perform that action at this time.
0 commit comments