Skip to content

Commit

Permalink
feat:希望支持分支进行上架测试 #4780
Browse files Browse the repository at this point in the history
  • Loading branch information
yjieliang committed Oct 19, 2023
1 parent 634862c commit fa18de8
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import com.tencent.devops.common.api.constant.KEY_SUMMARY
import com.tencent.devops.common.api.constant.KEY_VERSION
import com.tencent.devops.common.api.constant.KEY_WEIGHT
import com.tencent.devops.common.api.constant.NAME
import com.tencent.devops.common.api.constant.TEST
import com.tencent.devops.common.api.constant.VERSION
import com.tencent.devops.common.api.util.JsonUtil
import com.tencent.devops.common.db.utils.JooqUtils
Expand Down Expand Up @@ -99,6 +100,7 @@ import org.jooq.SelectOnConditionStep
import org.jooq.impl.DSL
import org.springframework.stereotype.Repository


@Suppress("ALL")
@Repository
class AtomDao : AtomBaseDao() {
Expand Down Expand Up @@ -523,14 +525,22 @@ class AtomDao : AtomBaseDao() {
delim = ".",
count = -1
)
val field = DSL.`when`((t.field(KEY_VERSION) as Field<String>).startsWith(TEST), 1)
.otherwise(0) as Field<Int>
val queryStep = dslContext.select(
t.field(KEY_VERSION),
t.field(KEY_ATOM_STATUS),
firstVersion,
secondVersion,
thirdVersion
thirdVersion,
field
).from(t)
.orderBy(firstVersion.plus(0).desc(), secondVersion.plus(0).desc(), thirdVersion.plus(0).desc())
.orderBy(
field,
firstVersion.plus(0).desc(),
secondVersion.plus(0).desc(),
thirdVersion.plus(0).desc()
)
limitNum?.let { queryStep.limit(it) }
return queryStep.skipCheck().fetch()
}
Expand Down

0 comments on commit fa18de8

Please sign in to comment.