首页 > 解决方案 > Jasper 报告:通过集合参数执行 SQL 语句时出错

问题描述

我正在创建一个通过集合参数传递的报告。参数名称为“ids”,类为 java.util.Collection。

我的查询:

select  * from order_deliveryorder a 
left join order_deliveryorderline b on a.id = b.d_order_id
left join order_item c on c.id = b.product_id
left join order_orderline e on e.id = b.s_order_id
left join order_order f on e.order_id = f.id
left join order_itemsection g on g.id = f.section_id
left join order_location d on d.id = a.location_id
left join order_location h on h.id = a.from_location_id 
where a.id in ('2377900603251741014','2377900603251740997','2377900603251740967')

jasper 中的查询:

select  * from order_deliveryorder a 
left join order_deliveryorderline b on a.id = b.d_order_id
left join order_item c on c.id = b.product_id
left join order_orderline e on e.id = b.s_order_id
left join order_order f on e.order_id = f.id
left join order_itemsection g on g.id = f.section_id
left join order_location d on d.id = a.location_id
left join order_location h on h.id = a.from_location_id 
where $X{IN, a.id,  ids}

参数“ids”的值为 ["2377900603251741014","2377900603251740997","2377900603251740967"]

最后,遇到了执行sql语句的错误。

标签: postgresqlparametersjasper-reports

解决方案


推荐阅读