package cn.iocoder.yudao.module.system.dal.mysql.position;

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.system.controller.admin.position.vo.PositionPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.position.PositionDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 岗位信息 Mapper
 *
 * @author 符溶馨
 */
@Mapper
public interface PositionMapper extends BaseMapperX<PositionDO> {

    default PageResult<PositionDO> selectPage(PositionPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PositionDO>()
                .likeIfPresent(PositionDO::getName, reqVO.getName())
                .eqIfPresent(PositionDO::getStatus, reqVO.getStatus())
                .eqIfPresent(PositionDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(PositionDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PositionDO::getId));
    }

}