Skip to content

Commit

Permalink
#486 fixed query alias
Browse files Browse the repository at this point in the history
  • Loading branch information
marcos-lg committed Jul 18, 2023
1 parent eca56b3 commit f2d924f
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@

<select id="listByDataset" resultMap="DATASET_OCCURRENCE_DOWNLOAD_MAP" parameterType="map">
SELECT <include refid="DATASET_OCCURRENCE_DOWNLOAD_FIELDS"/>,<include refid="org.gbif.registry.persistence.mapper.OccurrenceDownloadMapper.OCCURRENCE_DOWNLOAD_FIELDS"/>
FROM dataset_occurrence_download JOIN occurrence_download od ON download_key = od.key
WHERE dataset_key = #{datasetKey,jdbcType=OTHER}
<if test="type != null"> AND od.type = #{type,jdbcType=OTHER}</if>
ORDER BY created DESC, key
FROM dataset_occurrence_download dod
JOIN occurrence_download od ON dod.download_key = od.key
WHERE dod.dataset_key = #{datasetKey,jdbcType=OTHER}
<if test="type != null">
AND od.type = #{type,jdbcType=OTHER}
</if>
ORDER BY od.created DESC, od.key
<if test="page != null" >
LIMIT #{page.limit} OFFSET #{page.offset}
</if>
Expand Down

0 comments on commit f2d924f

Please sign in to comment.