文件数据库类
package com.ruoyi.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 【请填写功能名称】对象 sys_file
*
* @author ruoyi
* @date 2024-05-09
*/
public class SysXmglFile extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
/** 表名 */
@Excel(name = "表名")
private String tableName;
/** 原名称 */
@Excel(name = "原名称")
private String fileName;
/** 路径 */
@Excel(name = "路径")
private String filePath;
/** 类型 */
@Excel(name = "类型")
private String fileType;
/** 大小 */
@Excel(name = "大小")
private String fileSize;
/** 上传时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date uploadTime;
/** 表子节点ID */
@Excel(name = "表子节点ID")
private Long sonId;
/** 表父节点ID */
@Excel(name = "表父节点ID")
private Long parId;
/** 备注 */
@Excel(name = "备注")
private String rmark;
private String name;
public SysXmglFile() {
}
public SysXmglFile(Long id, String tableName, String fileName, String filePath, String fileType, String fileSize, Date uploadTime, Long sonId, Long parId, String rmark) {
this.id = id;
this.tableName = tableName;
this.fileName = fileName;
this.filePath = filePath;
this.fileType = fileType;
this.fileSize = fileSize;
this.uploadTime = uploadTime;
this.sonId = sonId;
this.parId = parId;
this.rmark = rmark;
this.name = fileName;
}
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setTableName(String tableName)
{
this.tableName = tableName;
}
public String getTableName()
{
return tableName;
}
public void setFileName(String fileName)
{
this.fileName = fileName;
this.name = fileName;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFileName()
{
return fileName;
}
public void setFilePath(String filePath)
{
this.filePath = filePath;
}
public String getFilePath()
{
return filePath;
}
public void setFileType(String fileType)
{
this.fileType = fileType;
}
public String getFileType()
{
return fileType;
}
public void setFileSize(String fileSize)
{
this.fileSize = fileSize;
}
public String getFileSize()
{
return fileSize;
}
public void setUploadTime(Date uploadTime)
{
this.uploadTime = uploadTime;
}
public Date getUploadTime()
{
return uploadTime;
}
public void setSonId(Long sonId)
{
this.sonId = sonId;
}
public Long getSonId()
{
return sonId;
}
public void setParId(Long parId)
{
this.parId = parId;
}
public Long getParId()
{
return parId;
}
public void setRmark(String rmark)
{
this.rmark = rmark;
}
public String getRmark()
{
return rmark;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("tableName", getTableName())
.append("fileName", getFileName())
.append("filePath", getFilePath())
.append("fileType", getFileType())
.append("fileSize", getFileSize())
.append("uploadTime", getUploadTime())
.append("sonId", getSonId())
.append("parId", getParId())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("rmark", getRmark())
.toString();
}
}
===============
mapper
<?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.ruoyi.system.mapper.SysXmglFileMapper">
<resultMap type="com.ruoyi.system.domain.SysXmglFile" id="SysXmglFileResult">
<result property="id" column="id" />
<result property="tableName" column="table_name" />
<result property="fileName" column="file_name" />
<result property="filePath" column="file_path" />
<result property="fileType" column="file_type" />
<result property="fileSize" column="file_size" />
<result property="uploadTime" column="upload_time" />
<result property="sonId" column="son_id" />
<result property="parId" column="par_id" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="rmark" column="rmark" />
</resultMap>
<sql id="selectSysXmglFileVo">
select id, table_name, file_name, file_path, file_type, file_size, upload_time, son_id, par_id, create_by, update_by, update_time, rmark from sys_xmgl_file
</sql>
<select id="selectSysXmglFileList" parameterType="com.ruoyi.system.domain.SysXmglFile" resultMap="SysXmglFileResult">
<include refid="selectSysXmglFileVo"/>
<where>
<if test="tableName != null and tableName != ''"> and table_name like concat('%', #{tableName}, '%')</if>
<if test="fileName != null and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
<if test="filePath != null and filePath != ''"> and file_path = #{filePath}</if>
<if test="fileType != null and fileType != ''"> and fi