mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-05 23:11:24 +08:00
add the post of selectLimitByUserId
This commit is contained in:
@@ -156,4 +156,11 @@ public class NoticeController {
|
||||
return ResponseResult.build(code, msg, noticePageList.getRecords());
|
||||
}
|
||||
|
||||
@GetMapping("/limit")
|
||||
public ResponseResult<List<Notice>> selectLimitByUserId(){
|
||||
List<Notice> selectLimitByUserId = noticeReceiveService.selectLimitByUserId();
|
||||
String msg = (null!=selectLimitByUserId) ? "" : "数据查询失败,请重试!";
|
||||
return ResponseResult.build((null!=selectLimitByUserId) ? ResponseCode.DATABASE_DELETE_OK : ResponseCode.DATABASE_DELETE_ERROR, msg, selectLimitByUserId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,5 +18,6 @@ import java.util.List;
|
||||
@Mapper
|
||||
public interface NoticeReceiveMapper extends BaseMapper<NoticeReceive> {
|
||||
List<Notice> selectByUserId(Long userId,Integer readStatus);
|
||||
List<Notice> selectLimitByUserId(Long userId);
|
||||
|
||||
}
|
||||
|
||||
@@ -17,5 +17,8 @@ import java.util.List;
|
||||
public interface INoticeReceiveService extends IService<NoticeReceive> {
|
||||
List<Notice> selectByUserId(Integer readStatus);
|
||||
|
||||
List<Notice> selectLimitByUserId();
|
||||
|
||||
Boolean modifyNoticeIsRead(Notice notice);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,6 +30,12 @@ public class NoticeReceiveServiceImpl extends ServiceImpl<NoticeReceiveMapper, N
|
||||
return noticeReceiveMapper.selectByUserId(userId,readStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Notice> selectLimitByUserId() {
|
||||
Long userId = WebUtil.getLoginUser().getUser().getId();
|
||||
return noticeReceiveMapper.selectLimitByUserId(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean modifyNoticeIsRead(Notice notice) {
|
||||
Integer readStatus = null;
|
||||
|
||||
@@ -45,4 +45,36 @@
|
||||
<id property="id" column="uid"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
<!-- 所接收到公告的前五条公告 -->
|
||||
<select id="selectLimitByUserId" resultMap="selectAllMap">
|
||||
select u.id uid,
|
||||
u.username,
|
||||
n.id nid,
|
||||
n.title,
|
||||
n.content,
|
||||
n.type_id,
|
||||
n.sender_id,
|
||||
n.create_time,
|
||||
n.send_time,
|
||||
n.end_time,
|
||||
n.priority,
|
||||
n.top,
|
||||
n.modify_time,
|
||||
n.origin_id,
|
||||
type.id typeId,
|
||||
type.name,
|
||||
type.enable,
|
||||
notice_receive.id receiveId,
|
||||
notice_receive.already_read receiveRead
|
||||
from t_notice_receive notice_receive
|
||||
left join t_notice n on n.id = notice_receive.notice_id
|
||||
left join t_notice_type type on type.id = n.type_id
|
||||
left join t_user u on n.sender_id = u.id
|
||||
<where>
|
||||
and notice_receive.user_id=#{userId}
|
||||
and notice_receive.deleted=0
|
||||
</where>
|
||||
order by n.top desc, n.create_time desc
|
||||
limit 5;
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user