3 天以前 83e1b4d0e661f11a407fd6ea86e906b9b87b7180
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
package cn.iocoder.yudao.module.bpm.dal.mysql.oa;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.vo.OaNoticePageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.OaNoticeDO;
import org.apache.ibatis.annotations.Mapper;
 
import java.util.Set;
 
@Mapper
public interface OaNoticeMapper extends BaseMapperX<OaNoticeDO> {
 
    default PageResult<OaNoticeDO> selectPage(OaNoticePageReqVO reqVO, Set<Long> noticeIds) {
        LambdaQueryWrapperX<OaNoticeDO> wrapper = new LambdaQueryWrapperX<OaNoticeDO>()
                .likeIfPresent(OaNoticeDO::getTitle, reqVO.getTitle())
                .eqIfPresent(OaNoticeDO::getType, reqVO.getType())
                .eqIfPresent(OaNoticeDO::getStatus, reqVO.getStatus())
                .eqIfPresent(OaNoticeDO::getSendScope, reqVO.getSendScope())
                .orderByDesc(OaNoticeDO::getIsTop)
                .orderByDesc(OaNoticeDO::getId);
        if (noticeIds != null) {
            wrapper.in(OaNoticeDO::getId, noticeIds);
        }
        return selectPage(reqVO, wrapper);
    }
 
}