You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

QualityProfileExportMapper.xml 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd">
  3. <mapper namespace="org.sonar.db.qualityprofile.QualityProfileExportMapper">
  4. <sql id="exportRuleColumns">
  5. a.uuid as "activeRuleUuid",
  6. a.failure_level as "severity",
  7. r.plugin_rule_key as "rule",
  8. r.plugin_name as "repository",
  9. r.priority as "defaultSeverity",
  10. r.name,
  11. r.description,
  12. r.description_format as "descriptionFormat",
  13. r.rule_type as "type",
  14. rt.plugin_rule_key as "template",
  15. rm.note_data as "extendedDescription",
  16. rm.tags
  17. </sql>
  18. <sql id="exportRuleParamColumns">
  19. p.active_rule_uuid as activeRuleUuid,
  20. p.rules_parameter_key as kee,
  21. p.value as value
  22. </sql>
  23. <select id="selectByProfileUuid" parameterType="string" resultType="org.sonar.db.qualityprofile.ExportRuleDto">
  24. select
  25. <include refid="exportRuleColumns"/>
  26. from active_rules a
  27. inner join rules_profiles rp on rp.uuid = a.profile_uuid
  28. inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid
  29. inner join rules r on r.uuid = a.rule_uuid and r.status != 'REMOVED'
  30. left join rules rt on rt.uuid = r.template_uuid
  31. left join rules_metadata rm on rm.rule_uuid = r.uuid
  32. where oqp.uuid = #{id, jdbcType=VARCHAR}
  33. </select>
  34. <select id="selectParamsByActiveRuleUuids" parameterType="map" resultType="org.sonar.db.qualityprofile.ExportRuleParamDto">
  35. select
  36. <include refid="exportRuleParamColumns"/>
  37. from active_rule_parameters p
  38. <where>
  39. p.active_rule_uuid in <foreach collection="activeRuleUuids" open="(" close=")" item="activeRuleUuid" separator=",">#{activeRuleUuid,jdbcType=VARCHAR}</foreach>
  40. </where>
  41. </select>
  42. </mapper>