🐛 fixed file
This commit is contained in:
parent
97d08c4c7e
commit
245b359481
@ -12,7 +12,7 @@ import java.util.Date;
|
||||
* @author caterpillar
|
||||
*/
|
||||
@Data
|
||||
@Table(name = "forest_File")
|
||||
@Table(name = "forest_file")
|
||||
public class ForestFile {
|
||||
|
||||
/**
|
||||
@ -26,14 +26,14 @@ public class ForestFile {
|
||||
/**
|
||||
* 访问路径
|
||||
*/
|
||||
@Column(name = "web_path")
|
||||
private String webPath;
|
||||
@Column(name = "file_url")
|
||||
private String fileUrl;
|
||||
|
||||
/**
|
||||
* 上传路径
|
||||
*/
|
||||
@Column(name = "upload_path")
|
||||
private String uploadPath;
|
||||
@Column(name = "file_path")
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* md5
|
||||
@ -44,14 +44,20 @@ public class ForestFile {
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(name = "create_time")
|
||||
private Date createTime;
|
||||
@Column(name = "created_time")
|
||||
private Date createdTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(name = "update_time")
|
||||
private Date updateTime;
|
||||
@Column(name = "updated_time")
|
||||
private Date updatedTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@Column(name = "created_by")
|
||||
private long createdBy;
|
||||
|
||||
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ public interface ForestFileMapper extends Mapper<ForestFile> {
|
||||
* @param md5Value md5值
|
||||
* @return
|
||||
*/
|
||||
ForestFile getByMd5(@Param("md5Value") String md5Value);
|
||||
ForestFile getForestFileByMd5(@Param("md5Value") String md5Value);
|
||||
|
||||
/**
|
||||
* 插入文件对象
|
||||
@ -24,7 +24,8 @@ public interface ForestFileMapper extends Mapper<ForestFile> {
|
||||
* @param webPath 访问路径
|
||||
* @param uploadPath 上传路径
|
||||
* @param md5Value md5值
|
||||
* @param createdBy 创建人
|
||||
* @return
|
||||
*/
|
||||
int insert(@Param("webPath") String webPath, @Param("uploadPath") String uploadPath, @Param("md5Value") String md5Value);
|
||||
int insert(@Param("webPath") String webPath, @Param("uploadPath") String uploadPath, @Param("md5Value") String md5Value, @Param("createdBy") long createdBy);
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package com.rymcu.forest.service;
|
||||
|
||||
import com.rymcu.forest.core.service.Service;
|
||||
import com.rymcu.forest.entity.ForestFile;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
/**
|
||||
@ -19,15 +18,16 @@ public interface ForestFileService extends Service<ForestFile> {
|
||||
* @param md5Value md5值
|
||||
* @return
|
||||
*/
|
||||
ForestFile getByMd5(@Param("md5Value") String md5Value);
|
||||
ForestFile getForestFileByMd5(String md5Value);
|
||||
|
||||
/**
|
||||
* 插入文件对象
|
||||
*
|
||||
* @param webPath 访问路径
|
||||
* @param uploadPath 上传路径
|
||||
* @param fileUrl 访问路径
|
||||
* @param filePath 上传路径
|
||||
* @param md5Value md5值
|
||||
* @param createdBy 创建人
|
||||
* @return
|
||||
*/
|
||||
int insert(@Param("webPath") String webPath, @Param("uploadPath") String uploadPath, @Param("md5Value") String md5Value);
|
||||
int insert(String fileUrl, String filePath, String md5Value, long createdBy);
|
||||
}
|
||||
|
@ -28,20 +28,21 @@ public class ForestFileServiceImpl extends AbstractService<ForestFile> implement
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ForestFile getByMd5(String md5Value) {
|
||||
return forestFileMapper.getByMd5(md5Value);
|
||||
public ForestFile getForestFileByMd5(String md5Value) {
|
||||
return forestFileMapper.getForestFileByMd5(md5Value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 插入文件对象
|
||||
*
|
||||
* @param webPath 访问路径
|
||||
* @param uploadPath 上传路径
|
||||
* @param fileUrl 访问路径
|
||||
* @param filePath 上传路径
|
||||
* @param md5Value md5值
|
||||
* @param createdBy 创建人
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int insert(String webPath, String uploadPath, String md5Value) {
|
||||
return forestFileMapper.insert(webPath, uploadPath, md5Value);
|
||||
public int insert(String fileUrl, String filePath, String md5Value, long createdBy) {
|
||||
return forestFileMapper.insert(fileUrl, filePath, md5Value, createdBy);
|
||||
}
|
||||
}
|
||||
|
@ -4,18 +4,19 @@
|
||||
<resultMap id="BaseResultMap" type="com.rymcu.forest.entity.ForestFile">
|
||||
<id column="id" property="id"/>
|
||||
<result column="md5_value" property="md5Value"/>
|
||||
<result column="upload_path" property="uploadPath"/>
|
||||
<result column="web_path" property="webPath"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="file_path" property="filePath"/>
|
||||
<result column="file_url" property="fileUrl"/>
|
||||
<result column="created_time" property="createdTime"/>
|
||||
<result column="updated_time" property="updatedTime"/>
|
||||
<result column="created_by" property="createdBy"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insert">
|
||||
insert into forest_user_role (md5, upload_path, web_path, created_time)
|
||||
values (#{md5Value}, #{uploadPath}, #{webPath}, sysdate())
|
||||
insert into forest_user_role (md5, file_path, file_url, created_time, created_by)
|
||||
values (#{md5Value}, #{filePath}, #{fileUrl}, sysdate(), #{createdBy})
|
||||
</insert>
|
||||
|
||||
<select id="getByMd5" resultMap="BaseResultMap">
|
||||
<select id="getForestFileByMd5" resultMap="BaseResultMap">
|
||||
select *
|
||||
from forest_file
|
||||
where md5_value = #{md5Value}
|
||||
|
Loading…
Reference in New Issue
Block a user