|
楼主 |
发表于 2018-3-30 14:54:22
|
显示全部楼层
本帖最后由 会爬树程序猿 于 2018-3-30 15:30 编辑
这样行不行,我在MySQL中写了函数,这边自定义action中写SQL调用函数把需要的数据查出来,前台queryAction调用这个action,设置参数,会自己解析成树形吗?这样行得通吗?
SQL语句:select * from wr_project_info where FIND_IN_SET(PROJ_CODE,getParentProjectList(:leaderID)) or
FIND_IN_SET(PROJ_CODE,getChildProjectList(:leaderID))
报错:com.justep.baas.action.ActionException: Action[projectManage/projectManage/queryProjectFilterAction]执行失败,SQL执行失败,SQL:SELECT * FROM wr_project_info WHERE FIND_IN_SET(PROJ_CODE,getParentProjectList(:leaderID) ) OR FIND_IN_SET(PROJ_CODE,getChildProjectList(:leaderID) ) LIMIT 0,20三月 30, 2018 2:55:34 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet WeX5_Baas_Servlet threw exception
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':leaderID) ) OR FIND_IN_SET(PROJ_CODE,getChildProjectList(:leaderID) ) LIMIT 0,' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
|
|