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 { @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 noticePage(IPage 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); }