|
版本: |
其它(帖子中说明) |
小版本号: |
|
|
|
数据库: |
MySQL |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 8 |
浏览器: |
Chrome |
|
|
关于这个链接的案例,http://docs.wex5.com/comps-tree/ 最后一个案例,自定义action实现树状关系,捋不清关系,做不出来。
第一:概念定义 fLeaves Integer类型 语句里
case 1:
sql = "select null as fParentID,1 as fLevel,false as fIsLeaves,fID,fName from "
+ TABLE_PROVINCE+" GROUP BY fID limit "+offset+","+limit;
sqlWhere = "";
showTable = TABLE_PROVINCE;
break;
case 2:
sql = "select fProvinceID as fParentID,2 as fLevel,false as fIsLeaves,"
+"concat_ws('-','"+parent+"',CONVERT(fID,char)) as fID,fName from "
+ TABLE_CITY+" where fProvinceID = "+parent+" GROUP BY fID limit "+offset+","+limit;
sqlWhere = "where fProvinceID = "+parent;
showTable = TABLE_CITY;
break;
case 3:
sql = "select fCityID as fParentID,3 as fLevel,true as fIsLeaves,"
+ "concat_ws('-','"+parent+"',CONVERT(fID,char)) as fID,fName from "
+ TABLE_COUNTY+" where fCityID = "+parent+" GROUP BY fID limit "+offset+","+limit;
sqlWhere = "where fCityID = "+parent;
showTable = TABLE_COUNTY;
break;
}
为什么语句里要给true 和 false,跑的时候错误
Caused by: com.justep.exception.KSQLException: 编码: JUSTEP154046;
提示: KSQL语法错误, _name as fName,^^true as fLeaves中未找到需要的元素, 位置66期望是以下元素之一:STRING, NUMBER, ONE_RELATION, IDENTIFER, VARIABLE
第二:直接手写语句,query里测试有数据,跑起来报错,第一级目录都没找到了,后台数据都传不过去更别提调试前台了
case 1: sql = "select F_product_info as fID,F_product_info.product_name as fName,1 as fLeaves,1 as Level ,null as fParentID from F_product_info F_product_info"; sqlWhere = "F_product_info.status = 1"; showTable = TABLE_PRODUCT;
执行sql: select F_product_info as fID,F_product_info.product_name as fName,1 as fLeaves,1 as Level ,null as fParentID from F_product_info F_product_info, binds: []出错
编码:JUSTEP150039
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'F_product_info' in 'field list'
综上,案例是15年的,是不是不适用了?
卡了近一个星期了,心情有点燥。指点一下!!!谢谢。 BeX5 3.7
|
-
概念定义
-
语句测试
|