package com.template.mapper;

import com.template.model.pojo.SmartDataSourceLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 数据源操作日志 Mapper 接口
 * </p>
 *
 * @author ceshi
 * @since 2023-12-05
 */
@Repository
public interface SmartDataSourceLogMapper extends BaseMapper<SmartDataSourceLog> {

    @Select(" SELECT DISTINCT " +
            "    log_action_name " +
            " FROM " +
            "    smart_data_source_log " +
            " ORDER BY " +
            "    log_action_name DESC "
    )
    List<String> queryDistinctActionName();

    @Select(" SELECT DISTINCT " +
            "    log_action_people " +
            " FROM " +
            "    smart_data_source_log " +
            " ORDER BY " +
            "    log_action_people "
    )
    List<String> queryDistinctActionPeople();

    @Select(" SELECT DISTINCT " +
            "    log_action_module " +
            " FROM " +
            "    smart_data_source_log " +
            " ORDER BY " +
            "    log_action_module "
    )
    List<String> queryDistinctActionModule();

    @Select(" SELECT DISTINCT " +
            "    log_action_business " +
            " FROM " +
            "    smart_data_source_log " +
            " ORDER BY " +
            "    log_action_business DESC "
    )
    List<String> queryDistinctActionBusiness();
}
