package com.qmth.teachcloud.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
import com.qmth.teachcloud.common.bean.result.BasicMajorResult;
import com.qmth.teachcloud.common.bean.result.BasicOperationLogResult;
import com.qmth.teachcloud.common.entity.BasicOperationLog;
import com.qmth.teachcloud.common.enums.log.OperationTypeEnum;
import org.apache.ibatis.annotations.Param;

/**
 * @Description: 基础操作日志记录mapper
 * @Author: CaoZixuan
 * @Date: 2022-02-15
 */
public interface BasicOperationLogMapper extends BaseMapper<BasicOperationLog> {

    /**
     * 分页查询 - 操作日志
     *
     * @param iPage                   分页参数
     * @param schoolId                学校id
     * @param customizedOperationType 自定义操作类型
     * @param startTime               创建开始时间
     * @param endTime                 创建截止时间
     * @param operatorName            操作人名称
     * @param dpr                     数据权限
     * @return 分页结果
     */
    IPage<BasicOperationLogResult> findOperationLogPage(@Param("iPage") Page<BasicMajorResult> iPage,
                                                        @Param("schoolId") Long schoolId,
                                                        @Param("operationType") OperationTypeEnum operationType,
                                                        @Param("startTime") Long startTime,
                                                        @Param("endTime") Long endTime,
                                                        @Param("operatorName") String operatorName,
                                                        @Param("dpr") DataPermissionRule dpr);
}
