package cn.iocoder.yudao.module.system.dal.mysql.restaurant;


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.system.controller.admin.restaurant.vo.CateringPlanPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.restaurant.CateringPlanDO;
import org.apache.ibatis.annotations.Mapper;


/**
 * 餐谱计划 Mapper
 *
 * @author 系统管理员
 */
@Mapper
public interface CateringPlanMapper extends BaseMapperX<CateringPlanDO> {

    default PageResult<CateringPlanDO> selectPage(CateringPlanPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CateringPlanDO>()
                .likeIfPresent(CateringPlanDO::getRestaurantName, reqVO.getRestaurantName())
                .betweenIfPresent(CateringPlanDO::getScheduledStartDate, reqVO.getScheduledStartDate())
                .betweenIfPresent(CateringPlanDO::getScheduledEndDate, reqVO.getScheduledEndDate())
                .likeIfPresent(CateringPlanDO::getPlanName, reqVO.getPlanName())
                .eqIfPresent(CateringPlanDO::getTenantId,reqVO.getTenantId())
                .eqIfPresent(CateringPlanDO::getOrgType,reqVO.getOrgType())
                .orderByDesc(CateringPlanDO::getCreatedTime));
    }

}