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

org.sonar.db.issue.ActionPlanStatsMapper.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-mappei.dtd">

<mapper namespace="org.sonar.db.issue.ActionPlanStatsMapper">

  <sql id="actionPlanColumns">
    ap.id as id,
    ap.kee as kee,
    ap.name as name,
    ap.description as description,
    ap.user_login as userLogin,
    ap.project_id as projectId,
    ap.status as status,
    ap.deadline as deadLine,
    ap.created_at as createdAt,
    ap.updated_at as updatedAt,
    p.kee as projectKey,
    p.uuid as projectUuid
  </sql>

  <select id="findByProjectId" parameterType="map" resultType="ActionPlanStats">
    select<include refid="actionPlanColumns"/>, count(total_issues.id) as totalIssues, count(open_issues.id) as
    unresolvedIssues
    from action_plans ap
    left join projects p on p.id = ap.project_id
    left join issues total_issues on total_issues.action_plan_key = ap.kee
    left join issues open_issues on open_issues.id = total_issues.id and open_issues.resolution is null
    <where>
      and ap.project_id = #{projectId}
    </where>
    group by ap.id, ap.kee, ap.name, ap.description, ap.user_login, ap.project_id, ap.status, ap.deadline,
    ap.created_at, ap.updated_at, p.kee, p.uuid
  </select>

</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy