文件查询开启缓存
This commit is contained in:
parent
4e91931b9e
commit
6208ce0b43
@ -2,6 +2,8 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.cm.common.plugin.dao.file.IFileDao">
|
||||
|
||||
<cache/>
|
||||
|
||||
<resultMap id="filePO" type="com.cm.common.pojo.pos.FilePO">
|
||||
<id property="fileId" column="file_id"/>
|
||||
<result property="fileName" column="file_name"/>
|
||||
@ -50,7 +52,7 @@
|
||||
</resultMap>
|
||||
|
||||
<!-- 保存文件 -->
|
||||
<insert id="saveFile" parameterType="map">
|
||||
<insert id="saveFile" parameterType="map" flushCache="true">
|
||||
INSERT INTO sys_file(
|
||||
file_id,
|
||||
file_name,
|
||||
@ -83,7 +85,7 @@
|
||||
</insert>
|
||||
|
||||
<!-- 删除文件 -->
|
||||
<update id="removeFile" parameterType="map">
|
||||
<update id="removeFile" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
sys_file
|
||||
SET
|
||||
@ -98,7 +100,7 @@
|
||||
</update>
|
||||
|
||||
<!-- 删除文件(物理删除) -->
|
||||
<delete id="deleteFile" parameterType="map">
|
||||
<delete id="deleteFile" parameterType="map" flushCache="true">
|
||||
DELETE FROM
|
||||
sys_file
|
||||
WHERE
|
||||
@ -109,7 +111,7 @@
|
||||
</delete>
|
||||
|
||||
<!-- 更新文件描述 -->
|
||||
<update id="updateFileSummary" parameterType="map">
|
||||
<update id="updateFileSummary" parameterType="map" flushCache="true">
|
||||
UPDATE
|
||||
sys_file
|
||||
SET
|
||||
@ -127,7 +129,7 @@
|
||||
</update>
|
||||
|
||||
<!-- 获取文件 -->
|
||||
<select id="getFile" parameterType="map" resultMap="filePO">
|
||||
<select id="getFile" parameterType="map" resultMap="filePO" useCache="true">
|
||||
SELECT
|
||||
file_id,
|
||||
file_name,
|
||||
@ -151,7 +153,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 文件列表 -->
|
||||
<select id="listFile" parameterType="map" resultMap="fileDTO">
|
||||
<select id="listFile" parameterType="map" resultMap="fileDTO" useCache="true">
|
||||
SELECT
|
||||
file_id,
|
||||
file_name,
|
||||
@ -200,7 +202,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 文件列表 -->
|
||||
<select id="listFileInfo" parameterType="map" resultMap="fileInfoDTO">
|
||||
<select id="listFileInfo" parameterType="map" resultMap="fileInfoDTO" useCache="false">
|
||||
SELECT
|
||||
file_id,
|
||||
file_name,
|
||||
@ -241,7 +243,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 获取文件列表(带路径) -->
|
||||
<select id="listFileInfoWithPath" parameterType="map" resultMap="fileInfoWithPathDTO">
|
||||
<select id="listFileInfoWithPath" parameterType="map" resultMap="fileInfoWithPathDTO" useCache="false">
|
||||
SELECT
|
||||
file_id,
|
||||
file_name,
|
||||
@ -270,7 +272,7 @@
|
||||
</select>
|
||||
|
||||
<!-- 文件列表 -->
|
||||
<select id="listFileByMd5" parameterType="java.lang.String" resultMap="fileInfoDTO">
|
||||
<select id="listFileByMd5" parameterType="java.lang.String" resultMap="fileInfoDTO" useCache="false">
|
||||
SELECT
|
||||
file_id,
|
||||
file_name,
|
||||
|
@ -3,6 +3,8 @@ package com.cm.common.pojo.dtos;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: FileDTO
|
||||
* @Description: 文件
|
||||
@ -11,8 +13,9 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
* @Version: 1.0
|
||||
**/
|
||||
@ApiModel
|
||||
public class FileDTO {
|
||||
public class FileDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3765953896919360869L;
|
||||
@ApiModelProperty(name = "fileId", value = "文件ID")
|
||||
private String fileId;
|
||||
@ApiModelProperty(name = "fileName", value = "文件名称")
|
||||
|
@ -1,5 +1,7 @@
|
||||
package com.cm.common.pojo.pos;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName: FilePO
|
||||
* @Description: 文件
|
||||
@ -7,8 +9,9 @@ package com.cm.common.pojo.pos;
|
||||
* @Date: 2019/1/4 11:57 AM
|
||||
* @Version: 1.0
|
||||
**/
|
||||
public class FilePO {
|
||||
public class FilePO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -118382389804178231L;
|
||||
private String fileId;
|
||||
private String fileName;
|
||||
private String filePath;
|
||||
|
Loading…
Reference in New Issue
Block a user