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 17, 2024
1 parent 0829096 commit da4e3e4
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class PipelineModelTaskDao {
return dslContext.select(DSL.countDistinct(PIPELINE_ID))
.from(this)
.join(tpi)
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID))
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID).and(PROJECT_ID.eq(tpi.PROJECT_ID)))
.where(condition)
.fetchOne(0, Int::class.java)!!
}
Expand All @@ -138,7 +138,7 @@ class PipelineModelTaskDao {
return dslContext.select(DSL.countDistinct(PIPELINE_ID), ATOM_CODE)
.from(this)
.join(tpi)
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID))
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID).and(PROJECT_ID.eq(tpi.PROJECT_ID)))
.where(condition)
.groupBy(ATOM_CODE)
.fetch()
Expand Down Expand Up @@ -240,8 +240,7 @@ class PipelineModelTaskDao {
)
.from(this)
.join(tpi)
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID))
.and(PROJECT_ID.eq(tpi.PROJECT_ID))
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID).and(PROJECT_ID.eq(tpi.PROJECT_ID)))
.where(condition)
.groupBy(PIPELINE_ID)
.orderBy(UPDATE_TIME.desc(), PIPELINE_ID.desc())
Expand Down Expand Up @@ -275,8 +274,7 @@ class PipelineModelTaskDao {
return dslContext.select(DSL.countDistinct(PIPELINE_ID))
.from(this)
.join(tpi)
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID))
.and(PROJECT_ID.eq(tpi.PROJECT_ID))
.on(PIPELINE_ID.eq(tpi.PIPELINE_ID).and(PROJECT_ID.eq(tpi.PROJECT_ID)))
.where(condition)
.fetchOne(0, Long::class.java)!!
}
Expand Down

0 comments on commit da4e3e4

Please sign in to comment.