解决方案 »

  1.   

     (SELECT 
                    id as id,
                    appserialnumber as appserialnumber,
                    who as who,
                    createtime as createtime,
                    operatedtype as operatedtype,
                    operate as operate,
                    operatedobject as operatedobject,
                    description as description,
                    result as result,
                    ROWNUM AS row_num
                 FROM server_log  and ROWNUM < (#{startRecord}+#{total}))
      

  2.   

    不知道是不是(#{startRecord}+#{total}) 这里引起的
    你试试sum(#{startRecord},#{total})测试下
    或者把这句干掉试试
    最好的是这个加法算法不要在xml里面做 , 后台加好再传进来
      

  3.   

    FROM server_log  ROWNUM < (#{startRecord}+#{total})
    这句是不是有问题? 少where?
      

  4.   

     (SELECT 
                    id as id,
                    appserialnumber as appserialnumber,
                    who as who,
                    createtime as createtime,
                    operatedtype as operatedtype,
                    operate as operate,
                    operatedobject as operatedobject,
                    description as description,
                    result as result,
                    ROWNUM AS row_num
                 FROM server_log  where ROWNUM < (#{startRecord}+#{total}))
      

  5.   

    你的select子查询少个右括号,不是错误很明显吗。
      

  6.   


    照着你说的改了,但是还是报缺失右括号!
    控制台输出:10:26:42,536 DEBUG Connection:27 - ooo Connection Opened
    10:26:42,853 DEBUG PreparedStatement:27 - ==>  Executing: select count(*) from server_log 
    10:26:42,853 DEBUG PreparedStatement:27 - ==>  Executing: select count(*) from server_log 
    10:26:42,854 DEBUG PreparedStatement:27 - ==> Parameters: 
    10:26:42,854 DEBUG PreparedStatement:27 - ==> Parameters: 
    10:26:43,050 DEBUG Connection:27 - ooo Connection Opened
    10:26:43,060 DEBUG PreparedStatement:27 - ==>  Executing: SELECT * FROM (SELECT id as id, appserialnumber as appserialnumber, who as who, createtime as createtime, operatedtype as operatedtype, operate as operate, operatedobject as operatedobject, description as description, result as result, ROWNUM AS row_num FROM server_log and ROWNUM < (?+?)) t_temp WHERE t_temp.row_num >= ? 
    10:26:43,060 DEBUG PreparedStatement:27 - ==>  Executing: SELECT * FROM (SELECT id as id, appserialnumber as appserialnumber, who as who, createtime as createtime, operatedtype as operatedtype, operate as operate, operatedobject as operatedobject, description as description, result as result, ROWNUM AS row_num FROM server_log and ROWNUM < (?+?)) t_temp WHERE t_temp.row_num >= ? 
    10:26:43,061 DEBUG PreparedStatement:27 - ==> Parameters: 0(Integer), 10(Integer), 0(Integer)
    10:26:43,061 DEBUG PreparedStatement:27 - ==> Parameters: 0(Integer), 10(Integer), 0(Integer)
    2014-8-1 10:26:43 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet SearchServlet threw exception
    org.apache.ibatis.exceptions.PersistenceException: 
    ### Error querying database.  Cause: java.sql.SQLException: ORA-00907: 缺失右括号
      

  7.   


    正解!!!!恩,就是这样,改为where就正确了!!谢谢!!
      

  8.   


    恩,原来你在下面又重新回复了一次,添加where就对了!!谢谢!