All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.db.qualitygate.ProjectQgateAssociationMapper.xml Maven / Gradle / Ivy

There is a newer version: 6.3.1
Show newest version
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="org.sonar.db.qualitygate.ProjectQgateAssociationMapper">

  <select id="selectProjects" parameterType="map" resultType="ProjectQgateAssociation">
    SELECT proj.id as id, proj.name as name, prop.text_value as gateId
    FROM projects proj
    <if test="query.projectSearch() != null">
      JOIN resource_index ind ON ind.root_project_id=proj.id
    </if>
    LEFT JOIN properties prop ON prop.resource_id=proj.id AND prop.prop_key='sonar.qualitygate' AND prop.text_value LIKE
    #{gateId}
    <where>
      <choose>
        <when test="query.membership() == 'selected'">
          AND prop.text_value IS NOT NULL
        </when>
        <when test="query.membership() == 'deselected'">
          AND prop.text_value IS NULL
        </when>
      </choose>
      <if test="query.projectSearch() != null">
        AND ind.kee LIKE #{query.projectSearchSql}
      </if>
      AND proj.qualifier='TRK'
      AND proj.scope='PRJ'
      <if test="query.projectSearch() != null">
        AND ind.qualifier='TRK'
      </if>
    </where>
    ORDER BY proj.name
  </select>

</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy