jiangping
2023-09-13 5c82263c61825c37514b2329ee3ffa425e62a900
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package com.doumee.dao.business;
 
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.doumee.dao.business.model.Notice;
import com.doumee.dao.web.response.MeetingListResponse;
import com.doumee.dao.web.response.NoticeCardResponse;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
 
import java.util.List;
 
/**
 * @author 江蹄蹄
 * @date 2023/05/04 18:18
 */
public interface NoticeMapper extends BaseMapper<Notice> {
 
 
    @Select(" select n.* from  (select * from notice a where a.type =  0  " +
            " union" +
            " select * from notice b  where b.type = 1  and b.MEMBER_ID = #{memberId} ) n  " +
            " order by n.CREATE_DATE desc ")
    IPage<NoticeCardResponse> noticePage(IPage<NoticeCardResponse> page, @Param("memberId") Integer memberId);
 
 
    @Select(" select * from notice a where ( a.MEMBER_ID = #{userId} or a.TYPE = 0 )   order by CREATE_DATE  desc   limit 1   ")
    NoticeCardResponse newNotice(@Param("userId") Integer userId);
 
 
 
    @Select(" select * from notice a where a.id = #{id}   ")
    NoticeCardResponse getNoticeDetail(@Param("id") Integer id);
 
 
}