Mybatis RowBounds 限制查询条数的实现代码
程序员文章站
2024-03-09 16:57:11
oracle 数据库,查询增加rowbounds限制查询条数,默认是0到1000条
private final static int rowlimit = 100...
oracle 数据库,查询增加rowbounds限制查询条数,默认是0到1000条
private final static int rowlimit = 1000; //限制查询条数 private final static rowbounds query_limit=new rowbounds(0,rowlimit); public list<t> select(string sqlid, t t) throws dbexception, recordnotfoundexception { list<t> ret; try { if ("".equals(sqlid) || (null == sqlid)) { ret = getsqlsession().selectlist(t.getmappername() + select, t,query_limit); } else { ret = getsqlsession().selectlist(t.getmappername() + mapper + sqlid, t,query_limit); } } catch (exception e) { logger.error(e.getmessage(), e); logger.debug(t.tostring()); throw new dbexception(e); } if (ret == null && checknull) { throw new recordnotfoundexception(t.gettablename()); } return ret; }
以上所述是小编给大家介绍的mybatis rowbounds 限制查询条数的实现代码,希望对大家有所帮助