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

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


/**
 * 门店餐盘设置 Mapper
 *
 * @author 我是秦俊旗
 */
@Mapper
public interface StoreDiningPlatesMapper extends BaseMapperX<StoreDiningPlatesDO> {

    default PageResult<StoreDiningPlatesDO> selectPage(StoreDiningPlatesPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StoreDiningPlatesDO>()
                .eqIfPresent(StoreDiningPlatesDO::getStoreId, reqVO.getStoreId())
                .eqIfPresent(StoreDiningPlatesDO::getAmountStart, reqVO.getAmountStart())
                .eqIfPresent(StoreDiningPlatesDO::getAmountEnd, reqVO.getAmountEnd())
                .eqIfPresent(StoreDiningPlatesDO::getNum, reqVO.getNum())
                .eqIfPresent(StoreDiningPlatesDO::getApplyToCard, reqVO.getApplyToCard())
                .betweenIfPresent(StoreDiningPlatesDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StoreDiningPlatesDO::getId));
    }

}