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

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.log.vo.UserOperationLogPageReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.log.UserOperationLogDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 用户操作记录 Mapper
 *
 * @author 陈宾顺
 */
@Mapper
public interface UserOperationLogMapper extends BaseMapperX<UserOperationLogDO> {

    default PageResult<UserOperationLogDO> selectPage(UserOperationLogPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserOperationLogDO>()
                .likeIfPresent(UserOperationLogDO::getNickName, reqVO.getNickName())
                .likeIfPresent(UserOperationLogDO::getOperateAction, reqVO.getOperateAction())
                .betweenIfPresent(UserOperationLogDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserOperationLogDO::getCreateTime));
    }

}