]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8995 a bit of formatting on CeQueueMapper.xml
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Mon, 27 Mar 2017 09:16:35 +0000 (11:16 +0200)
committerEric Hartmann <hartmann.eric@gmail.Com>
Thu, 27 Apr 2017 07:23:18 +0000 (09:23 +0200)
server/sonar-db-dao/src/main/resources/org/sonar/db/ce/CeQueueMapper.xml

index ebd64ab82ea3b49ac3271d7fa96d4768731ecfb9..8e03d719f5cb762a9f0d29826b7a3cbcac797584 100644 (file)
   </sql>
 
   <sql id="orderByDateAndId">
-    order by cq.created_at asc, cq.id asc
+    order by
+      cq.created_at asc,
+      cq.id asc
   </sql>
 
   <sql id="orderByDescDateAndId">
-    order by cq.created_at desc, cq.id desc
+    order by
+      cq.created_at desc,
+      cq.id desc
   </sql>
 
   <select id="selectByUuid" parameterType="String" resultType="org.sonar.db.ce.CeQueueDto">
     select
-    <include refid="columns"/>
-    from ce_queue cq
-    where cq.uuid=#{uuid,jdbcType=VARCHAR}
+      <include refid="columns"/>
+    from
+      ce_queue cq
+    where
+      cq.uuid=#{uuid,jdbcType=VARCHAR}
   </select>
 
   <select id="countByStatusAndComponentUuid" parameterType="map" resultType="int">
-    select count(1)
-    from ce_queue
-    where status=#{status,jdbcType=VARCHAR}
-    <if test="componentUuid!=null">
-      and component_uuid=#{componentUuid,jdbcType=VARCHAR}
-    </if>
+    select
+      count(1)
+    from
+      ce_queue
+    where
+      status=#{status,jdbcType=VARCHAR}
+      <if test="componentUuid!=null">
+        and component_uuid=#{componentUuid,jdbcType=VARCHAR}
+      </if>
   </select>
 
   <select id="countAll" resultType="int">
-    select count(1) from ce_queue
+    select
+      count(1)
+    from
+      ce_queue
   </select>
 
   <select id="selectByComponentUuid" parameterType="String" resultType="org.sonar.db.ce.CeQueueDto">
     select
-    <include refid="columns"/>
-    from ce_queue cq
-    where cq.component_uuid=#{componentUuid,jdbcType=VARCHAR}
+      <include refid="columns"/>
+    from
+      ce_queue cq
+    where
+      cq.component_uuid=#{componentUuid,jdbcType=VARCHAR}
     <include refid="orderByDateAndId"/>
   </select>
 
   <select id="selectAllInAscOrder" resultType="org.sonar.db.ce.CeQueueDto">
     select
-    <include refid="columns"/>
-    from ce_queue cq
+      <include refid="columns"/>
+    from
+      ce_queue cq
     <include refid="orderByDateAndId"/>
   </select>
 
   </select>
 
   <select id="countByQuery" resultType="int">
-    select count(1)
+    select
+      count(1)
     <include refid="sqlSelectByQuery"/>
   </select>
 
   <sql id="sqlSelectByQuery">
-    from ce_queue cq
+    from
+      ce_queue cq
     <where>
       <if test="query.componentUuids != null and query.componentUuids.size()>0">
         and cq.component_uuid in
   </sql>
 
   <select id="selectEligibleForPeek" resultType="String">
-    select cq.uuid
-    from ce_queue cq
-    where cq.status='PENDING'
-    and not exists(
-    select 1
-    from ce_queue cq2
-    where cq.component_uuid=cq2.component_uuid and cq2.status &lt;&gt; 'PENDING'
-    )
+    select
+      cq.uuid
+    from
+      ce_queue cq
+    where
+      cq.status='PENDING'
+      and not exists (
+        select
+          1
+        from
+          ce_queue cq2
+        where
+          cq.component_uuid=cq2.component_uuid
+          and cq2.status &lt;&gt; 'PENDING'
+      )
     <include refid="orderByDateAndId"/>
   </select>
 
   <insert id="insert" parameterType="org.sonar.db.ce.CeQueueDto" useGeneratedKeys="false">
     insert into ce_queue
-    (uuid, task_type, component_uuid, status, submitter_login, started_at, created_at, updated_at)
+    (
+      uuid,
+      task_type,
+      component_uuid,
+      status,
+      submitter_login,
+      started_at,
+      created_at,
+      updated_at
+    )
     values (
-    #{uuid,jdbcType=VARCHAR},
-    #{taskType,jdbcType=VARCHAR},
-    #{componentUuid,jdbcType=VARCHAR},
-    #{status,jdbcType=VARCHAR},
-    #{submitterLogin,jdbcType=VARCHAR},
-    #{startedAt,jdbcType=BIGINT},
-    #{createdAt,jdbcType=BIGINT},
-    #{updatedAt,jdbcType=BIGINT}
+      #{uuid,jdbcType=VARCHAR},
+      #{taskType,jdbcType=VARCHAR},
+      #{componentUuid,jdbcType=VARCHAR},
+      #{status,jdbcType=VARCHAR},
+      #{submitterLogin,jdbcType=VARCHAR},
+      #{startedAt,jdbcType=BIGINT},
+      #{createdAt,jdbcType=BIGINT},
+      #{updatedAt,jdbcType=BIGINT}
     )
   </insert>
 
   <update id="resetAllToPendingStatus" parameterType="map">
-    update ce_queue
-    set status='PENDING', started_at=NULL, updated_at=#{updatedAt,jdbcType=BIGINT}
-    where status &lt;&gt; 'PENDING'
+    update ce_queue set
+      status='PENDING',
+      started_at=NULL,
+      updated_at=#{updatedAt,jdbcType=BIGINT}
+    where
+      status &lt;&gt; 'PENDING'
   </update>
 
   <update id="updateIfStatus" parameterType="map">
-    update ce_queue
-    set status=#{newStatus,jdbcType=VARCHAR},
-    started_at=#{startedAt,jdbcType=BIGINT},
-    updated_at=#{updatedAt,jdbcType=BIGINT}
-    where uuid=#{uuid,jdbcType=VARCHAR} and status=#{oldStatus,jdbcType=VARCHAR}
+    update ce_queue set
+      status=#{newStatus,jdbcType=VARCHAR},
+      started_at=#{startedAt,jdbcType=BIGINT},
+      updated_at=#{updatedAt,jdbcType=BIGINT}
+    where
+      uuid=#{uuid,jdbcType=VARCHAR}
+      and status=#{oldStatus,jdbcType=VARCHAR}
   </update>
 
   <delete id="deleteByUuid">
-    delete from ce_queue where uuid=#{uuid,jdbcType=VARCHAR}
+    delete from
+      ce_queue
+    where
+      uuid=#{uuid,jdbcType=VARCHAR}
   </delete>
 
 </mapper>