package cn.iocoder.byzs.module.infra.dal.mysql.demo;

import java.util.*;

import pojo.cn.iocoder.byzs.framework.common.PageResult;
import query.core.mybatis.cn.iocoder.byzs.framework.LambdaQueryWrapperX;
import mapper.core.mybatis.cn.iocoder.byzs.framework.BaseMapperX;
import cn.iocoder.byzs.module.infra.dal.dataobject.demo.InfraStudentDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.byzs.module.infra.controller.admin.demo.vo.*;

/**
 * 学生 Mapper
 *
 * @author 博雅智算源码
 */
@Mapper
public interface InfraStudentMapper extends BaseMapperX<InfraStudentDO> {

    default PageResult<InfraStudentDO> selectPage(InfraStudentPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<InfraStudentDO>()
                .likeIfPresent(InfraStudentDO::getName, reqVO.getName())
                .eqIfPresent(InfraStudentDO::getBirthday, reqVO.getBirthday())
                .eqIfPresent(InfraStudentDO::getSex, reqVO.getSex())
                .eqIfPresent(InfraStudentDO::getEnabled, reqVO.getEnabled())
                .betweenIfPresent(InfraStudentDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(InfraStudentDO::getId));
    }

}