From 54072412f3987252f6708ae9b121435c79bfc11b Mon Sep 17 00:00:00 2001 From: Klaus Date: Fri, 3 May 2024 01:06:57 +0900 Subject: [PATCH] =?UTF-8?q?=ED=83=90=EC=83=89=20-=20=EB=82=A8/=EC=97=AC=20?= =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4=ED=84=B0=20=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80=20-=20=EC=9D=B8?= =?UTF-8?q?=EA=B8=B0=ED=81=AC=EB=A6=AC,=20=EC=83=88=EB=A1=9C=EC=8B=9C?= =?UTF-8?q?=EC=9E=91=20=EC=99=B8=20=EB=82=98=EB=A8=B8=EC=A7=80=20=EC=84=B9?= =?UTF-8?q?=EC=85=98=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/explorer/ExplorerQueryRepository.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt index c68a0bf..339c3ec 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt @@ -185,12 +185,14 @@ class ExplorerQueryRepository( val rotatedChars = characters.drop(offset) + characters.take(offset) val caseBuilder = Expressions.stringTemplate( - "CASE {0}", - rotatedChars - .withIndex() - .joinToString(" ") { - "WHEN {0} THEN {1}".format(member.email.startsWith(it.value), it.index + 1) - } + "CASE", + rotatedChars.withIndex().joinToString(" ") { + "WHEN {0} LIKE {1} THEN {2}".format( + member.email, + "'" + it.value + "%'", + it.index + 1 + ) + } ) val randomExpression = Expressions.numberTemplate(Double::class.java, "function('rand')").asc()