乐于分享
好东西不私藏

MyBatis 源码解读(三):StatementHandler 与参数处理——SQL 是怎么被编译和填充的

MyBatis 源码解读(三):StatementHandler 与参数处理——SQL 是怎么被编译和填充的

写在前面

上一篇我们讲完了 Executor,知道它负责"调度"。但 Executor 自己不直接跟数据库打交道——它把脏活累活外包给了 StatementHandler。StatementHandler 才是那个真正跟 JDBC Statement 打交道的"包工头"。

这篇文章我们拆解两个问题:

  1. StatementHandler 是怎么决定用 Statement、PreparedStatement 还是 CallableStatement 的?
  2. 你传的 Java 对象参数,是怎么变成 SQL 里的 ? 占位符的?

一、StatementHandler 家族:四个兄弟,分工明确

StatementHandler 的类图很有意思——一个接口,五个实现:

StatementHandler (接口)
  ├── RoutingStatementHandler —— 门面,负责"派活"
  ├── BaseStatementHandler —— 抽象基类,封装公共逻辑
        ├── SimpleStatementHandler —— 处理 Statement(静态 SQL)
        ├── PreparedStatementHandler —— 处理 PreparedStatement(预编译,默认)
        └── CallableStatementHandler —— 处理 CallableStatement(存储过程)

1.1 RoutingStatementHandler:就是个派单的

publicclassRoutingStatementHandlerimplementsStatementHandler{
privatefinal StatementHandler delegate;

publicRoutingStatementHandler(Executor executor,
            MappedStatement ms, Object parameter,
            RowBounds rowBounds, ResultHandler resultHandler,
            BoundSql boundSql)
{
switch (ms.getStatementType()) {
case STATEMENT:
                delegate = new SimpleStatementHandler(...);
break;
case PREPARED:
                delegate = new PreparedStatementHandler(...);
break;
case CALLABLE:
                delegate = new CallableStatementHandler(...);
break;
default:
thrownew ExecutorException(
"Unknown statement type: " + ms.getStatementType());
        }
    }

@Override
public Statement prepare(Connection connection,
            Integer transactionTimeout)
throws SQLException 
{
return delegate.prepare(connection, transactionTimeout);
    }

@Override
publicvoidparameterize(Statement statement)
throws SQLException 
{
        delegate.parameterize(statement);
    }

// ... 其他方法全部委托给 delegate
}

RoutingStatementHandler 自己啥也不干——就是个转发器。它根据 MappedStatement.getStatementType() 的值(默认是 PREPARED)决定创建哪个具体的 StatementHandler。

这就像一个快递分拣中心:包裹进来,根据地址判断是同城、跨省还是国际件,然后交给对应的派送团队。分拣中心自己不送货,但它决定了包裹归谁送。

你可能想问:为什么非要多这一层?直接 new 不就行了?

答案是:为了插件。Configuration.newStatementHandler() 创建的是 RoutingStatementHandler,然后插件拦截的是这个对象。如果没有这一层,插件就得自己判断拦截哪个具体实现。多一层代理,插件就只需要关心 StatementHandler 接口,不用管底层是谁。

1.2 BaseStatementHandler:公共代码的仓库

publicabstractclassBaseStatementHandler
implementsStatementHandler
{
protectedfinal Configuration configuration;
protectedfinal Executor executor;
protectedfinal MappedStatement mappedStatement;
protectedfinal RowBounds rowBounds;
protectedfinal BoundSql boundSql;
protectedfinal ParameterHandler parameterHandler;
protectedfinal ResultSetHandler resultSetHandler;

protectedBaseStatementHandler(...){
// 初始化各种字段
this.parameterHandler = configuration.newParameterHandler(
            mappedStatement, parameterObject, boundSql);
this.resultSetHandler = configuration.newResultSetHandler(
            executor, mappedStatement, rowBounds,
            parameterHandler, resultHandler, boundSql);
    }

@Override
public Statement prepare(Connection connection,
            Integer transactionTimeout)
throws SQLException 
{
        ErrorContext.instance().sql(boundSql.getSql());
        Statement statement = null;
try {
            statement = instantiateStatement(connection);
            setStatementTimeout(statement, transactionTimeout);
            setFetchSize(statement);
return statement;
        } catch (SQLException e) {
            closeStatement(statement);
throw e;
        } catch (Exception e) {
            closeStatement(statement);
thrownew ExecutorException(
"Error preparing statement. Cause: " + e, e);
        }
    }

protectedabstract Statement instantiateStatement(
        Connection connection)
throws SQLException
;
}

BaseStatementHandler 在构造方法里做了两件重要的事:

  1. 创建 ParameterHandler——负责参数绑定
  2. 创建 ResultSetHandler——负责结果映射(下一篇讲)

prepare() 方法定义了准备 Statement 的标准流程:

  1. instantiateStatement() —— 子类实现,创建具体的 Statement
  2. setStatementTimeout() —— 设置超时
  3. setFetchSize() —— 设置 fetch size

然后 prepare() 返回创建好的 Statement,交给 Executor 去调用 parameterize()

1.3 PreparedStatementHandler:主角登场

MyBatis 默认用的就是 PreparedStatementHandler,预编译 + 参数绑定,防注入还高效。

publicclassPreparedStatementHandler
extendsBaseStatementHandler
{

publicPreparedStatementHandler(Executor executor,
            MappedStatement mappedStatement, Object parameter,
            RowBounds rowBounds, ResultHandler resultHandler,
            BoundSql boundSql)
{
super(executor, mappedStatement, parameter,
            rowBounds, resultHandler, boundSql);
    }

@Override
protected Statement instantiateStatement(
            Connection connection)
throws SQLException 
{
        String sql = boundSql.getSql();
if (mappedStatement.getKeyGenerator()
instanceof Jdbc3KeyGenerator) {
            String[] keyColumnNames =
                mappedStatement.getKeyColumns();
if (keyColumnNames == null) {
return connection.prepareStatement(sql,
                    PreparedStatement.RETURN_GENERATED_KEYS);
            } else {
return connection.prepareStatement(sql,
                    keyColumnNames);
            }
        } elseif (mappedStatement.getResultSetType()
                != null) {
return connection.prepareStatement(sql,
                mappedStatement.getResultSetType().getValue(),
                ResultSet.CONCUR_READ_ONLY);
        } else {
return connection.prepareStatement(sql);
        }
    }

@Override
publicvoidparameterize(Statement statement)
throws SQLException 
{
        parameterHandler.setParameters(
            (PreparedStatement) statement);
    }

@Override
publicintupdate(Statement statement)throws SQLException {
        PreparedStatement ps = (PreparedStatement) statement;
        ps.execute();
int rows = ps.getUpdateCount();
        Object parameterObject = boundSql.getParameterObject();
        KeyGenerator keyGenerator =
            mappedStatement.getKeyGenerator();
        keyGenerator.processAfter(executor, mappedStatement,
            ps, parameterObject);
return rows;
    }

@Override
public <E> List<E> query(Statement statement,
            ResultHandler resultHandler)
throws SQLException 
{
        PreparedStatement ps = (PreparedStatement) statement;
        ps.execute();
return resultSetHandler.handleResultSets(ps);
    }
}

instantiateStatement() 根据配置决定怎么创建 PreparedStatement

  • 如果用 Jdbc3KeyGenerator(自增主键回填),传入 RETURN_GENERATED_KEYS
  • 如果指定了 resultSetType,创建支持滚动/只读的结果集
  • 否则走最简单的 prepareStatement(sql)

parameterize() 就一行——把活交给 ParameterHandler。这就像一个厨师把调料的配比工作交给副手,自己专心炒菜。

update() 和 query() 是最终执行 SQL 的地方,调用了 PreparedStatement.execute(),然后分别处理更新计数或结果集。

1.4 SimpleStatementHandler:简单粗暴

publicclassSimpleStatementHandler
extendsBaseStatementHandler
{

@Override
protected Statement instantiateStatement(
            Connection connection)
throws SQLException 
{
if (mappedStatement.getResultSetType() != null) {
return connection.createStatement(
                mappedStatement.getResultSetType().getValue(),
                ResultSet.CONCUR_READ_ONLY);
        } else {
return connection.createStatement();
        }
    }

@Override
publicvoidparameterize(Statement statement){
// Nope
    }

@Override
public <E> List<E> query(Statement statement,
            ResultHandler resultHandler)
throws SQLException 
{
        String sql = boundSql.getSql();
        statement.execute(sql);
return resultSetHandler.handleResultSets(statement);
    }
}

SimpleStatementHandler 用 Statement 而不是 PreparedStatement,直接拼接 SQL。parameterize() 是空的——因为 Statement 不支持参数化,参数已经在生成 BoundSql 的时候拼接进去了。

这就像一个快餐店:不做预订,来了就做,做完就送。优点是快(不用预编译),缺点是容易出问题(SQL 注入风险)。除非你知道自己在做什么,否则别用。

什么时候会用 SimpleStatementHandler?当你在 Mapper XML 里显式指定 statementType="STATEMENT" 的时候。但说实话,99% 的场景你都应该用默认的 PREPARED

二、ParameterHandler:把 Java 对象塞进 SQL

ParameterHandler 的接口极简:

publicinterfaceParameterHandler{
Object getParameterObject();
voidsetParameters(PreparedStatement ps)
throws SQLException
;
}

就一个方法 setParameters,负责把 Java 参数设置到 PreparedStatement 里。

2.1 DefaultParameterHandler 的实现

publicclassDefaultParameterHandler
implementsParameterHandler
{
privatefinal TypeHandlerRegistry typeHandlerRegistry;
privatefinal MappedStatement mappedStatement;
privatefinal Object parameterObject;
privatefinal BoundSql boundSql;

@Override
publicvoidsetParameters(PreparedStatement ps){
        ErrorContext.instance().activity("setting parameters")
            .object(mappedStatement.getParameterMap().getId());

        List<ParameterMapping> parameterMappings =
            boundSql.getParameterMappings();

if (parameterMappings != null) {
for (int i = 0; i < parameterMappings.size(); i++) {
                ParameterMapping parameterMapping =
                    parameterMappings.get(i);
if (parameterMapping.getMode()
                        != ParameterMode.OUT) {
                    Object value;
                    String propertyName =
                        parameterMapping.getProperty();

if (boundSql.hasAdditionalParameter(
                            propertyName)) {
                        value = boundSql
                            .getAdditionalParameter(propertyName);
                    } elseif (parameterObject == null) {
                        value = null;
                    } elseif (typeHandlerRegistry
                            .hasTypeHandler(
                                parameterObject.getClass())) {
                        value = parameterObject;
                    } else {
                        MetaObject metaObject =
                            configuration.newMetaObject(
                                parameterObject);
                        value = metaObject
                            .getValue(propertyName);
                    }

                    TypeHandler typeHandler =
                        parameterMapping.getTypeHandler();
                    JdbcType jdbcType =
                        parameterMapping.getJdbcType();
if (value == null
                            && jdbcType == null) {
                        jdbcType = configuration
                            .getJdbcTypeForNull();
                    }
try {
                        typeHandler.setParameter(
                            ps, i + 1, value, jdbcType);
                    } catch (TypeException e) {
thrownew TypeException(
"Could not set parameters for mapping: "
                            + parameterMapping + ". Cause: " + e, e);
                    } catch (SQLException e) {
thrownew TypeException(
"Could not set parameters for mapping: "
                            + parameterMapping + ". Cause: " + e, e);
                    }
                }
            }
        }
    }
}

这段代码的逻辑清晰但细节多,我们拆开看:

参数值从哪里取?

setParameters 遍历 boundSql.getParameterMappings(),每个 ParameterMapping 对应一个 #{xxx} 占位符。获取参数值的优先级:

  1. boundSql.hasAdditionalParameter(propertyName) —— 动态 SQL 产生的额外参数(比如 <foreach> 生成的 __frch_item_0
  2. parameterObject == null —— 参数对象本身就是 null
  3. typeHandlerRegistry.hasTypeHandler(parameterObject.getClass()) —— 参数对象本身是基本类型(Integer、String 等),直接用
  4. 通过 MetaObject 反射取值 —— 参数对象是 POJO,通过 metaObject.getValue(propertyName) 取属性

TypeHandler:类型转换的翻译官

拿到参数值后,通过 typeHandler.setParameter(ps, i + 1, value, jdbcType) 设置到 PreparedStatementTypeHandler 是 Java 类型和 JDBC 类型之间的"翻译官"。

举个例子:StringTypeHandler

publicclassStringTypeHandler
extendsBaseTypeHandler<String
{
@Override
publicvoidsetNonNullParameter(
            PreparedStatement ps, int i,
            String parameter, JdbcType jdbcType)

throws SQLException 
{
        ps.setString(i, parameter);
    }

@Override
public String getNullableResult(
            ResultSet rs, String columnName)

throws SQLException 
{
return rs.getString(columnName);
    }
}

MyBatis 内置了一堆 TypeHandler

  • IntegerTypeHandler → PreparedStatement.setInt()
  • StringTypeHandler → PreparedStatement.setString()
  • DateTypeHandler → PreparedStatement.setTimestamp()
  • BlobTypeHandler → PreparedStatement.setBlob()

如果你的参数类型不在内置列表里,可以自定义 TypeHandler,然后在 mybatis-config.xml 里注册。

null 值处理

如果参数值为 null,且没有指定 jdbcType,MyBatis 会调用 configuration.getJdbcTypeForNull() 获取默认值(通常是 OTHER,但不同数据库表现不同)。这也是为什么官方文档建议你在 #{xxx} 里写 jdbcType——不然 null 值可能会导致数据库驱动摸不着头脑。

比如 #{createTime, jdbcType=TIMESTAMP},明确告诉 MyBatis:这列是时间戳,null 也按 TIMESTAMP 处理。

三、从 XML 到 BoundSql:参数映射的前置工作

ParameterHandler 依赖 BoundSqlBoundSql 又依赖 ParameterMapping。它们是怎么产生的?

当你在 Mapper XML 里写:

<selectid="findById"resultType="User">
    SELECT * FROM user WHERE id = #{id}
</select>

XMLStatementBuilder 解析这个标签时,会把 #{id} 提取为 ParameterMapping,然后生成 DynamicSqlSource 或 RawSqlSource(取决于是否含动态 SQL)。

BoundSql 的最终形态:

  • sqlSELECT * FROM user WHERE id = ?(占位符替换为 ?
  • parameterMappings:一个列表,包含 ParameterMapping{property='id', jdbcType=null, typeHandler=IntegerTypeHandler}
  • parameterObject:你传入的 Java 对象

ParameterHandler 拿到 BoundSql 后,按 parameterMappings 的顺序逐个填值。

四、小结:SQL 执行的准备阶段

Executor.doQuery()
    │
    ▼
Configuration.newStatementHandler()
    │
    ├── new RoutingStatementHandler() —— 根据 StatementType 路由
    │       └── 创建具体 StatementHandler(默认 PreparedStatementHandler)
    │
    └── interceptorChain.pluginAll() —— 植入插件代理
    │
    ▼
BaseStatementHandler.prepare()
    │
    ├── instantiateStatement() —— 子类实现,创建 Statement/PreparedStatement
    ├── setStatementTimeout() —— 设置超时
    └── setFetchSize() —— 设置 fetch size
    │
    ▼
StatementHandler.parameterize()
    │
    ▼
ParameterHandler.setParameters()
    │
    ├── 遍历 ParameterMapping 列表
    ├── 从 parameterObject / MetaObject / additionalParameter 取值
    ├── 通过 TypeHandler 类型转换
    └── PreparedStatement.setXxx() 设置参数
    │
    ▼
PreparedStatement.execute() —— 真正发送 SQL 到数据库

五、几个容易踩的坑

为什么我的参数传进去了,SQL 里却变成了 null?

检查 parameterObject 的类型和 ParameterMapping 的 property 是否匹配。如果参数是 POJO,MyBatis 通过 MetaObject 反射取属性。如果属性名写错了(比如大小写不匹配),MetaObject.getValue() 会返回 null,不会报错。

为什么同样的代码,换个数据库就报类型转换错误?

TypeHandler 是通用的,但 JdbcType 的处理可能因数据库而异。比如 Oracle 对 null 值的处理比 MySQL 更严格。建议显式指定 jdbcType

#{createTime, jdbcType=TIMESTAMP}

为什么批量插入时,用 BATCH Executor 比 foreach 快?

foreach 是在 MyBatis 层拼接 SQL,生成一条超长的 INSERT INTO ... VALUES (...), (...), (...),本质还是一条 SQL。BatchExecutor 是利用 JDBC 的 addBatch(),把多条 SQL 攒起来一次性发过去,减少了网络往返。

下篇预告

下一篇讲 ResultSetHandler——数据库返回的行记录,是怎么变成你写的 Java 对象的。那才是 ORM 最魔幻的地方。


本系列文章基于 MyBatis 3.5.x 源码,写作时对照源码逐行验证。如果发现有问题的地方,欢迎指正。

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-06-24 20:51:39 HTTP/1.1 GET : https://www.yeyulingfeng.com/a/790335.html
  2. 运行时间 : 0.142400s [ 吞吐率:7.02req/s ] 内存消耗:4,856.60kb 文件加载:145
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=0dab3e4bc17b2625897dc9ea927e18e8
  1. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/composer/autoload_static.php ( 6.05 KB )
  7. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/ralouphie/getallheaders/src/getallheaders.php ( 1.60 KB )
  10. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  11. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  12. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  13. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  14. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  15. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  16. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  17. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  18. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  19. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions_include.php ( 0.16 KB )
  21. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/guzzlehttp/guzzle/src/functions.php ( 5.54 KB )
  22. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  23. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  24. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  25. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/provider.php ( 0.19 KB )
  26. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  27. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  28. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  29. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/common.php ( 0.03 KB )
  30. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  32. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/alipay.php ( 3.59 KB )
  33. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  34. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/app.php ( 0.95 KB )
  35. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cache.php ( 0.78 KB )
  36. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/console.php ( 0.23 KB )
  37. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/cookie.php ( 0.56 KB )
  38. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/database.php ( 2.48 KB )
  39. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/filesystem.php ( 0.61 KB )
  40. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/lang.php ( 0.91 KB )
  41. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/log.php ( 1.35 KB )
  42. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/middleware.php ( 0.19 KB )
  43. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/route.php ( 1.89 KB )
  44. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/session.php ( 0.57 KB )
  45. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/trace.php ( 0.34 KB )
  46. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/config/view.php ( 0.82 KB )
  47. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/event.php ( 0.25 KB )
  48. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  49. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/service.php ( 0.13 KB )
  50. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/AppService.php ( 0.26 KB )
  51. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  52. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  53. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  54. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  55. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  56. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/services.php ( 0.14 KB )
  57. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  58. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  59. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  60. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  61. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  62. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  63. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  64. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  65. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  66. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  67. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  68. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  69. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  70. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  71. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  72. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  73. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  74. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  75. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  76. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  77. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  78. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  79. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  80. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  81. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  82. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  83. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  84. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  85. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  86. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  87. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/Request.php ( 0.09 KB )
  88. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  89. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/middleware.php ( 0.25 KB )
  90. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  91. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  92. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  93. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  94. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  95. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  96. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  97. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  98. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  99. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  100. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  101. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  102. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  103. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/route/app.php ( 3.94 KB )
  104. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  105. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  106. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Index.php ( 9.87 KB )
  108. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/BaseController.php ( 2.05 KB )
  109. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  110. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  111. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  112. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  113. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  114. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  115. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  116. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  117. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  118. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  119. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  120. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  121. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  122. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  123. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  124. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  125. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  126. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  127. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  128. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  129. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  130. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  131. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  132. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  133. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  134. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  135. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/app/controller/Es.php ( 3.30 KB )
  136. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  137. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  138. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  139. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  140. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  141. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  142. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  143. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  144. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/runtime/temp/c935550e3e8a3a4c27dd94e439343fdf.php ( 31.50 KB )
  145. /yingpanguazai/ssd/ssd1/www/wwww.yeyulingfeng.com/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000792s ] mysql:host=127.0.0.1;port=3306;dbname=wenku;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001202s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000464s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000308s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000496s ]
  6. SELECT * FROM `set` [ RunTime:0.000199s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000521s ]
  8. SELECT * FROM `article` WHERE `id` = 790335 LIMIT 1 [ RunTime:0.000522s ]
  9. UPDATE `article` SET `lasttime` = 1782305499 WHERE `id` = 790335 [ RunTime:0.004528s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 64 LIMIT 1 [ RunTime:0.000241s ]
  11. SELECT * FROM `article` WHERE `id` < 790335 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.000494s ]
  12. SELECT * FROM `article` WHERE `id` > 790335 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000389s ]
  13. SELECT * FROM `article` WHERE `id` < 790335 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000991s ]
  14. SELECT * FROM `article` WHERE `id` < 790335 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.000739s ]
  15. SELECT * FROM `article` WHERE `id` < 790335 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.000965s ]
0.144140s