package com.search.supersearch.mapper.pgsql;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

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

/**
 * @author 喜欢番茄火锅
 * @date 2023/11/16 15:08
 */
@DS("dws_7tzly_test")
public interface CustomMapper {

    @Select("SELECT * FROM ${name} ")
    List<Map> selectUserByNameAndAge(@Param("name") String name, IPage page);

    @Select("SELECT count(1) FROM ${name} ")
    Long count(@Param("name") String name);

    @Select("set search_path to ${name}")
    String setschema_name(@Param("name") String name);
}
