Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
8
8timerapiv200
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
8timerv2
8timerapiv200
Commits
8763003d
Commit
8763003d
authored
Jan 13, 2022
by
龙于生
Committed by
284718418@qq.com
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
云盘 查看文件新增记录接口
parent
f8dcfb09
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
205 additions
and
139 deletions
+205
-139
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
+18
-0
src/main/java/cn/timer/api/controller/disk/DiskFilesLogController.java
+3
-2
src/main/java/cn/timer/api/controller/disk/DiskReceivedController.java
+3
-2
src/main/java/cn/timer/api/controller/disk/DiskShareController.java
+3
-2
src/main/java/cn/timer/api/dao/disk/DiskFilesLogMapper.java
+8
-2
src/main/java/cn/timer/api/dao/disk/DiskReceivedMapper.java
+9
-1
src/main/java/cn/timer/api/dao/disk/DiskShareMapper.java
+10
-4
src/main/java/cn/timer/api/dto/disk/DiskFilesDto.java
+89
-8
src/main/resources/mapping/disk/DiskFilesLogMapper.xml
+32
-48
src/main/resources/mapping/disk/DiskReceivedMapper.xml
+11
-31
src/main/resources/mapping/disk/DiskShareMapper.xml
+19
-39
No files found.
src/main/java/cn/timer/api/controller/disk/DiskFilesController.java
View file @
8763003d
...
...
@@ -283,4 +283,22 @@ public class DiskFilesController {
}
}
@ApiOperation
(
value
=
"新增文件查看记录"
,
httpMethod
=
"GET"
,
notes
=
"新增文件查看记录"
)
@GetMapping
(
value
=
"/look_log/{fileId}"
)
public
Result
<
Object
>
lookLog
(
@CurrentUser
UserBean
userBean
,
@ApiParam
(
"文件ID"
)
@PathVariable
Integer
fileId
){
DiskFiles
diskFiles
=
DiskFiles
.
builder
().
id
(
fileId
).
build
().
selectById
();
DiskFilesLog
diskFilesLog
=
DiskFilesLog
.
builder
().
build
();
//新增 文件浏览记录
diskFilesLog
.
setFilePath
(
diskFiles
.
getUrlPath
());
diskFilesLog
.
setFilesId
(
diskFiles
.
getId
());
diskFilesLog
.
setFileSize
(
diskFiles
.
getFileSize
()
+
"B"
);
diskFilesLog
.
setTitle
(
diskFiles
.
getTitle
());
diskFilesLog
.
setType
(
JxglEnumInterface
.
DiskFilesLogType
.
LOOK_LOG
.
getType
());
diskFilesLog
.
setUserId
(
userBean
.
getEmpNum
());
diskFilesLog
.
setUserName
(
userBean
.
getQyzxEmpLogin
().
getUsername
());
diskFilesLog
.
insert
();
return
ResultUtil
.
success
();
}
}
src/main/java/cn/timer/api/controller/disk/DiskFilesLogController.java
View file @
8763003d
...
...
@@ -6,6 +6,7 @@ import cn.timer.api.bean.disk.DiskFilesLog;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dao.disk.DiskFilesLogMapper
;
import
cn.timer.api.dto.disk.DiskFilesDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -49,7 +50,7 @@ public class DiskFilesLogController{
@GetMapping
(
value
=
"/recent_file_list"
)
@ApiOperation
(
value
=
"11.最近查看"
,
httpMethod
=
"GET"
,
notes
=
"云盘-最近查看列表"
)
@ApiOperationSupport
(
order
=
11
)
public
Result
<
List
<
DiskFiles
Log
>>
recentFileList
(
@CurrentUser
UserBean
userBean
,
public
Result
<
List
<
DiskFiles
Dto
>>
recentFileList
(
@CurrentUser
UserBean
userBean
,
@ApiParam
(
"当前页"
)
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Integer
pageNum
,
@ApiParam
(
"每页条数"
)
@RequestParam
(
required
=
false
,
defaultValue
=
"10"
)
Integer
pageSize
,
@ApiParam
(
"搜索关键字"
)
@RequestParam
(
required
=
false
)
String
query
,
...
...
@@ -64,7 +65,7 @@ public class DiskFilesLogController{
diskFilesLog
.
setType
(
Integer
.
valueOf
(
type
));
}
catch
(
Exception
e
){}
List
<
DiskFiles
Log
>
diskFilesLogs
=
diskFilesLogMapper
.
queryDiskFilesLog
(
diskFilesLog
,
orgCode
,
pageNum
,
pageSize
);
List
<
DiskFiles
Dto
>
diskFilesLogs
=
diskFilesLogMapper
.
queryDiskFilesLog
(
diskFilesLog
,
orgCode
,
pageNum
,
pageSize
);
long
total
=
PageHelper
.
count
(
new
ISelect
()
{
@Override
...
...
src/main/java/cn/timer/api/controller/disk/DiskReceivedController.java
View file @
8763003d
...
...
@@ -6,6 +6,7 @@ import cn.timer.api.bean.disk.DiskShare;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dao.disk.DiskReceivedMapper
;
import
cn.timer.api.dto.disk.DiskFilesDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
com.github.pagehelper.ISelect
;
...
...
@@ -46,7 +47,7 @@ public class DiskReceivedController{
@GetMapping
(
value
=
"/received_file_list"
)
@ApiOperation
(
value
=
"13.我收到的"
,
httpMethod
=
"GET"
,
notes
=
"云盘-我收到的"
)
@ApiOperationSupport
(
order
=
13
)
public
Result
<
List
<
Disk
Received
>>
receivedFileList
(
@CurrentUser
UserBean
userBean
,
public
Result
<
List
<
Disk
FilesDto
>>
receivedFileList
(
@CurrentUser
UserBean
userBean
,
@ApiParam
(
"当前页"
)
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Integer
pageNum
,
@ApiParam
(
"每页条数"
)
@RequestParam
(
required
=
false
,
defaultValue
=
"10"
)
Integer
pageSize
,
@ApiParam
(
"搜索关键字"
)
@RequestParam
(
required
=
false
)
String
query
)
{
...
...
@@ -57,7 +58,7 @@ public class DiskReceivedController{
diskReceived
.
setTitle
(
query
);
diskReceived
.
setUserId
(
empNum
);
List
<
Disk
Received
>
diskReceiveds
=
diskReceivedMapper
.
queryDiskReceived
(
diskReceived
,
orgCode
,
pageNum
,
pageSize
);
List
<
Disk
FilesDto
>
diskReceiveds
=
diskReceivedMapper
.
queryDiskReceived
(
diskReceived
,
orgCode
,
pageNum
,
pageSize
);
long
total
=
PageHelper
.
count
(
new
ISelect
()
{
@Override
...
...
src/main/java/cn/timer/api/controller/disk/DiskShareController.java
View file @
8763003d
...
...
@@ -6,6 +6,7 @@ import cn.timer.api.bean.disk.DiskShare;
import
cn.timer.api.config.annotation.CurrentUser
;
import
cn.timer.api.config.annotation.UserBean
;
import
cn.timer.api.dao.disk.DiskShareMapper
;
import
cn.timer.api.dto.disk.DiskFilesDto
;
import
cn.timer.api.utils.Result
;
import
cn.timer.api.utils.ResultUtil
;
import
com.github.pagehelper.ISelect
;
...
...
@@ -46,7 +47,7 @@ public class DiskShareController{
@GetMapping
(
value
=
"/forwarded_file_list"
)
@ApiOperation
(
value
=
"12.我转发的"
,
httpMethod
=
"GET"
,
notes
=
"云盘-我转发的"
)
@ApiOperationSupport
(
order
=
12
)
public
Result
<
List
<
Disk
Share
>>
forwardedFileList
(
@CurrentUser
UserBean
userBean
,
public
Result
<
List
<
Disk
FilesDto
>>
forwardedFileList
(
@CurrentUser
UserBean
userBean
,
@ApiParam
(
"当前页"
)
@RequestParam
(
required
=
false
,
defaultValue
=
"1"
)
Integer
pageNum
,
@ApiParam
(
"每页条数"
)
@RequestParam
(
required
=
false
,
defaultValue
=
"10"
)
Integer
pageSize
,
@ApiParam
(
"搜索关键字"
)
@RequestParam
(
required
=
false
)
String
query
)
{
...
...
@@ -57,7 +58,7 @@ public class DiskShareController{
diskShare
.
setTitle
(
query
);
diskShare
.
setUserId
(
empNum
);
List
<
Disk
Share
>
diskShares
=
diskShareMapper
.
queryDiskShare
(
diskShare
,
orgCode
,
pageNum
,
pageSize
);
List
<
Disk
FilesDto
>
diskShares
=
diskShareMapper
.
queryDiskShare
(
diskShare
,
orgCode
,
pageNum
,
pageSize
);
long
total
=
PageHelper
.
count
(
new
ISelect
()
{
@Override
...
...
src/main/java/cn/timer/api/dao/disk/DiskFilesLogMapper.java
View file @
8763003d
...
...
@@ -2,6 +2,7 @@ package cn.timer.api.dao.disk;
import
cn.timer.api.bean.disk.DiskFilesLog
;
import
cn.timer.api.dto.disk.DiskFilesDto
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -18,10 +19,15 @@ import java.util.List;
@Repository
public
interface
DiskFilesLogMapper
extends
BaseMapper
<
DiskFilesLog
>
{
List
<
DiskFilesLog
>
queryDiskFilesLog
(
@Param
(
"diskFilesLog"
)
DiskFilesLog
diskFilesLog
,
// List<DiskFilesLog> queryDiskFilesLog(@Param("diskFilesLog") DiskFilesLog diskFilesLog,
// @Param("orgId") Integer orgId,
// @Param(value = "pageNum") Integer pageNum,
// @Param(value = "pageSize") Integer pageSize);
List
<
DiskFilesDto
>
queryDiskFilesLog
(
@Param
(
"diskFilesLog"
)
DiskFilesLog
diskFilesLog
,
@Param
(
"orgId"
)
Integer
orgId
,
@Param
(
value
=
"pageNum"
)
Integer
pageNum
,
@Param
(
value
=
"pageSize"
)
Integer
pageSize
);
}
src/main/java/cn/timer/api/dao/disk/DiskReceivedMapper.java
View file @
8763003d
...
...
@@ -2,6 +2,7 @@ package cn.timer.api.dao.disk;
import
cn.timer.api.bean.disk.DiskReceived
;
import
cn.timer.api.dto.disk.DiskFilesDto
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -18,9 +19,16 @@ import java.util.List;
@Repository
public
interface
DiskReceivedMapper
extends
BaseMapper
<
DiskReceived
>
{
List
<
DiskReceived
>
queryDiskReceived
(
@Param
(
"diskReceived"
)
DiskReceived
diskReceived
,
// List<DiskReceived> queryDiskReceived(@Param("diskReceived") DiskReceived diskReceived,
// @Param("orgId") Integer orgId,
// @Param(value = "pageNum") Integer pageNum,
// @Param(value = "pageSize") Integer pageSize);
List
<
DiskFilesDto
>
queryDiskReceived
(
@Param
(
"diskReceived"
)
DiskReceived
diskReceived
,
@Param
(
"orgId"
)
Integer
orgId
,
@Param
(
value
=
"pageNum"
)
Integer
pageNum
,
@Param
(
value
=
"pageSize"
)
Integer
pageSize
);
}
src/main/java/cn/timer/api/dao/disk/DiskShareMapper.java
View file @
8763003d
...
...
@@ -2,6 +2,7 @@ package cn.timer.api.dao.disk;
import
cn.timer.api.bean.disk.DiskShare
;
import
cn.timer.api.dto.disk.DiskFilesDto
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -18,8 +19,13 @@ import java.util.List;
@Repository
public
interface
DiskShareMapper
extends
BaseMapper
<
DiskShare
>
{
List
<
DiskShare
>
queryDiskShare
(
@Param
(
"diskShare"
)
DiskShare
diskShare
,
@Param
(
"orgId"
)
Integer
orgId
,
@Param
(
value
=
"pageNum"
)
Integer
pageNum
,
@Param
(
value
=
"pageSize"
)
Integer
pageSize
);
// List<DiskShare> queryDiskShare(@Param("diskShare") DiskShare diskShare,
// @Param("orgId") Integer orgId,
// @Param(value = "pageNum") Integer pageNum,
// @Param(value = "pageSize") Integer pageSize);
List
<
DiskFilesDto
>
queryDiskShare
(
@Param
(
"diskShare"
)
DiskShare
diskShare
,
@Param
(
"orgId"
)
Integer
orgId
,
@Param
(
value
=
"pageNum"
)
Integer
pageNum
,
@Param
(
value
=
"pageSize"
)
Integer
pageSize
);
}
src/main/java/cn/timer/api/dto/disk/DiskFilesDto.java
View file @
8763003d
package
cn
.
timer
.
api
.
dto
.
disk
;
import
cn.timer.api.config.exception.ValidationMsg
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Transient
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author wuqingjun
...
...
@@ -24,17 +31,91 @@ public class DiskFilesDto implements Serializable{
private
static
final
long
serialVersionUID
=
-
1230023773946170921L
;
/**
*
资源目录
ID
*
主键
ID
*/
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"资源目录ID"
)
private
Integer
catalogueId
;
@Id
@GeneratedValue
@TableId
(
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"编号"
)
private
Integer
id
;
/**
* 文件标题
*/
@ApiModelProperty
(
value
=
"文件标题"
)
private
String
title
;
/**
* 文件路径
*/
@ApiModelProperty
(
value
=
"文件路径"
)
private
String
urlPath
;
/**
* 文件物理路径
*/
@ApiModelProperty
(
value
=
"文件物理路径"
)
private
String
diskPath
;
/**
* 文件大小,单位kb
*/
@ApiModelProperty
(
value
=
"文件大小,单位kb"
)
private
Long
fileSize
;
/**
* 显示大小
*/
@ApiModelProperty
(
value
=
"显示大小:10KB,5M,2G"
)
private
String
showSize
;
/**
* 文件格式类型
*/
@ApiModelProperty
(
value
=
"文件格式类型"
)
private
String
fileType
;
/**
* 上传文件时的IP
*/
@ApiModelProperty
(
value
=
"上传文件时的IP"
)
private
String
uploadIp
;
/**
* 逻辑删除标记0.未删除 1.删除
*/
@ApiModelProperty
(
value
=
""
)
private
Integer
deleteFlag
;
/**
* 创建者
*/
@ApiModelProperty
(
value
=
""
)
private
Integer
createUserId
;
/**
* 用户姓名
*/
@ApiModelProperty
(
value
=
"用户姓名"
)
private
String
userName
;
/**
* 更新者
*/
@ApiModelProperty
(
value
=
""
)
private
Integer
updateUserId
;
/**
* 创建时间
*/
@ApiModelProperty
(
value
=
""
)
private
Date
createTime
;
/**
* 更新时间
*/
@ApiModelProperty
(
value
=
""
)
private
Date
updateTime
;
/**
* 文件图标
*/
@Transient
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"文件图标"
)
private
String
url
;
/**
*
0云盘,1文件夹
*
对象id
*/
@NotNull
(
message
=
ValidationMsg
.
NOTNULL
)
@ApiModelProperty
(
value
=
"0云盘,1文件夹"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"对象id"
)
private
Integer
objId
;
}
src/main/resources/mapping/disk/DiskFilesLogMapper.xml
View file @
8763003d
...
...
@@ -17,62 +17,46 @@
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<association
property=
"diskFiles"
javaType=
"diskFiles"
>
<id
property=
"id"
column=
"diskFiles_id"
/>
<result
property=
"title"
column=
"diskFiles_title"
/>
<result
property=
"urlPath"
column=
"diskFiles_url_path"
/>
<result
property=
"diskPath"
column=
"diskFiles_disk_path"
/>
<result
property=
"fileSize"
column=
"diskFiles_file_size"
/>
<result
property=
"showSize"
column=
"diskFiles_show_size"
/>
<result
property=
"fileType"
column=
"diskFiles_file_type"
/>
<result
property=
"uploadIp"
column=
"diskFiles_upload_ip"
/>
<result
property=
"deleteFlag"
column=
"diskFiles_delete_flag"
/>
<result
property=
"createUserId"
column=
"diskFiles_create_user_id"
/>
<result
property=
"updateUserId"
column=
"diskFiles_update_user_id"
/>
<result
property=
"createTime"
column=
"diskFiles_create_time"
/>
<result
property=
"updateTime"
column=
"diskFiles_update_time"
/>
</association>
<association
property=
"diskFileImage"
javaType=
"diskFileImage"
>
<id
property=
"id"
column=
"diskFileImage_id"
/>
<result
property=
"type"
column=
"diskFileImage_type"
/>
<result
property=
"title"
column=
"diskFileImage_title"
/>
<result
property=
"url"
column=
"diskFileImage_url"
/>
<result
property=
"deleteFlag"
column=
"diskFileImage_delete_flag"
/>
<result
property=
"createUserId"
column=
"diskFileImage_create_user_id"
/>
<result
property=
"createTime"
column=
"diskFileImage_create_time"
/>
</association>
</resultMap>
<select
id=
"queryDiskFilesLog"
resultMap=
"BaseResultMap"
>
<select
id=
"queryDiskFilesLog"
resultType=
"cn.timer.api.dto.disk.DiskFilesDto"
>
SELECT
log.*,
df.id diskFiles_id,
df.show_size diskFiles_show_size,
df.file_type diskFiles_file_type,
dfi.url diskFileImage_url
df.id,
df.show_size,
df.file_type,
df.url_path,
dfi.url,
log.id obj_id,
log.title,
log.update_time,
log.user_name
FROM
(SELECT * FROM disk_files_log WHERE id IN (SELECT MAX(id) FROM disk_files_log
WHERE
user_id = #{diskFilesLog.userId}
and `type` != 5
<if
test=
"diskFilesLog.title != null and diskFilesLog.title != '' and diskFilesLog.title != 'null'"
>
and title like CONCAT('%',#{diskFilesLog.title},'%')
</if>
<if
test=
"diskFilesLog.type != null"
>
(SELECT * FROM disk_files_log WHERE id IN (SELECT MAX(id) FROM disk_files_log
WHERE
user_id = #{diskFilesLog.userId}
and `delete_flag` = 0
<if
test=
"diskFilesLog.title != null and diskFilesLog.title != '' and diskFilesLog.title != 'null'"
>
and title like CONCAT('%',#{diskFilesLog.title},'%')
</if>
<choose>
<when
test=
"diskFilesLog.type != null"
>
and `type` = #{diskFilesLog.type}
</if>
GROUP BY files_id )) AS log
LEFT JOIN disk_files df ON log.files_id = df.id
LEFT JOIN disk_file_image dfi ON df.file_type = dfi.type
LEFT JOIN disk_catalogue_files dcf ON df.id = dcf.files_id
LEFT JOIN disk_catalogue dc ON dc.id = dcf.catalogue_id
WHERE dc.org_id=#{orgId}
</when>
<otherwise>
and `type`
<![CDATA[ <= ]]>
1
</otherwise>
</choose>
GROUP BY files_id )) AS log
LEFT JOIN disk_files df ON log.files_id = df.id
LEFT JOIN disk_file_image dfi ON df.file_type = dfi.type
LEFT JOIN disk_catalogue_files dcf ON df.id = dcf.files_id
LEFT JOIN disk_catalogue dc ON dc.id = dcf.catalogue_id
WHERE dc.org_id=#{orgId}
GROUP BY
log.files_id
log.files_id
ORDER BY
log.id DESC
log.id DESC
</select>
...
...
src/main/resources/mapping/disk/DiskReceivedMapper.xml
View file @
8763003d
...
...
@@ -17,40 +17,20 @@
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<association
property=
"diskFiles"
javaType=
"diskFiles"
>
<id
property=
"id"
column=
"diskFiles_id"
/>
<result
property=
"title"
column=
"diskFiles_title"
/>
<result
property=
"urlPath"
column=
"diskFiles_url_path"
/>
<result
property=
"diskPath"
column=
"diskFiles_disk_path"
/>
<result
property=
"fileSize"
column=
"diskFiles_file_size"
/>
<result
property=
"showSize"
column=
"diskFiles_show_size"
/>
<result
property=
"fileType"
column=
"diskFiles_file_type"
/>
<result
property=
"uploadIp"
column=
"diskFiles_upload_ip"
/>
<result
property=
"deleteFlag"
column=
"diskFiles_delete_flag"
/>
<result
property=
"createUserId"
column=
"diskFiles_create_user_id"
/>
<result
property=
"updateUserId"
column=
"diskFiles_update_user_id"
/>
<result
property=
"createTime"
column=
"diskFiles_create_time"
/>
<result
property=
"updateTime"
column=
"diskFiles_update_time"
/>
</association>
<association
property=
"diskFileImage"
javaType=
"diskFileImage"
>
<id
property=
"id"
column=
"diskFileImage_id"
/>
<result
property=
"type"
column=
"diskFileImage_type"
/>
<result
property=
"title"
column=
"diskFileImage_title"
/>
<result
property=
"url"
column=
"diskFileImage_url"
/>
<result
property=
"deleteFlag"
column=
"diskFileImage_delete_flag"
/>
<result
property=
"createUserId"
column=
"diskFileImage_create_user_id"
/>
<result
property=
"createTime"
column=
"diskFileImage_create_time"
/>
</association>
</resultMap>
<select
id=
"queryDiskReceived"
resultMap=
"BaseResultMap"
>
<select
id=
"queryDiskReceived"
resultType=
"cn.timer.api.dto.disk.DiskFilesDto"
>
SELECT
dr.*,
df.id diskFiles_id,
df.show_size diskFiles_show_size,
df.file_type diskFiles_file_type,
dfi.url diskFileImage_url
df.id,
df.show_size,
df.file_type,
df.url_path,
dfi.url,
dr.id obj_id,
dr.title,
dr.update_time,
dr.user_name
FROM
`disk_received` dr
LEFT JOIN `disk_files` df ON dr.`files_id` = df.`id`
...
...
src/main/resources/mapping/disk/DiskShareMapper.xml
View file @
8763003d
...
...
@@ -18,50 +18,30 @@
<result
property=
"expireTime"
column=
"expire_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<association
property=
"diskFiles"
javaType=
"diskFiles"
>
<id
property=
"id"
column=
"diskFiles_id"
/>
<result
property=
"title"
column=
"diskFiles_title"
/>
<result
property=
"urlPath"
column=
"diskFiles_url_path"
/>
<result
property=
"diskPath"
column=
"diskFiles_disk_path"
/>
<result
property=
"fileSize"
column=
"diskFiles_file_size"
/>
<result
property=
"showSize"
column=
"diskFiles_show_size"
/>
<result
property=
"fileType"
column=
"diskFiles_file_type"
/>
<result
property=
"uploadIp"
column=
"diskFiles_upload_ip"
/>
<result
property=
"deleteFlag"
column=
"diskFiles_delete_flag"
/>
<result
property=
"createUserId"
column=
"diskFiles_create_user_id"
/>
<result
property=
"updateUserId"
column=
"diskFiles_update_user_id"
/>
<result
property=
"createTime"
column=
"diskFiles_create_time"
/>
<result
property=
"updateTime"
column=
"diskFiles_update_time"
/>
</association>
<association
property=
"diskFileImage"
javaType=
"diskFileImage"
>
<id
property=
"id"
column=
"diskFileImage_id"
/>
<result
property=
"type"
column=
"diskFileImage_type"
/>
<result
property=
"title"
column=
"diskFileImage_title"
/>
<result
property=
"url"
column=
"diskFileImage_url"
/>
<result
property=
"deleteFlag"
column=
"diskFileImage_delete_flag"
/>
<result
property=
"createUserId"
column=
"diskFileImage_create_user_id"
/>
<result
property=
"createTime"
column=
"diskFileImage_create_time"
/>
</association>
</resultMap>
<select
id=
"queryDiskShare"
resultMap=
"BaseResultMap"
>
<select
id=
"queryDiskShare"
resultType=
"cn.timer.api.dto.disk.DiskFilesDto"
>
SELECT
ds.*,
df.id diskFiles_id,
df.show_size diskFiles_show_size,
df.file_type diskFiles_file_type,
dfi.url diskFileImage_url
df.id,
df.show_size,
df.file_type,
df.url_path,
dfi.url,
ds.id obj_id,
ds.title,
ds.create_time update_time,
ds.user_name
FROM
`disk_share` ds
LEFT JOIN `disk_files` df ON ds.`files_id` = df.`id`
LEFT JOIN disk_file_image dfi ON df.file_type = dfi.type
LEFT JOIN disk_catalogue_files dcf ON df.id = dcf.files_id
LEFT JOIN disk_catalogue dc ON dc.id = dcf.catalogue_id
`disk_share` ds
LEFT JOIN `disk_files` df ON ds.`files_id` = df.`id`
LEFT JOIN disk_file_image dfi ON df.file_type = dfi.type
LEFT JOIN disk_catalogue_files dcf ON df.id = dcf.files_id
LEFT JOIN disk_catalogue dc ON dc.id = dcf.catalogue_id
WHERE dc.org_id=#{orgId} AND ds.user_id = #{diskShare.userId} and ds.delete_flag = 0
<if
test=
"diskShare.title != null and diskShare.title != '' and diskShare.title != 'null'"
>
and ds.title LIKE CONCAT('%',#{diskShare.title},'%')
</if>
<if
test=
"diskShare.title != null and diskShare.title != '' and diskShare.title != 'null'"
>
and ds.title LIKE CONCAT('%',#{diskShare.title},'%')
</if>
ORDER BY ds.`create_time` DESC
</select>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment