package com.jy.framework.mybatis.join;

import com.baomidou.mybatisplus.core.assist.ISqlRunner;

import java.util.Map;

public class SqlProvider {

    public static String getSql(Map<String, Object> paramMap) {
        Sql<?> sql = (Sql<?>) paramMap.get(ISqlRunner.SQL);
        try {
            SqlContext.init(paramMap);
            return sql.format();
        } finally {
            SqlContext.remove();
        }
    }

}
