package cn.iocoder.yudao.module.portal.dal.mysql.portaluser;

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.portal.dal.dataobject.portaluser.PortalUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.portal.controller.admin.portaluser.vo.*;

/**
 * 用户 Mapper
 *
 * @author 篮智科技
 */
@Mapper
public interface PortalUserMapper extends BaseMapperX<PortalUserDO> {

    default PageResult<PortalUserDO> selectPage(PortalUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PortalUserDO>()
                .likeIfPresent(PortalUserDO::getUsername, reqVO.getUsername())
                .eqIfPresent(PortalUserDO::getPassword, reqVO.getPassword())
                .eqIfPresent(PortalUserDO::getToken, reqVO.getToken())
                .betweenIfPresent(PortalUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PortalUserDO::getId));
    }

}