Explorar el Código

feat(news): 新增新闻分类图标字段

- 在 NewsCategory 实体类中添加 iconUrl 字段
- 在 NewsCategoryBo 业务对象中添加 iconUrl 字段
- 在 NewsCategoryVo 视图对象中添加 iconUrl 字段
- 更新 NewsCategoryMapper.xml 中的 SQL 查询语句,包含 icon_url 字段
- 更新 NewsCategoryMapper.xml 中的插入和更新操作,支持 icon_url 字段
- 在 Excel 导出配置中添加 iconUrl 字段映射
fugui001 hace 1 semana
padre
commit
cb8325738a

+ 4 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/NewsCategory.java

@@ -58,5 +58,8 @@ public class NewsCategory{
      */
     private Date updatedAt;
 
-
+    /**
+     * 图片
+     */
+    private String iconUrl;
 }

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/bo/NewsCategoryBo.java

@@ -60,5 +60,10 @@ public class NewsCategoryBo extends BaseEntity {
      */
     private Date updatedAt;
 
+    /**
+     * 图片
+     */
+    private String iconUrl;
+
 
 }

+ 4 - 1
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/business/domain/vo/NewsCategoryVo.java

@@ -64,5 +64,8 @@ public class NewsCategoryVo implements Serializable {
     @ExcelProperty(value = "")
     private Date updatedAt;
 
-
+    /**
+     * 图片
+     */
+    private String iconUrl;
 }

+ 13 - 4
ruoyi-modules/ruoyi-system/src/main/resources/mapper/business/NewsCategoryMapper.xml

@@ -12,7 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             `sort`,
             `is_show`,
             `created_at`,
-            `updated_at`
+            `updated_at`,
+            `icon_url`
         FROM news_category  ${ew.customSqlSegment}
     </select>
 
@@ -25,7 +26,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             `sort`,
             `is_show`,
             `created_at`,
-            `updated_at`
+            `updated_at`,
+            `icon_url`
         FROM news_category  ${ew.customSqlSegment}
     </select>
 
@@ -37,7 +39,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             `sort`,
             `is_show`,
             `created_at`,
-            `updated_at`
+            `updated_at`,
+            `icon_url`
         FROM news_category WHERE id =  #{id}
     </select>
 
@@ -56,6 +59,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="isShow != null and isShow != ''">
                 is_show = #{isShow},
             </if>
+            <if test="iconUrl != null and iconUrl != ''">
+                icon_url = #{iconUrl},
+            </if>
             updated_at = NOW()
         </set>
         WHERE id = #{id}
@@ -69,6 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="code != null and code != ''">code,</if>
             <if test="sort != null and sort != ''">sort,</if>
             <if test="isShow != null and isShow != ''">is_show,</if>
+            <if test="iconUrl != null and iconUrl != ''">icon_url,</if>
             created_at
         </trim>
         <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
@@ -76,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="code != null and code != ''">#{code},</if>
             <if test="sort != null and sort != ''">#{sort},</if>
             <if test="isShow != null and isShow != ''">#{isShow},</if>
+            <if test="iconUrl != null and iconUrl != ''">#{iconUrl},</if>
             NOW()
         </trim>
     </insert>
@@ -112,7 +120,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             `sort`,
             `is_show`,
             `created_at`,
-            `updated_at`
+            `updated_at`,
+            `icon_url`
         FROM news_category  where is_show=1
     </select>