Pārlūkot izejas kodu

新增校园新闻

Administrator 2 gadi atpakaļ
vecāks
revīzija
3d2939a6bb

+ 25 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/XiaoyuanNotice.java

@@ -53,8 +53,32 @@ public class XiaoyuanNotice extends BaseEntity
     /** 发件人班级id */
     @Excel(name = "发件人班级id")
     private String senderDept;
+    /**
+     * 学校名称
+     */
+    private String schoolName;
+    /**
+     * 头像地址
+     */
+    private String avatar;
 
-    public void setNoticeId(Integer noticeId) 
+    public String getSchoolName() {
+        return schoolName;
+    }
+
+    public void setSchoolName(String schoolName) {
+        this.schoolName = schoolName;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public void setNoticeId(Integer noticeId)
     {
         this.noticeId = noticeId;
     }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/XiaoyuanNoticeServiceImpl.java

@@ -99,6 +99,7 @@ public class XiaoyuanNoticeServiceImpl implements IXiaoyuanNoticeService {
         xiaoyuanNotice.setSenderId(String.valueOf(user.getUserId()));
         xiaoyuanNotice.setSenderName(user.getUserName());
         String senderDept = xiaoyuanNotice.getSenderDept();
+        xiaoyuanNotice.setAvatar(user.getAvatar());
         int result = 0;
         if (StringUtils.isNotBlank(senderDept)){
             String[] split = senderDept.split(",");

+ 15 - 1
ruoyi-system/src/main/resources/mapper/system/XiaoyuanNoticeMapper.xml

@@ -20,10 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateBy"    column="update_by"    />
         <result property="updateTime"    column="update_time"    />
         <result property="remark"    column="remark"    />
+        <result property="avatar"    column="avatar"    />
+        <result property="schoolName"    column="school_name"    />
     </resultMap>
 
     <sql id="selectXiaoyuanNoticeVo">
-        select notice_id, image, notice_title, notice_type, notice_content, status, type, sender_id, sender_name, sender_dept, create_by, create_time, update_by, update_time, remark from xiaoyuan_notice
+        select notice_id, image, notice_title, notice_type, notice_content, status, type,school_name,avatar, sender_id, sender_name, sender_dept, create_by, create_time, update_by, update_time, remark from xiaoyuan_notice
     </sql>
 
     <select id="selectXiaoyuanNoticeList" parameterType="XiaoyuanNotice" resultMap="XiaoyuanNoticeResult">
@@ -35,6 +37,8 @@ SELECT
 	notice_content,
 	STATUS,
 	type,
+	avatar,
+	school_name,
 	sender_id,
 	sender_name,
 	sender_dept,
@@ -56,6 +60,8 @@ SELECT
 	notice_content,
 	STATUS,
 	type,
+		avatar,
+	school_name,
 	sender_id,
 	sender_name,
 	sender_dept,
@@ -77,6 +83,8 @@ SELECT
 	notice_content,
 	STATUS,
 	type,
+		avatar,
+	school_name,
 	sender_id,
 	sender_name,
 	sender_dept,
@@ -106,6 +114,8 @@ WHERE
             <if test="noticeContent != null and noticeContent != ''">notice_content,</if>
             <if test="status != null and status != ''">status,</if>
             <if test="type != null and type != ''">type,</if>
+            <if test="schoolName != null and schoolName != ''">school_name,</if>
+            <if test="avatar != null and avatar != ''">avatar,</if>
             <if test="senderId != null">sender_id,</if>
             <if test="senderName != null">sender_name,</if>
             <if test="senderDept != null">sender_dept,</if>
@@ -122,6 +132,8 @@ WHERE
             <if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
             <if test="status != null and status != ''">#{status},</if>
             <if test="type != null and type != ''">#{type},</if>
+            <if test="schoolName != null and schoolName != ''">#{schoolName},</if>
+            <if test="avatar != null and avatar != ''">#{avatar},</if>
             <if test="senderId != null">#{senderId},</if>
             <if test="senderName != null">#{senderName},</if>
             <if test="senderDept != null">#{senderDept},</if>
@@ -142,6 +154,8 @@ WHERE
             <if test="noticeContent != null and noticeContent != ''">notice_content = #{noticeContent},</if>
             <if test="status != null and status != ''">status = #{status},</if>
             <if test="type != null and type != ''">type = #{type},</if>
+            <if test="schoolName != null and schoolName != ''">school_name = #{schoolName},</if>
+            <if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
             <if test="senderId != null">sender_id = #{senderId},</if>
             <if test="senderName != null">sender_name = #{senderName},</if>
             <if test="senderDept != null">sender_dept = #{senderDept},</if>