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

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

/**
 * 活动用餐 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface ActivityRestaurantMapper extends BaseMapperX<ActivityRestaurantDO> {

    default PageResult<ActivityRestaurantDO> selectPage(ActivityRestaurantPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityRestaurantDO>()
                .eqIfPresent(ActivityRestaurantDO::getActivityId, reqVO.getActivityId())
                .eqIfPresent(ActivityRestaurantDO::getTotalTable, reqVO.getTotalTable())
                .eqIfPresent(ActivityRestaurantDO::getTableNum, reqVO.getTableNum())
                .eqIfPresent(ActivityRestaurantDO::getPrice, reqVO.getPrice())
                .eqIfPresent(ActivityRestaurantDO::getDishUrl, reqVO.getDishUrl())
                .eqIfPresent(ActivityRestaurantDO::getDescription, reqVO.getDescription())
                .betweenIfPresent(ActivityRestaurantDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ActivityRestaurantDO::getId));
    }

}