Commit 0a8edda1 by 284718418@qq.com

优化代码-我的文件图标显示

parent a06613c2
package cn.timer.api.bean.disk; package cn.timer.api.bean.disk;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model; import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -10,10 +11,7 @@ import lombok.Builder; ...@@ -10,10 +11,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.persistence.Entity; import javax.persistence.*;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -109,4 +107,12 @@ public class DiskFiles extends Model<DiskFiles> { ...@@ -109,4 +107,12 @@ public class DiskFiles extends Model<DiskFiles> {
*/ */
@ApiModelProperty(value = "") @ApiModelProperty(value = "")
private Date updateTime; private Date updateTime;
/**
* 文件图标
*/
@Transient
@TableField(exist = false)
@ApiModelProperty(value = "文件图标")
private String url;
} }
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
</resultMap> </resultMap>
<select id="selectListByParam" resultMap="BaseResultMap"> <select id="selectListByParam" resultType="cn.timer.api.bean.disk.DiskFiles">
SELECT f.* FROM `disk_files` f SELECT f.*,(SELECT url FROM disk_file_image WHERE f.file_type=type AND delete_flag = 0 LIMIT 1) url FROM `disk_files` f
LEFT JOIN disk_catalogue_files cf ON f.id=cf.files_id AND cf.id > 0 LEFT JOIN disk_catalogue_files cf ON f.id=cf.files_id AND cf.id > 0
WHERE f.delete_flag=0 AND cf.delete_flag = 0 WHERE f.delete_flag=0 AND cf.delete_flag = 0
AND cf.catalogue_id=#{param.parentId} AND cf.catalogue_id=#{param.parentId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment