From c4e17ff8472fd9f8123e86b593b2968ad5936b15 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 01 十一月 2021 13:49:11 +0800 Subject: [PATCH] fix 修复 xxl-job-admin 部署问题 --- 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..b4f70d7 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.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.common.utils.StringUtils; +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 Lion Li + */ +@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