123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.webhook.WebhookMapper">
-
- <sql id="sqlColumns">
- uuid,
- name,
- url,
- project_uuid as projectUuid,
- secret,
- created_at as createdAt,
- updated_at as updatedAt
- </sql>
-
- <select id="selectByUuid" parameterType="String" resultType="org.sonar.db.webhook.WebhookDto">
- select <include refid="sqlColumns" />
- from webhooks
- where uuid = #{webhookUuid,jdbcType=VARCHAR}
- </select>
-
- <select id="selectAllOrderedByName" parameterType="String" resultType="org.sonar.db.webhook.WebhookDto">
- select <include refid="sqlColumns" />
- from webhooks
- order by name asc
- </select>
-
- <select id="selectGlobalWebhooksOrderedByName" parameterType="String" resultType="org.sonar.db.webhook.WebhookDto">
- select <include refid="sqlColumns" />
- from webhooks
- where project_uuid is null
- order by name asc
- </select>
-
- <select id="selectForProjectUuidOrderedByName" parameterType="String" resultType="org.sonar.db.webhook.WebhookDto">
- select <include refid="sqlColumns" />
- from webhooks
- where project_uuid = #{projectUuid,jdbcType=VARCHAR}
- order by name asc
- </select>
-
- <insert id="insert" parameterType="org.sonar.db.webhook.WebhookDto" useGeneratedKeys="false">
- insert into webhooks (
- uuid,
- name,
- url,
- project_uuid,
- secret,
- created_at,
- updated_at
- ) values (
- #{uuid,jdbcType=VARCHAR},
- #{name,jdbcType=VARCHAR},
- #{url,jdbcType=VARCHAR},
- #{projectUuid,jdbcType=VARCHAR},
- #{secret,jdbcType=VARCHAR},
- #{createdAt,jdbcType=BIGINT},
- #{updatedAt,jdbcType=BIGINT}
- )
- </insert>
-
- <update id="update" parameterType="org.sonar.db.webhook.WebhookDto">
- update webhooks set
- name=#{name,jdbcType=VARCHAR},
- url=#{url,jdbcType=VARCHAR},
- secret=#{secret,jdbcType=VARCHAR},
- updated_at=#{updatedAt,jdbcType=BIGINT}
- where uuid=#{uuid,jdbcType=VARCHAR}
- </update>
-
- <delete id="delete" parameterType="String">
- delete from webhooks
- where
- uuid = #{uuid,jdbcType=VARCHAR}
- </delete>
-
- <delete id="deleteForProjectUuid" parameterType="String">
- delete from webhooks
- where
- project_uuid = #{projectUuid,jdbcType=VARCHAR}
- </delete>
-
- </mapper>
|