From 5004c22d184fed5a1ac6d853ab83120d0aaa5d8e Mon Sep 17 00:00:00 2001 From: leebj Date: Mon, 8 Jul 2024 17:01:22 +0900 Subject: [PATCH] =?UTF-8?q?fileDir,=20fileUrl=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/sql/mapper/base/file-mapper.xml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/resources/sql/mapper/base/file-mapper.xml b/src/main/resources/sql/mapper/base/file-mapper.xml index 5a26eb1..d7dd80f 100644 --- a/src/main/resources/sql/mapper/base/file-mapper.xml +++ b/src/main/resources/sql/mapper/base/file-mapper.xml @@ -19,8 +19,16 @@ -SELECT INF_TYPE - , CONCAT(#{addsFileRootPath}, DIR, DATE_FORMAT(CURRENT_DATE, '/%Y/%m/%d/')) DIR +CONCAT(#{addsFileRootPath}, DIR, DATE_FORMAT(CURRENT_DATE, '%Y/%m/%d/')) +(CASE + WHEN REPLACE(FILE_PATH,#{type},'/files/') LIKE '_:%' + THEN SUBSTR(REPLACE(FILE_PATH,#{type},'/files/'),3) + ELSE REPLACE(FILE_PATH,#{type},'/files/') + END) + + +SELECT INF_TYPE + , DIR FROM ( SELECT '00' INF_TYPE, 'attachment' DIR FROM DUAL UNION SELECT '01' INF_TYPE, 'document' DIR FROM DUAL UNION @@ -34,7 +42,7 @@ SELECT A.* - , REPLACE(FILE_PATH,#{type},'/files/') AS URL + , AS URL FROM TB_FILE A WHERE FILE_ID IN (#{fileID}) ORDER BY FILE_ID @@ -43,7 +51,7 @@ SELECT A.* SELECT A.* - , REPLACE(FILE_PATH,#{type},'/files/') AS URL + , AS URL FROM TB_FILE A AND A.INF_TYPE = #{infoType}