package cn.iocoder.yudao.module.system.dal.mysql.biz;

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.system.controller.admin.sys.vo.EvaluationProcessPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.SysEvaluationProcessDO;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface SysEvaluationProcessMapper extends BaseMapperX<SysEvaluationProcessDO> {


    default PageResult<SysEvaluationProcessDO> selectPage(EvaluationProcessPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SysEvaluationProcessDO>()
                .inIfPresent(SysEvaluationProcessDO::getTenantId, reqVO.getTenantIds())
                .eqIfPresent(SysEvaluationProcessDO::getOrgType, reqVO.getOrgType())
                .likeIfPresent(SysEvaluationProcessDO::getProcessName, reqVO.getProcessName())
                .betweenIfPresent(SysEvaluationProcessDO::getCreatedTime, reqVO.getCreateTime())
                .orderByDesc(SysEvaluationProcessDO::getCreatedTime));
    }
}
