package cn.iocoder.yudao.module.pms.dal.mysql.iotsapsynclog;

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.pms.controller.admin.iotsapsynclog.vo.IotSapSyncLogPageReqVO;
import cn.iocoder.yudao.module.pms.dal.dataobject.iotsapsynclog.IotSapSyncLogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 操作日志记录 V2 版本 Mapper
 *
 * @author ruiqi
 */
@Mapper
public interface IotSapSyncLogMapper extends BaseMapperX<IotSapSyncLogDO> {

    default PageResult<IotSapSyncLogDO> selectPage(IotSapSyncLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<IotSapSyncLogDO>()
                .eqIfPresent(IotSapSyncLogDO::getTraceId, reqVO.getTraceId())
                .eqIfPresent(IotSapSyncLogDO::getSubType, reqVO.getSubType())
                .eqIfPresent(IotSapSyncLogDO::getAction, reqVO.getAction())
                .eqIfPresent(IotSapSyncLogDO::getSuccess, reqVO.getSuccess())
                .eqIfPresent(IotSapSyncLogDO::getExtra, reqVO.getExtra())
                .betweenIfPresent(IotSapSyncLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(IotSapSyncLogDO::getId));
    }

}