Administrator преди 2 години
родител
ревизия
2963037a2b

+ 11 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/XiaoyuanNoticeController.java

@@ -46,6 +46,17 @@ public class XiaoyuanNoticeController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 我的校园新闻列表
+     */
+    @PreAuthorize("@ss.hasPermi('xiaoYuan:notice:myList')")
+    @GetMapping("/myList")
+    public TableDataInfo myList(XiaoyuanNotice xiaoyuanNotice)
+    {
+        List<XiaoyuanNotice> list = xiaoyuanNoticeService.selectXiaoyuanNoticeMyList(xiaoyuanNotice);
+        return getDataTable(list);
+    }
+
     /**
      * 导出校园新闻列表
      */

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/XiaoyuanNoticeMapper.java

@@ -26,6 +26,7 @@ public interface XiaoyuanNoticeMapper
      * @return 校园新闻集合
      */
     public List<XiaoyuanNotice> selectXiaoyuanNoticeList(XiaoyuanNotice xiaoyuanNotice);
+    public List<XiaoyuanNotice> selectXiaoyuanNoticeMyList(XiaoyuanNotice xiaoyuanNotice);
 
     /**
      * 新增校园新闻

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

@@ -26,6 +26,7 @@ public interface IXiaoyuanNoticeService
      * @return 校园新闻集合
      */
     public List<XiaoyuanNotice> selectXiaoyuanNoticeList(XiaoyuanNotice xiaoyuanNotice);
+    public List<XiaoyuanNotice> selectXiaoyuanNoticeMyList(XiaoyuanNotice xiaoyuanNotice);
 
     /**
      * 新增校园新闻

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

@@ -86,6 +86,13 @@ public class XiaoyuanNoticeServiceImpl implements IXiaoyuanNoticeService {
         return xiaoyuanNoticeMapper.selectXiaoyuanNoticeList(xiaoyuanNotice);
     }
 
+    @Override
+    public List<XiaoyuanNotice> selectXiaoyuanNoticeMyList(XiaoyuanNotice xiaoyuanNotice) {
+        SysUser user = SecurityUtils.getLoginUser().getUser();
+        xiaoyuanNotice.setSenderId(String.valueOf(user.getUserId()));
+        return xiaoyuanNoticeMapper.selectXiaoyuanNoticeMyList(xiaoyuanNotice);
+    }
+
     /**
      * 新增校园新闻
      *

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

@@ -104,7 +104,11 @@ WHERE
         <include refid="selectXiaoyuanNoticeVo"/>
         where notice_id = #{noticeId}
     </select>
-        
+    <select id="selectXiaoyuanNoticeMyList" resultType="com.ruoyi.system.domain.XiaoyuanNotice">
+        <include refid="selectXiaoyuanNoticeVo"/>
+        where sender_id = #{senderId}
+    </select>
+
     <insert id="insertXiaoyuanNotice" parameterType="XiaoyuanNotice" useGeneratedKeys="true" keyProperty="noticeId">
         insert into xiaoyuan_notice
         <trim prefix="(" suffix=")" suffixOverrides=",">