</where>
</select>
- <select id="selectIssues" parameterType="map" resultType="Issue" fetchSize="100000">
- select
- <choose>
- <when test="returnOnlyIdAndSortColumns == true">
- i.id
- <include refid="sortColumn"/>
- from issues i
- </when>
- <otherwise>
- <include refid="issueColumns"/>
- from issues i
- inner join rules r on r.id=i.rule_id
- inner join projects p on p.id=i.component_id
- inner join projects root on root.id=i.root_component_id
- </otherwise>
- </choose>
+ <select id="selectIssues" parameterType="map" resultType="Issue">
+ select <include refid="issueColumns"/>
+ from issues i
+ inner join rules r on r.id=i.rule_id
+ inner join projects p on p.id=i.component_id
+ inner join projects root on root.id=i.root_component_id
<include refid="selectQueryConditions"/>
- <if test="maxResults != null">
- limit #{maxResults}
- </if>
+ </select>
+
+ <select id="selectIssueIds" parameterType="map" resultType="Issue">
+ select i.id <include refid="sortColumn"/>
+ from issues i
+ <include refid="selectQueryConditions"/>
+ limit #{maxResults}
</select>
<!-- SQL Server -->
- <select id="selectIssues" parameterType="map" resultType="Issue" fetchSize="100000" databaseId="mssql">
- select
- <if test="maxResults != null">
- top (#{maxResults})
- </if>
- <choose>
- <when test="returnOnlyIdAndSortColumns == true">
- i.id
- <include refid="sortColumn"/>
- from issues i
- </when>
- <otherwise>
- <include refid="issueColumns"/>
- from issues i
- inner join rules r on r.id=i.rule_id
- inner join projects p on p.id=i.component_id
- inner join projects root on root.id=i.root_component_id
- </otherwise>
- </choose>
+ <select id="selectIssueIds" parameterType="map" resultType="Issue" databaseId="mssql">
+ select top (#{maxResults}) i.id <include refid="sortColumn"/>
+ from issues i
<include refid="selectQueryConditions"/>
</select>
<!-- Oracle -->
- <select id="selectIssues" parameterType="map" resultType="Issue" fetchSize="100000" databaseId="oracle">
+ <select id="selectIssueIds" parameterType="map" resultType="Issue" databaseId="oracle">
select * from (select
- <choose>
- <when test="returnOnlyIdAndSortColumns == true">
- i.id
- <include refid="sortColumn"/>
- </when>
- <otherwise>
- <include refid="issueColumns"/>
- from issues i
- inner join rules r on r.id=i.rule_id
- inner join projects p on p.id=i.component_id
- inner join projects root on root.id=i.root_component_id
- </otherwise>
- </choose>
- <include refid="selectQueryConditions"/>
+ i.id <include refid="sortColumn"/>
+ from issues i
+ <include refid="selectQueryConditions"/>
)
- <if test="maxResults != null">
- where rownum <= #{maxResults}
- </if>
+ where rownum <= #{maxResults}
</select>
<sql id="selectQueryConditions">