package com.sunyard.ssp.modules.monitor.log.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sunyard.ssp.modules.monitor.log.entity.AuditLog;
import com.sunyard.ssp.modules.user.entity.ScUser;
import com.sunyard.ssp.vo.SearchVo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author fyc
 * @since 2020-03-18
 */
public interface IAuditLogService extends IService<AuditLog> {

    /**
     * 获取审计日志列表
     * @param pageNumber
     * @param pageSize
     * @param operateContent
     * @param operateType
     * @param readStatus
     * @param readUserName
     * @param startTime
     * @param endTime
     * @return
     */
    IPage<AuditLog> queryList(Integer pageNumber, Integer pageSize,
                              String operateContent, String operateType,
                              String readStatus, String readUserName,
                              String startTime, String endTime);

    /**
     * 获取审计日志列表
     * @param pageNumber
     * @param pageSize
     * @param operateContent
     * @param operateType
     * @param readStatus
     * @param readUserName
     * @param startTime
     * @param endTime
     * @return
     */
    IPage<AuditLog> userLogQueryList(Integer pageNumber, Integer pageSize,
                              String operateContent, String operateType,
                              String readStatus, String readUserName,
                              String startTime, String endTime);

    /**
     * 获取审计日志列表不带分页数据
     * @param operateContent
     * @param operateType
     * @param readStatus
     * @param readUserName
     * @param startTime
     * @param endTime
     * @return
     */
    List<AuditLog> queryList(String operateContent, String operateType,
                             String readStatus, String readUserName,
                             String startTime, String endTime);


    /**
     * 获取审计日志列表不带分页数据
     * @param operateContent
     * @param operateType
     * @param readStatus
     * @param readUserName
     * @param startTime
     * @param endTime
     * @return
     */
    List<AuditLog> userLogQueryListWithOutPage(String operateContent, String operateType,
                             String readStatus, String readUserName,
                             String startTime, String endTime);

    /**
     * 清空表
     * @return
     */
    Boolean truncateTable();


    /**
     * 更新审计日志的审计状态
     * @param ids 日志Id ，支持批量
     * @param scUser 批阅的用户
     * @return
     */
    Boolean updateReadStatus(Integer ids[], ScUser scUser);

    /**
     * @author wp
     * @Description: 根据签名id查询关联的日志详情，按id排序
     * @date 2022/2/17
     * @param signId
     * @return java.util.List<com.sunyard.ssp.modules.monitor.log.entity.AuditLog>
     */
    List<AuditLog> getByLogSignId(Long signId);


    Page<AuditLog> queryNeedSignLog(AuditLog auditLog, SearchVo searchVo, Pageable pageable);
    Page<AuditLog> userLoginQueryNeedSignLog(AuditLog auditLog, SearchVo searchVo, Pageable pageable);
}
