package cn.iocoder.yudao.module.bpm.dal.mysql.business;

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.bpm.controller.admin.business.vo.ModelConfigPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.business.ModelConfigDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface ModelConfigMapper extends BaseMapperX<ModelConfigDO> {

    default PageResult<ModelConfigDO> selectPage(ModelConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ModelConfigDO>()
                .eqIfPresent(ModelConfigDO::getModelId, reqVO.getModelId())
                .eqIfPresent(ModelConfigDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ModelConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ModelConfigDO::getId));
    }

}
