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

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.definition.vo.filter.BpmInstanceFilterPageReqVO;
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.group.BpmUserGroupPageReqVO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmInstanceFilterDO;
import cn.iocoder.yudao.module.bpm.dal.dataobject.definition.BpmUserGroupDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 流程实例过滤 Mapper
 *

 */
@Mapper
public interface BpmInstanceFilterMapper extends BaseMapperX<BpmInstanceFilterDO> {

    default PageResult<BpmInstanceFilterDO> selectPage(BpmInstanceFilterPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BpmInstanceFilterDO>()
                .eqIfPresent(BpmInstanceFilterDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .eqIfPresent(BpmInstanceFilterDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(BpmInstanceFilterDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(BpmInstanceFilterDO::getId));
    }

}
