파일 ID 추출 수정

main
이범준 5 months ago
parent bed6e0c43e
commit 2f88d4547e

@ -57,17 +57,19 @@ SELECT A.*, FILE_PATH URL
<select id="getFiles" parameterType="map" resultMap="fileRow">/* 파일 가져오기(fileMapper.getFiles) */ <select id="getFiles" parameterType="map" resultMap="fileRow">/* 파일 가져오기(fileMapper.getFiles) */
<include refid="selectFiles" /></select> <include refid="selectFiles" /></select>
<insert id="insertFile" parameterType="map">/* 파일 등록(fileMapper.insertFile) */ <insert id="insertFile" parameterType="map">
/* 파일 등록(fileMapper.insertFile) */
<selectKey keyProperty="file.id,file.path" keyColumn="NEW_ID,PATH" resultType="map" order="BEFORE"> <selectKey keyProperty="file.id,file.path" keyColumn="NEW_ID,PATH" resultType="map" order="BEFORE">
SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH SELECT NEW_ID, CONCAT(DIR, NEW_ID, '.', #{file.extension}) PATH
FROM ( FROM (
SELECT NVL(MAX(FILE_ID) + 1, CONCAT(THIS_DAY, '00001')) NEW_ID SELECT NVL(MAX(FILE_ID) + 1, CONCAT(THIS_DAY, '00001')) NEW_ID
FROM TB_FILE A, (<include refid="utility.selectThisDay" />) B FROM (<include refid="utility.selectThisDay" />) B
WHERE FILE_ID LIKE CONCAT(THIS_DAY, '%') LEFT OUTER JOIN TB_FILE A ON FILE_ID LIKE CONCAT(THIS_DAY, '%')
) T1, ( ) T1, (
<include refid="fileDirs" /> <include refid="fileDirs" />
WHERE INF_TYPE = #{file.infoType} WHERE INF_TYPE = #{file.infoType}
) T2</selectKey> ) T2
</selectKey>
INSERT INTO TB_FILE ( INSERT INTO TB_FILE (
FILE_ID FILE_ID
, INF_TYPE , INF_TYPE

Loading…
Cancel
Save