//得到sql语句;
public virtual string GetSqlStatement(string statementName,
object paramObject)
{
ISqlMapper ISQLMapper =
MapperFactory.Get();
IMappedStatement IMstatement =
ISQLMapper.GetMappedStatement(statementName);
if
(!ISQLMapper.IsSessionStarted)
{
ISQLMapper.OpenConnection();
}
RequestScope RSscope = IMstatement.Statement.Sql.GetRequestScope(IMstatement, paramObject, ISQLMapper.LocalSession);
return RSscope.PreparedStatement.PreparedSql;
}
Ibatis根据id获取拼接好的sql语句案例,布布扣,bubuko.com
原文:http://www.cnblogs.com/guozefeng/p/3620467.html