Browse Source

套系图片的增加

huianan 2 years ago
parent
commit
1b365c383e

+ 27 - 14
ruoyi-post/src/main/java/com/ruoyi/post/domain/PostSeries.java

@@ -24,6 +24,10 @@ public class PostSeries extends BaseEntity
     @Excel(name = "套系名称")
     private String seriesName;
 
+    /** 藏品头图 */
+    @Excel(name = "藏品头图")
+    private String seriesImage;
+
     /** 藏品数量 */
     @Excel(name = "藏品数量")
     private Long collectionCounts;
@@ -122,22 +126,31 @@ public class PostSeries extends BaseEntity
         return delFlag;
     }
 
+    public String getSeriesImage() {
+        return seriesImage;
+    }
+
+    public void setSeriesImage(String seriesImage) {
+        this.seriesImage = seriesImage;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("seriesId", getSeriesId())
-            .append("seriesName", getSeriesName())
-            .append("collectionCounts", getCollectionCounts())
-            .append("status", getStatus())
-            .append("exchangeStatus", getExchangeStatus())
-            .append("startTime", getStartTime())
-            .append("endTime", getEndTime())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .toString();
+                .append("seriesId", getSeriesId())
+                .append("seriesName", getSeriesName())
+                .append("seriesImage", getSeriesImage())
+                .append("collectionCounts", getCollectionCounts())
+                .append("status", getStatus())
+                .append("exchangeStatus", getExchangeStatus())
+                .append("startTime", getStartTime())
+                .append("endTime", getEndTime())
+                .append("delFlag", getDelFlag())
+                .append("createBy", getCreateBy())
+                .append("createTime", getCreateTime())
+                .append("updateBy", getUpdateBy())
+                .append("updateTime", getUpdateTime())
+                .append("remark", getRemark())
+                .toString();
     }
 }

+ 1 - 1
ruoyi-post/src/main/resources/mapper/PostPublisherMapper.xml

@@ -23,7 +23,7 @@
 
     <sql id="selectPostPublisherVo">
         select publisher_id,
-               publisher_image,
+               cast(publisher_image as char) as publisher_image,
                publisher_name,
                nick_name,
                publisher_email,

+ 10 - 3
ruoyi-post/src/main/resources/mapper/PostSeriesMapper.xml

@@ -7,6 +7,7 @@
     <resultMap type="PostSeries" id="PostSeriesResult">
         <result property="seriesId" column="series_id"/>
         <result property="seriesName" column="series_name"/>
+        <result property="seriesImage" column="series_image"/>
         <result property="collectionCounts" column="collection_counts"/>
         <result property="status" column="status"/>
         <result property="exchangeStatus" column="exchange_status"/>
@@ -23,6 +24,7 @@
     <sql id="selectPostSeriesVo">
         select series_id,
                series_name,
+               cast(series_image as char) as series_image,
                collection_counts,
                status,
                exchange_status,
@@ -36,8 +38,8 @@
     <select id="selectPostSeriesList" parameterType="PostSeries" resultMap="PostSeriesResult">
         <include refid="selectPostSeriesVo"/>
         <where>
-            <if test="seriesName != null  and seriesName != ''">and series_name like concat('%', #{seriesName}, '%')
-            </if>
+            <if test="seriesName != null  and seriesName != ''">and series_name like concat('%', #{seriesName}, '%') </if>
+            <if test="seriesImage != null  and seriesImage != ''"> and series_image = #{seriesImage}</if>
             <if test="collectionCounts != null ">and collection_counts = #{collectionCounts}</if>
             <if test="status != null  and status != ''">and status = #{status}</if>
             <if test="exchangeStatus != null  and exchangeStatus != ''">and exchange_status = #{exchangeStatus}</if>
@@ -55,6 +57,7 @@
         insert into post_series
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="seriesName != null and seriesName != ''">series_name,</if>
+            <if test="seriesImage != null">series_image,</if>
             <if test="collectionCounts != null">collection_counts,</if>
             <if test="status != null and status != ''">status,</if>
             <if test="exchangeStatus != null and exchangeStatus != ''">exchange_status,</if>
@@ -69,6 +72,7 @@
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="seriesName != null and seriesName != ''">#{seriesName},</if>
+            <if test="seriesImage != null">#{seriesImage},</if>
             <if test="collectionCounts != null">#{collectionCounts},</if>
             <if test="status != null and status != ''">#{status},</if>
             <if test="exchangeStatus != null and exchangeStatus != ''">#{exchangeStatus},</if>
@@ -87,6 +91,7 @@
         update post_series
         <trim prefix="SET" suffixOverrides=",">
             <if test="seriesName != null and seriesName != ''">series_name = #{seriesName},</if>
+            <if test="seriesImage != null">series_image = #{seriesImage},</if>
             <if test="collectionCounts != null">collection_counts = #{collectionCounts},</if>
             <if test="status != null and status != ''">status = #{status},</if>
             <if test="exchangeStatus != null and exchangeStatus != ''">exchange_status = #{exchangeStatus},</if>
@@ -116,7 +121,9 @@
     </update>
     <!-- 判断套系名字唯一   -->
     <select id="checkSeriesNameUnique" parameterType="String" resultMap="PostSeriesResult">
-        select series_id, series_name from post_series where series_name = #{seriesName} limit 1
+        select series_id, series_name
+        from post_series
+        where series_name = #{seriesName} limit 1
     </select>
 
 </mapper>