package cn.iocoder.yudao.module.iot.dal.mysql.recipepointrecord;

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.iot.dal.dataobject.recipepointrecord.RecipePointRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.iot.controller.admin.recipepointrecord.vo.*;

/**
 * IoT配方点位记录 Mapper
 *
 * @author 内蒙必硕
 */
@Mapper
public interface RecipePointRecordMapper extends BaseMapperX<RecipePointRecordDO> {

    default PageResult<RecipePointRecordDO> selectPage(RecipePointRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RecipePointRecordDO>()
                .eqIfPresent(RecipePointRecordDO::getRecipeId, reqVO.getRecipeId())
                .likeIfPresent(RecipePointRecordDO::getName, reqVO.getName())
                .eqIfPresent(RecipePointRecordDO::getMax, reqVO.getMax())
                .eqIfPresent(RecipePointRecordDO::getMin, reqVO.getMin())
                .eqIfPresent(RecipePointRecordDO::getDataType, reqVO.getDataType())
                .eqIfPresent(RecipePointRecordDO::getDataUnit, reqVO.getDataUnit())
                .eqIfPresent(RecipePointRecordDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(RecipePointRecordDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(RecipePointRecordDO::getRefer, reqVO.getRefer())
                .orderByDesc(RecipePointRecordDO::getId));
    }

}