// Path: src/main/java/persistent/prestige/modules/common/tenant/TenantContextHolder.java
// public class TenantContextHolder {
// 	
// 	private static ThreadLocal<String> tenanThreadLocal = new ThreadLocal<String>();
// 	
// 	public static final void setTenant(String scheme) {
// 		tenanThreadLocal.set(scheme);
// 	}
// 	
// 	public static final String getTenant() {
// 		String scheme = tenanThreadLocal.get();
// 		if (scheme == null) {
// 			scheme = "";
// 		}
// 		return scheme;
// 	}
// 	
// 	public static final void remove() {
// 		tenanThreadLocal.remove();
// 	}
// 
// }
// 
// Path: src/main/java/persistent/prestige/modules/edu/dao/TeacherUserDao.java
// @Repository("teacherUserDao")
// @MybatisScan
// public interface TeacherUserDao extends Dao<TeacherUser,java.lang.Long>{
// 	
// 	GlobalUser findGlobalUser(String account);
// 	
// 	
// 	List<TeacherUser> findAllUser();
// 	
// 
// }


import java.sql.Connection;
import java.util.Properties;
import org.apache.ibatis.executor.statement.RoutingStatementHandler;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;
import org.apache.ibatis.plugin.Signature;
import org.apache.kahadb.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import persistent.prestige.modules.common.tenant.TenantContextHolder;
import persistent.prestige.modules.edu.dao.TeacherUserDao;
package persistent.prestige.platform.mybatis.Interceptor;




@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class }) })
public class TenantInterceptor implements Interceptor {

	@Override
	public Object intercept(Invocation invocation) throws Throwable {
		
// Path: src/main/java/persistent/prestige/modules/common/tenant/TenantContextHolder.java
// public class TenantContextHolder {
// 	
// 	private static ThreadLocal<String> tenanThreadLocal = new ThreadLocal<String>();
// 	
// 	public static final void setTenant(String scheme) {
// 		tenanThreadLocal.set(scheme);
// 	}
// 	
// 	public static final String getTenant() {
// 		String scheme = tenanThreadLocal.get();
// 		if (scheme == null) {
// 			scheme = "";
// 		}
// 		return scheme;
// 	}
// 	
// 	public static final void remove() {
// 		tenanThreadLocal.remove();
// 	}
// 
// }
// 
// Path: src/main/java/persistent/prestige/modules/edu/dao/TeacherUserDao.java
// @Repository("teacherUserDao")
// @MybatisScan
// public interface TeacherUserDao extends Dao<TeacherUser,java.lang.Long>{
// 	
// 	GlobalUser findGlobalUser(String account);
// 	
// 	
// 	List<TeacherUser> findAllUser();
// 	
// 
// }


// Path: src/main/java/persistent/prestige/platform/mybatis/Interceptor/TenantInterceptor.java
import java.sql.Connection;
import java.util.Properties;
import org.apache.ibatis.executor.statement.RoutingStatementHandler;
import org.apache.ibatis.executor.statement.StatementHandler;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.plugin.Intercepts;
import org.apache.ibatis.plugin.Invocation;
import org.apache.ibatis.plugin.Plugin;
import org.apache.ibatis.plugin.Signature;
import org.apache.kahadb.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import persistent.prestige.modules.common.tenant.TenantContextHolder;
import persistent.prestige.modules.edu.dao.TeacherUserDao;

package persistent.prestige.platform.mybatis.Interceptor;




@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class }) })
public class TenantInterceptor implements Interceptor {

	@Override
	public Object intercept(Invocation invocation) throws Throwable {
		
		String tenant = TenantContextHolder.getTenant();