Skip to content

Commit

Permalink
pref:优化流水线项目下已安装插件关联流水线数量统计 TencentBlueKing#11307
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Dec 12, 2024
1 parent cb5a1ee commit 4be744f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ package com.tencent.devops.process.engine.dao

import com.tencent.devops.common.api.constant.KEY_VERSION
import com.tencent.devops.common.api.util.JsonUtil
import com.tencent.devops.common.pipeline.enums.ChannelCode
import com.tencent.devops.common.security.util.BkCryptoUtil
import com.tencent.devops.model.process.Tables.T_PIPELINE_MODEL_TASK
import com.tencent.devops.model.process.tables.TPipelineInfo
Expand Down Expand Up @@ -108,6 +109,7 @@ class PipelineModelTaskDao {
if (projectCode != null) {
condition.add(tpi.PROJECT_ID.eq(projectCode))
}
condition.add(tpi.CHANNEL.notEqual(ChannelCode.AM.name))
return dslContext.select(DSL.countDistinct(PIPELINE_ID))
.from(this)
.join(tpi)
Expand All @@ -132,6 +134,7 @@ class PipelineModelTaskDao {
if (projectCode != null) {
condition.add(tpi.PROJECT_ID.eq(projectCode))
}
condition.add(tpi.CHANNEL.notEqual(ChannelCode.AM.name))
return dslContext.select(DSL.countDistinct(PIPELINE_ID), ATOM_CODE)
.from(this)
.join(tpi)
Expand Down Expand Up @@ -233,6 +236,7 @@ class PipelineModelTaskDao {
if (!projectId.isNullOrEmpty()) {
condition.add(tpi.PROJECT_ID.eq(projectId))
}
condition.add(tpi.CHANNEL.notEqual(ChannelCode.AM.name))
val baseStep = dslContext.select(
PIPELINE_ID.`as`(KEY_PIPELINE_ID),
PROJECT_ID.`as`(KEY_PROJECT_ID),
Expand Down

0 comments on commit 4be744f

Please sign in to comment.