Browse Source

附件上传新增排序字段

吕宣芝 1 năm trước cách đây
mục cha
commit
eaeafe0dcd

+ 7 - 68
src/main/java/com/sooka/sponest/data/system/attach/domain/CenterdataTAttach.java

@@ -4,6 +4,7 @@ import com.ruoyi.common.core.annotation.Excel;
 import com.sooka.sponest.data.base.domain.BaseBusinessEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
@@ -16,7 +17,7 @@ import java.util.List;
  * @date 2022-06-11
  */
 @ApiModel(description = "数据中心附件实体类")
-
+@Data
 public class CenterdataTAttach extends BaseBusinessEntity {
 
     private static final long serialVersionUID = 1L;
@@ -28,15 +29,6 @@ public class CenterdataTAttach extends BaseBusinessEntity {
     @Excel(name = "业务ID")
     private String busId;
 
-
-    public List<String> getBusIds() {
-        return busIds;
-    }
-
-    public void setBusIds(List<String> busIds) {
-        this.busIds = busIds;
-    }
-
     private List<String> busIds;
     /**
      * 路径
@@ -73,63 +65,10 @@ public class CenterdataTAttach extends BaseBusinessEntity {
     @Excel(name = "附件类型")
     private String fileType;
 
-    public String getBusId() {
-        return busId;
-    }
-
-    public void setBusId(String busId) {
-        this.busId = busId;
-    }
-
-    public String getAttachPath() {
-        return attachPath;
-    }
-
-    public void setAttachPath(String attachPath) {
-        this.attachPath = attachPath;
-    }
-
-    public String getBusIndx() {
-        return busIndx;
-    }
-
-    public void setBusIndx(String busIndx) {
-        this.busIndx = busIndx;
-    }
-
-    public String getBusSource() {
-        return busSource;
-    }
-
-    public void setBusSource(String busSource) {
-        this.busSource = busSource;
-    }
-
-    public String getFileName() {
-        return fileName;
-    }
-
-    public void setFileName(String fileName) {
-        this.fileName = fileName;
-    }
-
-    public String getFileType() {
-        return fileType;
-    }
-
-    public void setFileType(String fileType) {
-        this.fileType = fileType;
-    }
+    /**
+     * 排序
+     */
+    @ApiModelProperty(value = "排序", required = false)
+    private String attachSorts;
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
-                .append("busId", getBusId())
-                .append("attachPath", getAttachPath())
-                .append("busIndx", getBusIndx())
-                .append("busSource", getBusSource())
-                .append("fileName", getFileName())
-                .append("fileType", getFileType())
-                .toString();
-    }
 }

+ 13 - 4
src/main/resources/mapper/system/attach/CenterdataTAttachMapper.xml

@@ -11,10 +11,12 @@
         <result property="busSource" column="bus_source"/>
         <result property="fileName" column="file_name"/>
         <result property="fileType" column="file_type"/>
+        <result property="createTime" column="create_time"/>
+        <result property="attachSorts" column="attach_sorts"/>
     </resultMap>
 
     <sql id="selectCenterdataTAttachVo">
-        select bus_id, attach_path, bus_indx,bus_source,file_name,file_type from centerdata_t_attach
+        select bus_id, attach_path, bus_indx,bus_source,file_name,file_type,create_time,attach_sorts from centerdata_t_attach
     </sql>
 
     <select id="selectCenterdataTAttachList" parameterType="CenterdataTAttach" resultMap="CenterdataTAttachResult">
@@ -25,6 +27,7 @@
             <if test="busIndx != null  and busIndx != ''">and bus_indx = #{busIndx}</if>
             <if test="busSource != null  and busSource != ''">and bus_source = #{busSource}</if>
         </where>
+        order by attach_sorts
     </select>
 
     <select id="remotelistNew" parameterType="CenterdataTAttach" resultMap="CenterdataTAttachResult">
@@ -33,6 +36,7 @@
         <foreach item="busIds" collection="busIds" open="(" separator="," close=")">
             #{busIds}
         </foreach>
+        order by attach_sorts
     </select>
 
     <select id="selectCenterdataTAttachByBusId" parameterType="String" resultMap="CenterdataTAttachResult">
@@ -54,6 +58,7 @@
             <if test="busSource != null">bus_source,</if>
             <if test="fileName != null">file_name,</if>
             <if test="fileType != null">file_type,</if>
+            <if test="attachSorts != null">attach_sorts,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="busId != null">#{busId},</if>
@@ -62,6 +67,7 @@
             <if test="busSource != null">#{busSource},</if>
             <if test="fileName != null">#{fileName},</if>
             <if test="fileType != null">#{fileType},</if>
+            <if test="attachSorts != null">#{attachSorts},</if>
         </trim>
     </insert>
 
@@ -73,6 +79,7 @@
             <if test="busSource != null">bus_source = #{busSource},</if>
             <if test="fileName != null">file_name = #{fileName},</if>
             <if test="fileType != null">file_type = #{fileType},</if>
+            <if test="attachSorts != null">attach_sorts = #{attachSorts},</if>
         </trim>
         where bus_id = #{busId}
     </update>
@@ -84,6 +91,7 @@
             <if test="attachPath != null">attach_path = #{attachPath},</if>
             <if test="busSource != null">bus_source = #{busSource},</if>
             <if test="fileType != null">file_type = #{fileType},</if>
+            <if test="attachSorts != null">attach_sorts = #{attachSorts},</if>
         </trim>
         where bus_id = #{busId} and attach_path = #{fileName}
     </update>
@@ -135,7 +143,7 @@
         bus_indx,
         bus_source,
         file_name,
-        file_type
+        attach_sorts,
         )values
         <foreach collection="list" item="item" index="index" open="" close="" separator=",">
             (
@@ -144,7 +152,8 @@
             #{item.busIndx},
             #{item.busSource},
             #{item.fileName},
-            #{item.fileType}
+            #{item.fileType},
+            #{item.attachSorts}
             )
         </foreach>
     </insert>
@@ -185,6 +194,6 @@
     </delete>
 
     <select id="selectDataAttachPathByBusId" resultType="String" parameterType="String">
-        select attach_path from centerdata_t_attach where bus_id = #{busId}
+        select attach_path, attach_sorts from centerdata_t_attach where bus_id = #{busId}
     </select>
 </mapper>