1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd">
-
- <mapper namespace="org.sonar.db.qualityprofile.QualityProfileExportMapper">
-
- <sql id="exportRuleColumns">
- a.uuid as "activeRuleUuid",
- a.failure_level as "severity",
- r.plugin_rule_key as "rule",
- r.plugin_name as "repository",
- r.priority as "defaultSeverity",
- r.name,
- r.description,
- r.description_format as "descriptionFormat",
- r.rule_type as "type",
- rt.plugin_rule_key as "template",
- rm.note_data as "extendedDescription",
- rm.tags
- </sql>
-
- <sql id="exportRuleParamColumns">
- p.active_rule_uuid as activeRuleUuid,
- p.rules_parameter_key as kee,
- p.value as value
- </sql>
-
- <select id="selectByProfileUuid" parameterType="string" resultType="org.sonar.db.qualityprofile.ExportRuleDto">
- select
- <include refid="exportRuleColumns"/>
- from active_rules a
- inner join rules_profiles rp on rp.uuid = a.profile_uuid
- inner join org_qprofiles oqp on oqp.rules_profile_uuid = rp.uuid
- inner join rules r on r.uuid = a.rule_uuid and r.status != 'REMOVED'
- left join rules rt on rt.uuid = r.template_uuid
- left join rules_metadata rm on rm.rule_uuid = r.uuid
- where oqp.uuid = #{id, jdbcType=VARCHAR}
- </select>
-
- <select id="selectParamsByActiveRuleUuids" parameterType="map" resultType="org.sonar.db.qualityprofile.ExportRuleParamDto">
- select
- <include refid="exportRuleParamColumns"/>
- from active_rule_parameters p
- <where>
- p.active_rule_uuid in <foreach collection="activeRuleUuids" open="(" close=")" item="activeRuleUuid" separator=",">#{activeRuleUuid,jdbcType=VARCHAR}</foreach>
- </where>
- </select>
- </mapper>
|