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

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.diningplates.vo.DiningPlatesPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.diningplates.DiningPlatesDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 餐盘 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface DiningPlatesMapper extends BaseMapperX<DiningPlatesDO> {

    default PageResult<DiningPlatesDO> selectPage(DiningPlatesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DiningPlatesDO>()
                .eqIfPresent(DiningPlatesDO::getDiningPlatesNum, reqVO.getDiningPlatesNum())
                .eqIfPresent(DiningPlatesDO::getUserId, reqVO.getUserId())
                .eqIfPresent(DiningPlatesDO::getStatus, reqVO.getStatus())
                .eqIfPresent(DiningPlatesDO::getStoreId,reqVO.getStoreId())
                .betweenIfPresent(DiningPlatesDO::getBindingTime, reqVO.getBindingTime())
                .betweenIfPresent(DiningPlatesDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DiningPlatesDO::getId));
    }



}