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

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.dishesraw.vo.DishesRawPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.dishesraw.DishesRawDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 菜品原材料 Mapper
 *
 * @author 开发账号
 */
@Mapper
public interface DishesRawMapper extends BaseMapperX<DishesRawDO> {

    default PageResult<DishesRawDO> selectPage(DishesRawPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DishesRawDO>()
                .likeIfPresent(DishesRawDO::getRawName, reqVO.getRawName())
                .eqIfPresent(DishesRawDO::getRawImgUrl, reqVO.getRawImgUrl())
                .eqIfPresent(DishesRawDO::getRawDescribe, reqVO.getRawDescribe())
                .eqIfPresent(DishesRawDO::getDishesId, reqVO.getDishesId())
                .eqIfPresent(DishesRawDO::getRawOrigin, reqVO.getRawOrigin())
                .betweenIfPresent(DishesRawDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DishesRawDO::getRawPrice, reqVO.getRawPrice())
                .orderByDesc(DishesRawDO::getId));
    }

}