Skip to content

数据库查询数量限制

配置说明

Mybatis-config.xml 增加以下配置

xml
<plugins>
    <plugin interceptor="com.dcits.comet.dao.interceptor.LimitResultRowsInterceptor">
        <property name="maxRows" value="1"/>
    </plugin>
</plugins>

maxRows 的值为一个查询 sql 的最大获取结果数;对所有查询 sql 均生效。