mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
Temp commit on 2023-05-01 5:00
This commit is contained in:
@@ -16,5 +16,7 @@ import java.util.List;
|
||||
public interface INoticeService extends IService<Notice> {
|
||||
Notice selectByNoticeId(Long nid);
|
||||
|
||||
List<Notice> selectAllNoticeId();
|
||||
List<Notice> selectAllNotice();
|
||||
|
||||
Boolean deleteById(Long nid);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.cfive.pinnacle.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.cfive.pinnacle.entity.Notice;
|
||||
import com.cfive.pinnacle.entity.NoticeReceive;
|
||||
import com.cfive.pinnacle.mapper.NoticeMapper;
|
||||
import com.cfive.pinnacle.mapper.NoticeReceiveMapper;
|
||||
import com.cfive.pinnacle.service.INoticeService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -21,13 +24,28 @@ import java.util.List;
|
||||
public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements INoticeService {
|
||||
@Autowired
|
||||
NoticeMapper noticeMapper;
|
||||
@Autowired
|
||||
NoticeReceiveMapper noticeReceiveMapper;
|
||||
@Override
|
||||
public Notice selectByNoticeId(Long nid) {
|
||||
return noticeMapper.selectByNoticeId(nid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Notice> selectAllNoticeId() {
|
||||
return noticeMapper.selectAllNoticeId();
|
||||
public List<Notice> selectAllNotice() {
|
||||
return noticeMapper.selectAllNotice();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deleteById(Long nid) {
|
||||
LambdaQueryWrapper<NoticeReceive> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(NoticeReceive::getNoticeId, nid);
|
||||
List<NoticeReceive> noticeReceives = noticeReceiveMapper.selectList(lqw);
|
||||
for (NoticeReceive nrc:
|
||||
noticeReceives) {
|
||||
noticeReceiveMapper.deleteById(nrc.getId());
|
||||
}
|
||||
return noticeMapper.deleteById(nid)==0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user