1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-06 07:21:24 +08:00

add noticeTypeManage module

This commit is contained in:
cccccyb
2023-05-16 03:13:19 +08:00
parent a2508b887e
commit c860e9c3e8
23 changed files with 460 additions and 91 deletions

View File

@@ -24,8 +24,8 @@ public class NoticeReceiveServiceImpl extends ServiceImpl<NoticeReceiveMapper, N
@Autowired
private NoticeReceiveMapper noticeReceiveMapper;
@Override
public List<Notice> selectAllByUserId() {
public List<Notice> selectByUserId(Integer readStatus) {
Long userId = WebUtil.getLoginUser().getUser().getId();
return noticeReceiveMapper.selectAllByUserId(userId);
return noticeReceiveMapper.selectByUserId(userId,readStatus);
}
}

View File

@@ -2,6 +2,7 @@ package com.cfive.pinnacle.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.cfive.pinnacle.entity.NoticeType;
import com.cfive.pinnacle.mapper.NoticeTypeMapper;
import com.cfive.pinnacle.service.INoticeTypeService;
@@ -26,9 +27,24 @@ public class NoticeTypeServiceImpl extends ServiceImpl<NoticeTypeMapper, NoticeT
NoticeTypeMapper noticeTypeMapper;
@Override
public List<NoticeType> selectTypeList() {
return noticeTypeMapper.selectList(null);
}
@Override
public List<NoticeType> selectEnableTypeList() {
LambdaQueryWrapper<NoticeType> lqw = new LambdaQueryWrapper<>();
lqw.eq(NoticeType::getEnable, 1);
List<NoticeType> noticeTypes = noticeTypeMapper.selectList(lqw);
return noticeTypes;
}
@Override
public Boolean updateTypeEnableById(Long typeId, Integer enable) {
if ((null==typeId)||(null==enable)){
return false;
}
LambdaUpdateWrapper<NoticeType> luw = new LambdaUpdateWrapper<>();
luw.eq(null!=typeId,NoticeType::getId, typeId).set(null!=enable,NoticeType::getEnable,enable);
return noticeTypeMapper.update(null, luw)>0;
}
}