diff --git a/src/main/resources/sql/mapper/base/file-mapper.xml b/src/main/resources/sql/mapper/base/file-mapper.xml index a6299a0..5a26eb1 100644 --- a/src/main/resources/sql/mapper/base/file-mapper.xml +++ b/src/main/resources/sql/mapper/base/file-mapper.xml @@ -72,9 +72,9 @@ AND ${by} = #{term} SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH FROM ( - SELECT NVL(MAX(FILE_ID) + 1, CONCAT(THIS_DAY, '00001')) NEW_ID - FROM TB_FILE A, () B - WHERE FILE_ID LIKE CONCAT(THIS_DAY, '%') + SELECT NVL(MAX(FILE_ID) + 1, CONCAT(NVL(THIS_DAY, DATE_FORMAT(CURRENT_DATE, '%Y%m%d')), '00001')) NEW_ID + FROM () B + LEFT OUTER JOIN TB_FILE A ON A.FILE_ID LIKE CONCAT(THIS_DAY, '%') ) T1, ( WHERE INF_TYPE = #{file.infoType}