package cn.iocoder.yudao.module.bpm.dal.mysql.oa.stamp;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bpm.controller.admin.oa.stamp.vo.OaStampPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oa.stamp.OaStampDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用印流程信息 Mapper
 *
 * @author dp
 */
@Mapper
public interface OaStampMapper extends BaseMapperX<OaStampDO> {

    default PageResult<OaStampDO> selectPage(OaStampPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OaStampDO>()
                .likeIfPresent(OaStampDO::getEmployeeName, reqVO.getEmployeeName())
                .likeIfPresent(OaStampDO::getEmployeePhone, reqVO.getEmployeePhone())
                .eqIfPresent(OaStampDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(OaStampDO::getPostId, reqVO.getPostId())
                .likeIfPresent(OaStampDO::getStampTitle, reqVO.getStampTitle())
                .eqIfPresent(OaStampDO::getAuditStatus, reqVO.getAuditStatus())
                .likeIfPresent(OaStampDO::getApplyEmployeeName, reqVO.getApplyEmployeeName())
                .betweenIfPresent(OaStampDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OaStampDO::getId));
    }

}