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.FlowGroupPageReqVO;
import cn.iocoder.yudao.server.dal.dataobject.FlowGroupDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 门户流程分组信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface FlowGroupMapper extends BaseMapperX<FlowGroupDO> {

    default PageResult<FlowGroupDO> selectPage(FlowGroupPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<FlowGroupDO>()
                .likeIfPresent(FlowGroupDO::getGroupName, reqVO.getGroupName())
                .eqIfPresent(FlowGroupDO::getSort, reqVO.getSort())
                .eqIfPresent(FlowGroupDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(FlowGroupDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(FlowGroupDO::getId));
    }

}