|
|
|
@ -19,8 +19,16 @@
|
|
|
|
|
<result property="useYN" column="USE_YN"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="fileDirs">SELECT INF_TYPE
|
|
|
|
|
, CONCAT(#{addsFileRootPath}, DIR, DATE_FORMAT(CURRENT_DATE, '/%Y/%m/%d/')) DIR
|
|
|
|
|
<sql id="fileDir">CONCAT(#{addsFileRootPath}, DIR, DATE_FORMAT(CURRENT_DATE, '%Y/%m/%d/'))</sql>
|
|
|
|
|
<sql id="fileUrl">(CASE
|
|
|
|
|
WHEN REPLACE(FILE_PATH,#{type},'/files/') LIKE '_:%'
|
|
|
|
|
THEN SUBSTR(REPLACE(FILE_PATH,#{type},'/files/'),3)
|
|
|
|
|
ELSE REPLACE(FILE_PATH,#{type},'/files/')
|
|
|
|
|
END)</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="fileDirs">
|
|
|
|
|
SELECT INF_TYPE
|
|
|
|
|
,<include refid="cokr.xit.base.file.dao.FileMapper.fileDir" /> DIR
|
|
|
|
|
FROM (
|
|
|
|
|
SELECT '00' INF_TYPE, 'attachment' DIR FROM DUAL UNION
|
|
|
|
|
SELECT '01' INF_TYPE, 'document' DIR FROM DUAL UNION
|
|
|
|
@ -34,7 +42,7 @@
|
|
|
|
|
<sql id="selectFiles">
|
|
|
|
|
<if test="fileIDs != null">
|
|
|
|
|
SELECT A.*
|
|
|
|
|
, REPLACE(FILE_PATH,#{type},'/files/') AS URL
|
|
|
|
|
,<include refid="cokr.xit.base.file.dao.FileMapper.fileUrl" /> AS URL
|
|
|
|
|
FROM TB_FILE A
|
|
|
|
|
WHERE FILE_ID IN (<foreach collection="fileIDs" item="fileID" separator=",">#{fileID}</foreach>)
|
|
|
|
|
ORDER BY FILE_ID
|
|
|
|
@ -43,7 +51,7 @@ SELECT A.*
|
|
|
|
|
<if test="fileIDs == null">
|
|
|
|
|
<include refid="utility.paging-prefix" />
|
|
|
|
|
SELECT A.*
|
|
|
|
|
, REPLACE(FILE_PATH,#{type},'/files/') AS URL
|
|
|
|
|
,<include refid="cokr.xit.base.file.dao.FileMapper.fileUrl" /> AS URL
|
|
|
|
|
FROM TB_FILE A
|
|
|
|
|
<where>
|
|
|
|
|
<if test="infoType != null"> AND A.INF_TYPE = #{infoType}</if>
|
|
|
|
|