From 2af534eea471f4adb104906c7a814bcc66d4d68d Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期一, 13 九月 2021 13:03:58 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue into dev

---
 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java |  193 +++++++++++++++++++++++++-----------------------
 1 files changed, 101 insertions(+), 92 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
index 8bebd9c..dd8fdbc 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
@@ -1,92 +1,101 @@
-package com.ruoyi.system.service.impl;
-
-import java.util.List;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ruoyi.system.domain.SysNotice;
-import com.ruoyi.system.mapper.SysNoticeMapper;
-import com.ruoyi.system.service.ISysNoticeService;
-
-/**
- * 鍏憡 鏈嶅姟灞傚疄鐜�
- * 
- * @author ruoyi
- */
-@Service
-public class SysNoticeServiceImpl implements ISysNoticeService
-{
-    @Autowired
-    private SysNoticeMapper noticeMapper;
-
-    /**
-     * 鏌ヨ鍏憡淇℃伅
-     * 
-     * @param noticeId 鍏憡ID
-     * @return 鍏憡淇℃伅
-     */
-    @Override
-    public SysNotice selectNoticeById(Long noticeId)
-    {
-        return noticeMapper.selectNoticeById(noticeId);
-    }
-
-    /**
-     * 鏌ヨ鍏憡鍒楄〃
-     * 
-     * @param notice 鍏憡淇℃伅
-     * @return 鍏憡闆嗗悎
-     */
-    @Override
-    public List<SysNotice> selectNoticeList(SysNotice notice)
-    {
-        return noticeMapper.selectNoticeList(notice);
-    }
-
-    /**
-     * 鏂板鍏憡
-     * 
-     * @param notice 鍏憡淇℃伅
-     * @return 缁撴灉
-     */
-    @Override
-    public int insertNotice(SysNotice notice)
-    {
-        return noticeMapper.insertNotice(notice);
-    }
-
-    /**
-     * 淇敼鍏憡
-     * 
-     * @param notice 鍏憡淇℃伅
-     * @return 缁撴灉
-     */
-    @Override
-    public int updateNotice(SysNotice notice)
-    {
-        return noticeMapper.updateNotice(notice);
-    }
-
-    /**
-     * 鍒犻櫎鍏憡瀵硅薄
-     * 
-     * @param noticeId 鍏憡ID
-     * @return 缁撴灉
-     */
-    @Override
-    public int deleteNoticeById(Long noticeId)
-    {
-        return noticeMapper.deleteNoticeById(noticeId);
-    }
-
-    /**
-     * 鎵归噺鍒犻櫎鍏憡淇℃伅
-     * 
-     * @param noticeIds 闇�瑕佸垹闄ょ殑鍏憡ID
-     * @return 缁撴灉
-     */
-    @Override
-    public int deleteNoticeByIds(Long[] noticeIds)
-    {
-        return noticeMapper.deleteNoticeByIds(noticeIds);
-    }
-}
+package com.ruoyi.system.service.impl;
+
+import com.ruoyi.common.utils.StringUtils;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.common.core.mybatisplus.core.ServicePlusImpl;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.common.utils.PageUtils;
+import com.ruoyi.system.domain.SysNotice;
+import com.ruoyi.system.mapper.SysNoticeMapper;
+import com.ruoyi.system.service.ISysNoticeService;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 鍏憡 鏈嶅姟灞傚疄鐜�
+ *
+ * @author ruoyi
+ */
+@Service
+public class SysNoticeServiceImpl extends ServicePlusImpl<SysNoticeMapper, SysNotice, SysNotice> implements ISysNoticeService {
+
+    @Override
+    public TableDataInfo<SysNotice> selectPageNoticeList(SysNotice notice) {
+        LambdaQueryWrapper<SysNotice> lqw = new LambdaQueryWrapper<SysNotice>()
+                .like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle())
+                .eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType())
+                .like(StringUtils.isNotBlank(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy());
+        return PageUtils.buildDataInfo(page(PageUtils.buildPage(),lqw));
+    }
+
+    /**
+     * 鏌ヨ鍏憡淇℃伅
+     *
+     * @param noticeId 鍏憡ID
+     * @return 鍏憡淇℃伅
+     */
+    @Override
+    public SysNotice selectNoticeById(Long noticeId) {
+        return getById(noticeId);
+    }
+
+    /**
+     * 鏌ヨ鍏憡鍒楄〃
+     *
+     * @param notice 鍏憡淇℃伅
+     * @return 鍏憡闆嗗悎
+     */
+    @Override
+    public List<SysNotice> selectNoticeList(SysNotice notice) {
+        return list(new LambdaQueryWrapper<SysNotice>()
+                .like(StringUtils.isNotBlank(notice.getNoticeTitle()),SysNotice::getNoticeTitle,notice.getNoticeTitle())
+                .eq(StringUtils.isNotBlank(notice.getNoticeType()),SysNotice::getNoticeType,notice.getNoticeType())
+                .like(StringUtils.isNotBlank(notice.getCreateBy()),SysNotice::getCreateBy,notice.getCreateBy()));
+    }
+
+    /**
+     * 鏂板鍏憡
+     *
+     * @param notice 鍏憡淇℃伅
+     * @return 缁撴灉
+     */
+    @Override
+    public int insertNotice(SysNotice notice) {
+        return baseMapper.insert(notice);
+    }
+
+    /**
+     * 淇敼鍏憡
+     *
+     * @param notice 鍏憡淇℃伅
+     * @return 缁撴灉
+     */
+    @Override
+    public int updateNotice(SysNotice notice) {
+        return baseMapper.updateById(notice);
+    }
+
+    /**
+     * 鍒犻櫎鍏憡瀵硅薄
+     *
+     * @param noticeId 鍏憡ID
+     * @return 缁撴灉
+     */
+    @Override
+    public int deleteNoticeById(Long noticeId) {
+        return baseMapper.deleteById(noticeId);
+    }
+
+    /**
+     * 鎵归噺鍒犻櫎鍏憡淇℃伅
+     *
+     * @param noticeIds 闇�瑕佸垹闄ょ殑鍏憡ID
+     * @return 缁撴灉
+     */
+    @Override
+    public int deleteNoticeByIds(Long[] noticeIds) {
+        return baseMapper.deleteBatchIds(Arrays.asList(noticeIds));
+    }
+}

--
Gitblit v1.9.3