]> source.dussan.org Git - sonarqube.git/blob
411e29b1904a1cfd120937c99bf1ca2f1c4b9463
[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.QualityGateUserPermissionsMapper">
5
6   <sql id="sqlColumns">
7     qup.uuid as "uuid",
8     qup.user_uuid as "userUuid",
9     qup.quality_gate_uuid as "qualityGateUuid"
10   </sql>
11
12   <select id="selectByQualityGateAndUser" parameterType="String" resultType="org.sonar.db.qualitygate.QualityGateUserPermissionsDto">
13     select
14     <include refid="sqlColumns"/>
15     from qgate_user_permissions qup
16     where
17     qup.user_uuid = #{userUuid}
18     and qup.quality_gate_uuid = #{qualityGateUuid}
19   </select>
20
21   <insert id="insert" useGeneratedKeys="false" parameterType="map">
22     insert into qgate_user_permissions(
23     uuid,
24     user_uuid,
25     quality_gate_uuid,
26     created_at
27     ) values (
28     #{dto.uuid, jdbcType=VARCHAR},
29     #{dto.userUuid, jdbcType=VARCHAR},
30     #{dto.qualityGateUuid, jdbcType=VARCHAR},
31     #{now, jdbcType=BIGINT}
32     )
33   </insert>
34
35
36 </mapper>
37