主题: Debug [ ERROR:处理第2个参数错误:栏位索引超过许可范围:2,栏位数:1。]

frank 2020年03月05日 43

执行有条件的查询报错: Debug [ ERROR:处理第2个参数错误:栏位索引超过许可范围:2,栏位数:1。] 


 Debug [ ERROR:处理第2个参数错误:栏位索引超过许可范围:2,栏位数:1。] 

java代码

query.setPara("name", rt.getName());
query.setOrderBy("t2.directory_name,t1.\"NAME\"");
sqlManager.pageQuery("rTransformation.pageQuery", RTransformation.class, query);
List<RTransformation> list = query.getList();


md文件如下:

cols
===

t2.id_directory_parent,t2.directory_name,t1.id_transformation,t1.id_directory,t1."NAME",t1.description,t1.extended_description,t1.trans_version,t1.trans_status,t1.id_step_read,t1.id_step_write,t1.id_step_input,t1.id_step_output,t1.id_step_update,t1.id_database_log,t1.table_name_log,t1.use_batchid,t1.use_logfield,t1.id_database_maxdate,t1.table_name_maxdate,t1.field_name_maxdate,t1.offset_maxdate,t1.diff_maxdate,t1.created_user,t1.created_date,t1.modified_user,t1.modified_date,t1.size_rowset,t1.offset_maxdate_ktl

condition
===

@if(!isEmpty(name)){
and t1."NAME"=#name#
@}
pageQuery
===

with recursive t2 (id_directory,id_directory_parent,directory_name) as (
select
id_directory,
id_directory_parent,
'/'||directory_name
from r_directory
where id_directory_parent=0
union all
select
tm.id_directory,
tm.id_directory_parent,
t2.directory_name||'/'||tm.directory_name
from r_directory tm
inner join t2 on t2.id_directory=tm.id_directory_parent
)
select
@pageTag(){
#use("cols")#
@}
from r_transformation t1
inner join t2 on t2.id_directory = t1.id_directory
where 1=1
#use("condition")#

frank 2020年03月05日

用的是PostgreSQL,并且配置了PostgresStyle。其他查询都可以只要是带条件的查询就报类似的错误,感觉大佬们关注。

frank 2020年03月05日
┏━━━━━ Debug [rTransformation.pageQuery] ━━━
┣ SQL:	  with recursive t2 (id_directory,id_directory_parent,directory_name) as ( select id_directory, id_directory_parent, '/'||directory_name from r_directory where id_directory_parent=0 union all select tm.id_directory, tm.id_directory_parent, t2.directory_name||'/'||tm.directory_name from r_directory tm inner join t2 on t2.id_directory=tm.id_directory_parent ) select count(1) from r_transformation t1 inner join t2 on t2.id_directory = t1.id_directory where 1=1 and 1 = 1 and t1."NAME"=? 
┣ 参数:	 [, ]
┣ 位置:	 com.ruoyi.web.controller.kettle.TransformationController.pageQuery(TransformationController.java:49)
┗━━━━━ Debug [ ERROR:处理第2个参数错误:栏位索引超过许可范围:2,栏位数:1。] ━━━
闲大赋 2020年03月05日

beetlsql 的版本是多少,用最新的看看