package cn.iocoder.yudao.module.crm.dal.mysql.crmflowlog;

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.crm.controller.admin.crmflowlog.vo.*;
import cn.iocoder.yudao.module.crm.dal.dataobject.crmflowlog.CrmFlowLogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 审核日志 Mapper
 *
 * @author yshop
 */
@Mapper
public interface CrmFlowLogMapper extends BaseMapperX<CrmFlowLogDO> {

    default PageResult<CrmFlowLogDO> selectPage(CrmFlowLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CrmFlowLogDO>()
                .eqIfPresent(CrmFlowLogDO::getFlowId, reqVO.getFlowId())
                .eqIfPresent(CrmFlowLogDO::getTypesId, reqVO.getTypesId())
                .eqIfPresent(CrmFlowLogDO::getAdminId, reqVO.getAdminId())
                .eqIfPresent(CrmFlowLogDO::getTypes, reqVO.getTypes())
                .likeIfPresent(CrmFlowLogDO::getNickname, reqVO.getNickname())
                .eqIfPresent(CrmFlowLogDO::getRemark, reqVO.getRemark())
                .eqIfPresent(CrmFlowLogDO::getIsEnd, reqVO.getIsEnd())
                .eqIfPresent(CrmFlowLogDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(CrmFlowLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CrmFlowLogDO::getId));
    }

}
