java代码: public Page<ReserveStore> queryReserveStore(User user,int pageNo) { Kv kv = Kv.by("lattitude", user.getLatitude()).set("longitude", user.getLongitude()); return paginate(pageNo, Global.pageSize, getSqlPara("user.queryReserveStore",kv)); } sql代码: #sql("queryReserveStore") SELECT id,store_name,province,city,area,address, ROUND(6378.138*2*ASIN(SQRT(POW(SIN((#para(lattitude)*PI()/180-latitude*PI()/180)/2),2)+ COS(#para(lattitude)*PI()/180)*COS(latitude*PI()/180)*POW(SIN((#para(longitude)*PI()/180-longitude*PI()/180)/2),2)))*1000) AS juli FROM y_reserve_store WHERE is_publish = 1 AND del_flag = 0 ORDER BY juli Asc #end 错误提示: com.jfinal.plugin.activerecord.ActiveRecordException: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0). at com.jfinal.plugin.activerecord.Model.doPaginate(Model.java:342) at com.jfinal.plugin.activerecord.Model.paginate(Model.java:982) at com.mibo.modules.data.model.ReserveStore.queryReserveStore(ReserveStore.java:20) at com.mibo.modules.app.service.UserService.store(UserService.java:1210) at com.mibo.modules.app.action.UserAction.store(UserAction.java:442) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.jfinal.aop.Invocation.invoke(Invocation.java:73) at com.mibo.common.interceptor.UserTokenInterceptor.intercept(UserTokenInterceptor.java:38) at com.jfinal.aop.Invocation.invoke(Invocation.java:67) at com.mibo.common.interceptor.ErrorInterceptor.intercept(ErrorInterceptor.java:15) at com.jfinal.aop.Invocation.invoke(Invocation.java:67) at com.jfinal.core.ActionHandler.handle(ActionHandler.java:83) at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48) at com.mibo.common.handler.NotFoundHandler.handle(NotFoundHandler.java:34) at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:73) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:506) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: java.sql.SQLException: Parameter index out of range (1 > number of parameters, which is 0). at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:957) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:896) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:885) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860) at com.mysql.jdbc.PreparedStatement.checkBounds(PreparedStatement.java:3319) at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3304) at com.mysql.jdbc.PreparedStatement.setInternal(PreparedStatement.java:3341) at com.mysql.jdbc.PreparedStatement.setDouble(PreparedStatement.java:3257) at com.mysql.jdbc.PreparedStatement.setObject(PreparedStatement.java:3533) at com.mysql.jdbc.JDBC42PreparedStatement.setObject(JDBC42PreparedStatement.java:68) at com.alibaba.druid.pool.DruidPooledPreparedStatement.setObject(DruidPooledPreparedStatement.java:481) at com.jfinal.plugin.activerecord.dialect.Dialect.fillStatement(Dialect.java:226) at com.jfinal.plugin.activerecord.DbPro.query(DbPro.java:79) at com.jfinal.plugin.activerecord.Db.query(Db.java:70) at com.jfinal.plugin.activerecord.Model.doPaginateByFullSql(Model.java:356) at com.jfinal.plugin.activerecord.Model.doPaginate(Model.java:340) ... 34 more
项目:JFinal