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

import java.util.*;

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

/**
 * 活动套餐 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface ActivityMenuMapper extends BaseMapperX<ActivityMenuDO> {

    default PageResult<ActivityMenuDO> selectPage(ActivityMenuPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityMenuDO>()
                .likeIfPresent(ActivityMenuDO::getMenuName, reqVO.getMenuName())
                .eqIfPresent(ActivityMenuDO::getDetail, reqVO.getDetail())
                .eqIfPresent(ActivityMenuDO::getDishPrice, reqVO.getDishPrice())
                .eqIfPresent(ActivityMenuDO::getMerchantId, reqVO.getMerchantId())
                .betweenIfPresent(ActivityMenuDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityMenuDO::getId));
    }

}