package cn.iocoder.yudao.server.dal.mysql;

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.server.controller.admin.vo.FlowPageReqVO;
import cn.iocoder.yudao.server.dal.dataobject.FlowDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 门户流程配置 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface FlowMapper extends BaseMapperX<FlowDO> {

    default PageResult<FlowDO> selectPage(FlowPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FlowDO>()
                .likeIfPresent(FlowDO::getGroupId, reqVO.getGroupId())
                .likeIfPresent(FlowDO::getFlowName, reqVO.getFlowName())
                .eqIfPresent(FlowDO::getFlowUrl, reqVO.getFlowUrl())
                .eqIfPresent(FlowDO::getStatus, reqVO.getStatus())
                .eqIfPresent(FlowDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(FlowDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FlowDO::getId));
    }

}