]> source.dussan.org Git - sonarqube.git/blob
efec92a4183022b7ad599ab36781ba9ed342477e
[sonarqube.git] /
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd">
3
4 <mapper namespace="org.sonar.db.qualitygate.QualityGateGroupPermissionsMapper">
5
6   <sql id="sqlColumns">
7     qggp.uuid as "uuid",
8     qggp.group_uuid as "groupUuid",
9     qggp.quality_gate_uuid as "qualityGateUuid"
10   </sql>
11
12   <select id="selectByQualityGateAndGroup" parameterType="String" resultType="org.sonar.db.qualitygate.QualityGateGroupPermissionsDto">
13     select
14     <include refid="sqlColumns"/>
15     from qgate_group_permissions qggp
16     where
17     qggp.group_uuid = #{groupUuid}
18     and qggp.quality_gate_uuid = #{qualityGateUuid}
19   </select>
20
21   <select id="selectByQualityGateAndGroups" parameterType="map" resultType="org.sonar.db.qualitygate.QualityGateGroupPermissionsDto">
22     select
23     <include refid="sqlColumns"/>
24     from qgate_group_permissions qggp
25     where
26     <foreach collection="groupUuids" open="(" close=")" item="groupUuid" separator=" or ">
27       qggp.group_uuid = #{groupUuid, jdbcType=VARCHAR}
28     </foreach>
29     and qggp.quality_gate_uuid = #{qualityGateUuid, jdbcType=VARCHAR}
30   </select>
31
32   <insert id="insert" useGeneratedKeys="false" parameterType="map">
33     insert into qgate_group_permissions(
34     uuid,
35     group_uuid,
36     quality_gate_uuid,
37     created_at
38     ) values (
39     #{dto.uuid, jdbcType=VARCHAR},
40     #{dto.groupUuid, jdbcType=VARCHAR},
41     #{dto.qualityGateUuid, jdbcType=VARCHAR},
42     #{now, jdbcType=BIGINT}
43     )
44   </insert>
45
46 </mapper>