package org.beetl.sql.core.engine;

import org.beetl.core.Context;
import org.beetl.core.Function;
import org.beetl.sql.core.db.DBAutoGeneratedSql;

public class PageQueryFuntion implements Function {

	//Override
	@Override
	public String call(Object[] paras, Context ctx) {
		Object o = ctx.getGlobal(DBAutoGeneratedSql.PAGE);
		if(o!=null) {
			return "count(1)";

		} else {

			if (paras.length == 0) {
				return "*";
			} else {
				return (String) paras[0];
			}
		}


	}

}
