diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-04-06 19:19:51 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2016-04-07 13:55:39 +0200 |
commit | 9d3436c83373e930762fffefc3430c9f50b46cf2 (patch) | |
tree | 8b649793633cf99654d9c2b2c3f56f5b786295a6 /sonar-db | |
parent | 616389be7c3eecd9a979aafec6d42c4445a1558a (diff) | |
download | sonarqube-9d3436c83373e930762fffefc3430c9f50b46cf2.tar.gz sonarqube-9d3436c83373e930762fffefc3430c9f50b46cf2.zip |
SONAR-7528 WS api/measures/component handles developer measures
Diffstat (limited to 'sonar-db')
-rw-r--r-- | sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java | 2 | ||||
-rw-r--r-- | sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java b/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java index fb9d7254bcc..5c0910167c0 100644 --- a/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java +++ b/sonar-db/src/main/java/org/sonar/db/measure/MeasureMapper.java @@ -33,7 +33,7 @@ public interface MeasureMapper { List<MeasureDto> selectBySnapshotAndMetricKeys(@Param("snapshotId") long snapshotId, @Param("metricKeys") List<String> metricKeys); - List<MeasureDto> selectByDeveloperForSnapshotAndMetrics(@Param("developerId") long developerId, @Param("snapshotId") long snapshotId, + List<MeasureDto> selectByDeveloperForSnapshotAndMetrics(@Nullable @Param("developerId") Long developerId, @Param("snapshotId") long snapshotId, @Param("metricIds") List<Integer> metricIds); List<MeasureDto> selectBySnapshotAndMetrics(@Param("snapshotId") long snapshotId, @Param("metricIds") List<Integer> input); diff --git a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml index 7c97ed532e9..eb938f119ba 100644 --- a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml @@ -76,7 +76,12 @@ FROM project_measures pm <where> pm.snapshot_id = #{snapshotId} - AND pm.person_id = #{developerId} + <if test="developerId!=null"> + AND pm.person_id = #{developerId} + </if> + <if test="developerId==null"> + AND pm.person_id is NULL + </if> AND <foreach item="metricId" index="index" collection="metricIds" open="(" separator=" or " close=")"> pm.metric_id=#{metricId} |