<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.qianwen.smartman.modules.dnc.mapper.TransferDirectoryFileMapper">
|
|
<select id="getFilePages"
|
resultType="com.qianwen.smartman.modules.dnc.vo.TransferDirectoryFilePageVO">
|
select id,
|
transfer_directory_id as transferDirectoryId,
|
file_type as fileType,
|
filename as filename,
|
original_filename as originalFilename,
|
content_md5 as contentMd5,
|
content_length as contentLength,
|
content_type as contentType,
|
object_key as objectKey,
|
suffix as suffix,
|
workstation_id as workstationId,
|
link,
|
update_user as updateUser,
|
storage_space as storageSpace,
|
1 as documentOwnership,
|
'工位' as documentOwnershipDesc,
|
version
|
from
|
dnc_transfer_dir_file
|
where is_deleted = 0 and is_current = 1
|
and workstation_id =#{workstationId}
|
<if test="fileType != null">
|
and file_type = #{fileType}
|
</if>
|
<if test="fileType != null and fileType == 1">
|
<if test="suffixs != null and suffixs.size > 0">
|
and (suffix in
|
<foreach item="item" index="index" collection="suffixs" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
<if test="notSuffix != null and notSuffix !=''">
|
or suffix = ''
|
</if>)
|
</if>
|
</if>
|
<if test="keywords != null and keywords !=''">
|
AND (filename like concat(#{keywords},'%')
|
OR suffix like concat(#{keywords},'%'))
|
</if>
|
UNION all
|
select id,
|
'' as transferDirectoryId,
|
'' as fileType,
|
filename as filename,
|
original_filename as originalFilename,
|
content_md5 as contentMd5,
|
content_length as contentLength,
|
content_type as contentType,
|
object_key as objectKey,
|
suffix as suffix,
|
'' as workstationId,
|
link,
|
update_user as updateUser,
|
1 as storageSpace,
|
2 as documentOwnership,
|
'工厂' as documentOwnershipDesc,
|
version
|
from
|
blade_dnc_factory_file
|
where is_deleted = 0 and is_current = 1
|
<if test="keywords != null and keywords !=''">
|
AND (filename like concat(#{keywords},'%')
|
OR suffix like concat(#{keywords},'%'))
|
</if>
|
<if test="fileType != null and fileType == 1">
|
<if test="suffixs != null and suffixs.size > 0">
|
and (suffix in
|
<foreach item="item" index="index" collection="suffixs" open="(" separator="," close=")">
|
#{item}
|
</foreach>
|
<if test="notSuffix != null and notSuffix !=''">
|
or suffix = ''
|
</if>)
|
</if>
|
</if>
|
</select>
|
</mapper>
|