package cn.iocoder.yudao.module.member.dal.mysql.alloc;

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.member.controller.admin.alloc.vo.AllocPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.alloc.AllocDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 配置 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface AllocMapper extends BaseMapperX<AllocDO> {

    default PageResult<AllocDO> selectPage(AllocPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AllocDO>()
                .eqIfPresent(AllocDO::getMoudle, reqVO.getMoudle())
                .likeIfPresent(AllocDO::getAllocName, reqVO.getAllocName())
                .eqIfPresent(AllocDO::getAllocValue, reqVO.getAllocValue())
                .betweenIfPresent(AllocDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AllocDO::getId));
    }

}